Interface GeolocationFunctions
- All Superinterfaces:
ExecutableFunctions,Identifiable
- All Known Implementing Classes:
LeafletMap
Exposes the Leaflet geolocation methods of the map, allowing the user's
location to be detected and tracked via the browser Geolocation API.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidlocate()Tries to locate the user using the Geolocation API, firing a locationfound event with location data on success or a locationerror event on failure, and optionally sets the map view to the user's location with respect to detection accuracy (or to the world view if geolocation failed).default voidlocate(LocateOptions options) Tries to locate the user using the Geolocation API, firing a locationfound event with location data on success or a locationerror event on failure, and optionally sets the map view to the user's location with respect to detection accuracy (or to the world view if geolocation failed).default voidStops watching location previously initiated by map.locate({watch: true}) and aborts resetting the map view if map.locate was called with {setView: true}.Methods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.map.functions.ExecutableFunctions
call, call, executeJs, executeJsMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.Identifiable
getUuid
-
Method Details
-
locate
default void locate()Tries to locate the user using the Geolocation API, firing a locationfound event with location data on success or a locationerror event on failure, and optionally sets the map view to the user's location with respect to detection accuracy (or to the world view if geolocation failed). Note that, if your page doesn't use HTTPS, this method will fail in modern browsers (Chrome 50 and newer) -
locate
Tries to locate the user using the Geolocation API, firing a locationfound event with location data on success or a locationerror event on failure, and optionally sets the map view to the user's location with respect to detection accuracy (or to the world view if geolocation failed). Note that, if your page doesn't use HTTPS, this method will fail in modern browsers (Chrome 50 and newer) See Locate options for more details.- Parameters:
options- the locate options
-
stopLocate
default void stopLocate()Stops watching location previously initiated by map.locate({watch: true}) and aborts resetting the map view if map.locate was called with {setView: true}.
-