Class JmixMap

java.lang.Object
com.vaadin.flow.component.Component
io.jmix.mapsflowui.kit.component.JmixMap
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.HasStyle, Serializable
Direct Known Subclasses:
GeoMap

@Tag("jmix-openlayers-map") @JsModule("./src/openlayers-map/jmix-openlayers-map.js") @NpmPackage(value="ol",version="8.2.0") @NpmPackage(value="proj4",version="2.9.2") public class JmixMap extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle
See Also:
  • Field Details

    • options

      protected final MapOptions options
    • serializer

      protected JmixMapSerializer serializer
    • synchronizeMapExecution

      protected com.vaadin.flow.internal.StateTree.ExecutionRegistration synchronizeMapExecution
    • mapClickDomRegistration

      protected com.vaadin.flow.shared.Registration mapClickDomRegistration
    • mapSingleClickDomRegistration

      protected com.vaadin.flow.shared.Registration mapSingleClickDomRegistration
    • mapDoubleClickDomRegistration

      protected com.vaadin.flow.shared.Registration mapDoubleClickDomRegistration
    • featureClickDomRegistration

      protected com.vaadin.flow.shared.Registration featureClickDomRegistration
    • featureSingleClickDomRegistration

      protected com.vaadin.flow.shared.Registration featureSingleClickDomRegistration
    • featureDoubleClickDomRegistration

      protected com.vaadin.flow.shared.Registration featureDoubleClickDomRegistration
    • mapZoomChangedDomRegistration

      protected com.vaadin.flow.shared.Registration mapZoomChangedDomRegistration
  • Constructor Details

    • JmixMap

      public JmixMap()
  • Method Details

    • addLayer

      public void addLayer(Layer<?> layer)
      Adds layer to the map.
      Parameters:
      layer - layer to add
    • removeLayer

      public void removeLayer(Layer<?> layer)
      Removes layer from the map.
      Parameters:
      layer - layer to remove
    • getLayers

      public Collection<Layer<?>> getLayers()
      Returns:
      unmodifiable collection of layers
    • getLayerOrNull

      public <L extends Layer<?>> L getLayerOrNull(String layerId)
      Returns a layer by its ID or null if the map does not contain a layer with the provided ID.
      Type Parameters:
      L - layer type
      Parameters:
      layerId - ID of a layer
      Returns:
      layer
    • getLayer

      public <S extends Layer<?>> S getLayer(String layerId)
      Returns a layer by its ID.
      Parameters:
      layerId - ID of a layer
      Returns:
      layer
      Throws:
      IllegalArgumentException - when map does not contain a layer with the provided ID
    • getMapView

      public MapView getMapView()
      Returns:
      map view
    • setMapView

      public void setMapView(MapView view)
      Sets map view. It replaces previous default map view. To change zoom or center coordinate, use getMapView(), for instance:
       map.getMapView().setZoom(10);
       
      Parameters:
      view - map view to set
    • getZoom

      public double getZoom()
      Delegates to the map's view. See getMapView().
      Returns:
      current map zoom level
    • setZoom

      public void setZoom(double zoom)
      Zooms to a specific zoom level. The zoom level starts at 0 as the most zoomed-out level, and then continually increases to zoom further in.

      Delegates to the map's view. See getMapView().

      Parameters:
      zoom - zoom level to set
    • zoomToExtent

      public void zoomToExtent(Extent extent)
      Sets a map's visible area that contains the given geographical bounds with the maximum zoom level possible.
      Parameters:
      extent - an extent (or bounding box)
    • createMapOptions

      protected MapOptions createMapOptions()
    • createSerializer

      protected JmixMapSerializer createSerializer()
    • attachMapOptionsChangeListener

      protected void attachMapOptionsChangeListener()
    • onMapOptionsChange

      protected void onMapOptionsChange(MapObservableObject.ObjectChangeEvent event)
    • requestUpdateMap

      protected void requestUpdateMap()
    • performUpdateMap

      protected void performUpdateMap(com.vaadin.flow.internal.ExecutionContext context)
    • getAdditionalPropertiesToUpdate

      protected Map<String,elemental.json.JsonValue> getAdditionalPropertiesToUpdate()
    • onAttach

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

      protected void attachMapClickDomEventListener()
    • onMapClickDomEvent

      protected void onMapClickDomEvent(MapClickDomEvent event)
    • attachMapSingleClickDomEventListener

      protected void attachMapSingleClickDomEventListener()
    • onMapSingleClickDomEvent

      protected void onMapSingleClickDomEvent(MapSingleClickDomEvent event)
    • attachMapDoubleClickDomEventListener

      protected void attachMapDoubleClickDomEventListener()
    • onMapDoubleClickDomEvent

      protected void onMapDoubleClickDomEvent(MapDoubleClickDomEvent event)
    • attachMapMoveEndListener

      protected void attachMapMoveEndListener()
    • onMapMoveEndEvent

      protected void onMapMoveEndEvent(MapMoveEndDomEvent event)
    • attachMapZoomChangedListener

      protected void attachMapZoomChangedListener()
    • onMapZoomChangedEvent

      protected void onMapZoomChangedEvent(MapZoomChangedDomEvent event)
    • attachFeatureClickDomEventListeners

      protected void attachFeatureClickDomEventListeners()
    • onFeatureClickEvent

      protected void onFeatureClickEvent(AbstractFeatureClickDomEvent event)
    • fireFeatureClickEvent

      protected void fireFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature)
    • fireSourceFeatureClickEvent

      protected void fireSourceFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature, AbstractFeatureSource source)
    • getFeatureBySyncId

      protected Feature getFeatureBySyncId(AbstractVectorSource source, UUID syncId)
    • getLayerBySyncId

      protected Layer<?> getLayerBySyncId(UUID layerSyncId)