Wednesday, January 25, 2017

Re: Geolocation problems

Apologies, I did not look very hard for the already reported issue.

null is required to indicate the browser does not support providing that specific value I believe, so I can understand why Double was used.

For now I've used my own overlay.

Thanks

On Wednesday, January 25, 2017 at 2:36:15 PM UTC, Thomas Broyer wrote:


On Wednesday, January 25, 2017 at 11:56:20 AM UTC+1, Paul wrote:
See http://www.gwtproject.org/javadoc/latest/com/google/gwt/geolocation/client/Position.Coordinates.html

Several methods return Double e.g.

public Double getSpeed()

The JavaScript object overlay that implements this method is...

    @Override
   
public final native Double getSpeed() /*-{
      return this.speed || null;
    }-*/
;


However this.speed is a primitive double or null according to ...


So surely this is incorrect?

In GWT 2.7.0 and earlier, returning a JS Number as a java.lang.Double would be an error; but in GWT 2.8.0 java.lang.Double and double are interchangeable (same for java.lang.Boolean and boolean). This was actually reported 2 years ago: https://github.com/gwtproject/gwt/issues/9058
It is however probably incorrect to turn a 0 value into a null yes.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment