Class MapBase

  • All Implemented Interfaces:
    com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasTheme, Serializable
    Direct Known Subclasses:
    Map

    public abstract class MapBase
    extends com.vaadin.flow.component.Component
    implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasTheme
    Base class for the map component. Contains all base functionality for the map component, but does not provide any defaults. This component should not be used directly, instead use Map, which also provides some out-of-the-box conveniences such as a pre-configured background layer, and a feature layer.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MapBase()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.vaadin.flow.shared.Registration addClickEventListener​(com.vaadin.flow.component.ComponentEventListener<MapClickEvent> listener)
      Adds a click listener for the map.
      com.vaadin.flow.shared.Registration addFeatureClickListener​(com.vaadin.flow.component.ComponentEventListener<MapFeatureClickEvent> listener)
      Adds a click listener for geographical features.
      com.vaadin.flow.shared.Registration addFeatureClickListener​(VectorLayer layer, com.vaadin.flow.component.ComponentEventListener<MapFeatureClickEvent> listener)
      Adds a click listener for geographical features.
      void addThemeVariants​(MapVariant... variants)
      Adds theme variants to the component.
      com.vaadin.flow.shared.Registration addViewMoveEndEventListener​(com.vaadin.flow.component.ComponentEventListener<MapViewMoveEndEvent> listener)
      Adds an event listener for changes to the map's viewport.
      protected Configuration getConfiguration()  
      View getView()
      Gets the View of the map.
      protected void onAttach​(com.vaadin.flow.component.AttachEvent attachEvent)  
      void removeThemeVariants​(MapVariant... variants)
      Removes theme variants from the component.
      void setView​(View view)
      Sets 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, scrollIntoView, set, setElement, setId, setVisible
      • Methods inherited from interface com.vaadin.flow.component.AttachNotifier

        addAttachListener
      • Methods inherited from interface com.vaadin.flow.component.DetachNotifier

        addDetachListener
      • Methods inherited from interface com.vaadin.flow.component.HasElement

        getElement
      • Methods 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, setWidthFull
      • Methods inherited from interface com.vaadin.flow.component.HasTheme

        addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
    • Constructor Detail

      • MapBase

        protected MapBase()
    • Method Detail

      • getView

        public View getView()
        Gets the View of 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

        public void setView​(View view)
        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

        protected void onAttach​(com.vaadin.flow.component.AttachEvent attachEvent)
        Overrides:
        onAttach in class com.vaadin.flow.component.Component
      • addViewMoveEndEventListener

        public com.vaadin.flow.shared.Registration addViewMoveEndEventListener​(com.vaadin.flow.component.ComponentEventListener<MapViewMoveEndEvent> listener)
        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 -
        Returns:
        a registration object for removing the added listener
      • addClickEventListener

        public com.vaadin.flow.shared.Registration addClickEventListener​(com.vaadin.flow.component.ComponentEventListener<MapClickEvent> listener)
        Adds a click listener for the map.

        Note that the listener will also be invoked when clicking on a Feature. Use MapClickEvent.getFeatures() to distinguish whether a feature exists at the clicked location.

        Parameters:
        listener -
        Returns:
        a registration object for removing the added listener
      • addFeatureClickListener

        public com.vaadin.flow.shared.Registration addFeatureClickListener​(VectorLayer layer,
                                                                           com.vaadin.flow.component.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.
        Parameters:
        listener - the listener to trigger
        Returns:
        registration for the listener
        See Also:
        Feature
      • addFeatureClickListener

        public com.vaadin.flow.shared.Registration addFeatureClickListener​(com.vaadin.flow.component.ComponentEventListener<MapFeatureClickEvent> listener)
        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, see addFeatureClickListener(VectorLayer, ComponentEventListener). For clicks on overlapping features, the listener will be invoked only for the top-level feature at that location.
        Parameters:
        listener - the listener to trigger
        Returns:
        registration for the listener
        See Also:
        Feature
      • addThemeVariants

        public void addThemeVariants​(MapVariant... variants)
        Adds theme variants to the component.
        Parameters:
        variants - theme variants to add
      • removeThemeVariants

        public void removeThemeVariants​(MapVariant... variants)
        Removes theme variants from the component.
        Parameters:
        variants - theme variants to remove