java.lang.Object
org.vaadin.addons.componentfactory.leaflet.options.LocateOptions
All Implemented Interfaces:
Serializable

public class LocateOptions extends Object implements Serializable
Some of the geolocation methods for Map take in an options parameter.
Since:
2020-03-11
Version:
1.0
Author:
Gabor Kokeny Email: kokeny19@gmail.com
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the maximum age of the detected location for which a cached result may be returned.
    int
    Returns the maximum zoom used for automatic view setting.
    int
    Returns the number of milliseconds to wait for a geolocation response.
    boolean
    Returns whether high accuracy geolocation is enabled.
    boolean
    Returns whether the map view is set automatically to the detected user location.
    boolean
    Returns whether continuous watching of location changes is enabled.
    void
    setEnableHighAccuracy(boolean enableHighAccuracy)
    Enables high accuracy, see description in the W3C spec.
    void
    setMaximumAge(int maximumAge)
    Maximum age of detected location.
    void
    setMaxZoom(int maxZoom)
    The maximum zoom for automatic view setting when using setView option.
    void
    setSetView(boolean setView)
    If true, automatically sets the map view to the user location with respect to detection accuracy, or to world view if geolocation failed.
    void
    setTimeout(int timeout)
    Number of milliseconds to wait for a response from geolocation before firing a locationerror event.
    void
    setWatch(boolean watch)
    If true, starts continuous watching of location changes (instead of detecting it once) using W3C watchPosition method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LocateOptions

      public LocateOptions()
  • Method Details

    • isWatch

      public boolean isWatch()
      Returns whether continuous watching of location changes is enabled.
      Returns:
      the watch
    • setWatch

      public void setWatch(boolean watch)
      If true, starts continuous watching of location changes (instead of detecting it once) using W3C watchPosition method. You can later stop watching using map.stopLocate() method.
      Parameters:
      watch - the watch to set
    • isSetView

      public boolean isSetView()
      Returns whether the map view is set automatically to the detected user location.
      Returns:
      the setView
    • setSetView

      public void setSetView(boolean setView)
      If true, automatically sets the map view to the user location with respect to detection accuracy, or to world view if geolocation failed.
      Parameters:
      setView - the setView to set
    • getMaxZoom

      public int getMaxZoom()
      Returns the maximum zoom used for automatic view setting.
      Returns:
      the maxZoom
    • setMaxZoom

      public void setMaxZoom(int maxZoom)
      The maximum zoom for automatic view setting when using setView option.
      Parameters:
      maxZoom - the maxZoom to set
    • getTimeout

      public int getTimeout()
      Returns the number of milliseconds to wait for a geolocation response.
      Returns:
      the timeout
    • setTimeout

      public void setTimeout(int timeout)
      Number of milliseconds to wait for a response from geolocation before firing a locationerror event.
      Parameters:
      timeout - the timeout to set
    • getMaximumAge

      public int getMaximumAge()
      Returns the maximum age of the detected location for which a cached result may be returned.
      Returns:
      the maximumAge
    • setMaximumAge

      public void setMaximumAge(int maximumAge)
      Maximum age of detected location. If less than this amount of milliseconds passed since last geolocation response, locate will return a cached location.
      Parameters:
      maximumAge - the maximumAge to set
    • isEnableHighAccuracy

      public boolean isEnableHighAccuracy()
      Returns whether high accuracy geolocation is enabled.
      Returns:
      the enableHighAccuracy
    • setEnableHighAccuracy

      public void setEnableHighAccuracy(boolean enableHighAccuracy)
      Enables high accuracy, see description in the W3C spec.
      Parameters:
      enableHighAccuracy - the enableHighAccuracy to set