Class LocateOptions

java.lang.Object
com.google.gwt.core.client.JavaScriptObject

public class LocateOptions extends AbstractJsonOptions
Replicates the same class in LeafletJS: Some of the geolocation methods for Map take in an options parameter. This is a plain javascript object with the following optional components: Option Type Default Description watch Boolean false If true, starts continous watching of location changes (instead of detecting it once) using W3C watchPosition method. You can later stop watching using map.stopLocate() method. setView Boolean false If true, automatically sets the map view to the user location with respect to detection accuracy, or to world view if geolocation failed. maxZoom Number Infinity The maximum zoom for automatic view setting when using setView option. timeout Number 10000 Number of milliseconds to wait for a response from geolocation before firing a locationerror event. maximumAge Number 0 Maximum age of detected location. If less than this amount of milliseconds passed since last geolocation response, locate will return a cached location. enableHighAccuracy Boolean false Enables high accuracy, see description in the W3C spec.
  • Constructor Details

    • LocateOptions

      protected LocateOptions()
  • Method Details

    • create

      public static LocateOptions create()
    • setWatch

      public final void setWatch(boolean w)
    • setView

      public final void setView(boolean v)
    • setMaxZoom

      public final void setMaxZoom(double z)
    • setTimeout

      public final void setTimeout(double timeout)
    • setMaximumAge

      public final void setMaximumAge(double age)
    • setEnableHighAccuracy

      public final void setEnableHighAccuracy(boolean e)