Class LocateOptions
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.options.LocateOptions
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum age of the detected location for which a cached result may be returned.intReturns the maximum zoom used for automatic view setting.intReturns the number of milliseconds to wait for a geolocation response.booleanReturns whether high accuracy geolocation is enabled.booleanReturns whether the map view is set automatically to the detected user location.booleanisWatch()Returns whether continuous watching of location changes is enabled.voidsetEnableHighAccuracy(boolean enableHighAccuracy) Enables high accuracy, see description in the W3C spec.voidsetMaximumAge(int maximumAge) Maximum age of detected location.voidsetMaxZoom(int maxZoom) The maximum zoom for automatic view setting when using setView option.voidsetSetView(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.voidsetTimeout(int timeout) Number of milliseconds to wait for a response from geolocation before firing a locationerror event.voidsetWatch(boolean watch) If true, starts continuous watching of location changes (instead of detecting it once) using W3C watchPosition method.
-
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
-