Class MapBase
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasElement,HasSize,HasStyle,HasTheme,HasThemeVariant<MapVariant>,Serializable
- Direct Known Subclasses:
Map
Map, which also provides some
out-of-the-box conveniences such as a pre-configured background layer, and a
feature layer.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.addClickListener(ComponentEventListener<MapClickEvent> listener) Adds a click listener for the map.Adds a click listener for clusters of features.Adds a click listener for geographical features.addFeatureClickListener(VectorLayer layer, ComponentEventListener<MapFeatureClickEvent> listener) Adds a click listener for geographical features.Adds an event listener for when a feature is dropped after a drag operation.Deprecated, for removal: This API element is subject to removal in a future version.useaddViewMoveEndListener(ComponentEventListener)insteadAdds an event listener for changes to the map's viewport.protected ConfigurationgetView()Gets theViewof the map.protected voidonAttach(AttachEvent attachEvent) Called when the component is attached to a UI.voidSets the view of the map.Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariants
-
Constructor Details
-
MapBase
protected MapBase()
-
-
Method Details
-
getConfiguration
-
getView
Gets theViewof the map. The view allows controlling properties of the map's viewport, such as center, zoom level and rotation.- Returns:
- the map's view
-
setView
Sets the view of the map. This is only necessary when dealing with map services that use custom coordinate projection, in which case a view with a matching projection needs to be created and used.- Parameters:
view- the new view
-
onAttach
Description copied from class:ComponentCalled when the component is attached to a UI.This method is invoked before the
Make sure to callAttachEventis fired for the component.super.onAttachwhen overriding this method. -
addViewMoveEndEventListener
@Deprecated(since="25.0", forRemoval=true) public Registration addViewMoveEndEventListener(ComponentEventListener<MapViewMoveEndEvent> listener) Deprecated, for removal: This API element is subject to removal in a future version.useaddViewMoveEndListener(ComponentEventListener)insteadAdds an event listener for changes to the map's viewport. The event will only be triggered after the user has finished manipulating the viewport, for example after letting go of the mouse button after a mouse drag interaction.- Parameters:
listener- the listener to add- Returns:
- a registration object for removing the added listener
-
addViewMoveEndListener
Adds an event listener for changes to the map's viewport. The event will only be triggered after the user has finished manipulating the viewport, for example after letting go of the mouse button after a mouse drag interaction.- Parameters:
listener- the listener to add- Returns:
- a registration object for removing the added listener
-
addClickEventListener
@Deprecated(since="25.0", forRemoval=true) public Registration addClickEventListener(ComponentEventListener<MapClickEvent> listener) Deprecated, for removal: This API element is subject to removal in a future version.useaddClickListener(ComponentEventListener)insteadAdds a click listener for the map.Note that the listener will also be invoked when clicking on a
Feature. UseMapClickEvent.getFeatures()to distinguish whether a feature exists at the clicked location.- Parameters:
listener- the listener to add- Returns:
- a registration object for removing the added listener
-
addClickListener
Adds a click listener for the map.Note that the listener will also be invoked when clicking on a
Feature. UseMapClickEvent.getFeatures()to distinguish whether a feature exists at the clicked location.- Parameters:
listener- the listener to add- Returns:
- a registration object for removing the added listener
-
addFeatureClickListener
public Registration addFeatureClickListener(VectorLayer layer, ComponentEventListener<MapFeatureClickEvent> listener) Adds a click listener for geographical features. The listener will be invoked for a click on any feature in the specified layer. For clicks on overlapping features, the listener will be invoked only for the top-level feature at that location.When clustering is enabled, the listener will only be invoked for clicks on individual features. Use
addClusterClickListener(ComponentEventListener)to listen for clicks on clusters.- Parameters:
listener- the listener to trigger- Returns:
- registration for the listener
- See Also:
-
addFeatureClickListener
Adds a click listener for geographical features. The listener will be invoked for a click on any feature, in any layer. To listen for feature clicks in a specific layer, seeaddFeatureClickListener(VectorLayer, ComponentEventListener). For clicks on overlapping features, the listener will be invoked only for the top-level feature at that location.When clustering is enabled, the listener will only be invoked for clicks on individual features. Use
addClusterClickListener(ComponentEventListener)to listen for clicks on clusters.- Parameters:
listener- the listener to trigger- Returns:
- registration for the listener
- See Also:
-
addClusterClickListener
Adds a click listener for clusters of features. The listener will be invoked for a click on any cluster, in any feature layer. UseaddFeatureClickListener(ComponentEventListener)to listen for clicks on individual features.- Parameters:
listener- the listener to trigger- Returns:
- registration for the listener
-
addFeatureDropListener
Adds an event listener for when a feature is dropped after a drag operation. Features can be made draggable by settingFeature.setDraggable(boolean).- Parameters:
listener- the listener to trigger- Returns:
- registration for the listener
- See Also:
-
addClickListener(ComponentEventListener)instead