@HtmlImport(value="frontend://webapi/geolocation.html") @Tag(value="rap-geolocation") public class Geolocation extends JavascriptTemplate<Geolocation.GeolocationTemplateModel>
| Modifier and Type | Class and Description |
|---|---|
static interface |
Geolocation.GeolocationTemplateModel |
| Constructor and Description |
|---|
Geolocation(com.vaadin.flow.component.HasElement parent) |
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.flow.shared.Registration |
addPositionErrorConsumer(com.vaadin.flow.function.SerializableConsumer<PositionError> consumer)
Add a position error consumer.
|
com.vaadin.flow.shared.Registration |
addPositionListener(com.vaadin.flow.function.SerializableConsumer<Position> listener)
Add a position listener.
|
void |
clearWatch()
Clears the listeners registered with the addPosition...
|
void |
getCurrentPosition(PositionOptions options)
Ask the device for its current geographic location.
|
com.vaadin.flow.shared.Registration |
watchPosition(PositionOptions options)
Queries the geographic location of the device.
|
clearConsumers, notifyConsumers, registerConsumer, registerConsumer, unregisterAllConsumers, unregisterAllConsumersgetModel, getModelType, getModelType, getStateNode, initModel, isSupportedClassaddListener, fireEvent, from, get, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisiblepublic com.vaadin.flow.shared.Registration addPositionListener(com.vaadin.flow.function.SerializableConsumer<Position> listener)
watchPosition(PositionOptions) returns a
position successfully.public com.vaadin.flow.shared.Registration addPositionErrorConsumer(com.vaadin.flow.function.SerializableConsumer<PositionError> consumer)
watchPosition(PositionOptions) returns an
error.public void getCurrentPosition(PositionOptions options)
addPositionListener(SerializableConsumer) are called. If errors are received the consumers added via
addPositionErrorConsumer(SerializableConsumer) are called.options - Various options used for the query. If a simple read suffices the PositionOptions#DEFAULT
constant can be used.public com.vaadin.flow.shared.Registration watchPosition(PositionOptions options)
addPositionListener(SerializableConsumer) are called. If an error is received the consumers added via
addPositionErrorConsumer(SerializableConsumer) are called.options - Various options that are used for the location query.public void clearWatch()
Copyright © 2020 XDEV Software Corp.. All rights reserved.