Package io.jmix.mapsflowui.kit.component
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 Summary
Modifier and TypeFieldDescriptionprotected com.vaadin.flow.shared.Registration
protected com.vaadin.flow.shared.Registration
protected com.vaadin.flow.shared.Registration
protected com.vaadin.flow.shared.Registration
protected com.vaadin.flow.shared.Registration
protected com.vaadin.flow.shared.Registration
protected com.vaadin.flow.shared.Registration
protected final MapOptions
protected JmixMapSerializer
protected com.vaadin.flow.internal.StateTree.ExecutionRegistration
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds layer to the map.protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected MapOptions
protected JmixMapSerializer
protected void
fireFeatureClickEvent
(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature) protected void
fireSourceFeatureClickEvent
(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature, AbstractFeatureSource source) protected Feature
getFeatureBySyncId
(AbstractVectorSource source, UUID syncId) <S extends Layer<?>>
SReturns a layer by its ID.protected Layer<?>
getLayerBySyncId
(UUID layerSyncId) <L extends Layer<?>>
LgetLayerOrNull
(String layerId) Returns a layer by its ID ornull
if the map does not contain a layer with the provided ID.Collection<Layer<?>>
double
getZoom()
Delegates to the map's view.protected void
onAttach
(com.vaadin.flow.component.AttachEvent attachEvent) protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
performUpdateMap
(com.vaadin.flow.internal.ExecutionContext context) void
removeLayer
(Layer<?> layer) Removes layer from the map.protected void
void
setMapView
(MapView view) Sets map view.void
setZoom
(double zoom) Zooms to a specific zoom level.void
zoomToExtent
(Extent extent) Sets a map's visible area that contains the given geographical bounds with the maximum zoom level possible.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, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
options
-
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
Adds layer to the map.- Parameters:
layer
- layer to add
-
removeLayer
Removes layer from the map.- Parameters:
layer
- layer to remove
-
getLayers
- Returns:
- unmodifiable collection of layers
-
getLayerOrNull
Returns a layer by its ID ornull
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
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
- Returns:
- map view
-
setMapView
Sets map view. It replaces previous default map view. To change zoom or center coordinate, usegetMapView()
, for instance:map.getMapView().setZoom(10);
- Parameters:
view
- map view to set
-
getZoom
public double getZoom()Delegates to the map's view. SeegetMapView()
.- 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
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
-
createSerializer
-
attachMapOptionsChangeListener
protected void attachMapOptionsChangeListener() -
onMapOptionsChange
-
requestUpdateMap
protected void requestUpdateMap() -
performUpdateMap
protected void performUpdateMap(com.vaadin.flow.internal.ExecutionContext context) -
getAdditionalPropertiesToUpdate
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttach
in classcom.vaadin.flow.component.Component
-
attachMapClickDomEventListener
protected void attachMapClickDomEventListener() -
onMapClickDomEvent
-
attachMapSingleClickDomEventListener
protected void attachMapSingleClickDomEventListener() -
onMapSingleClickDomEvent
-
attachMapDoubleClickDomEventListener
protected void attachMapDoubleClickDomEventListener() -
onMapDoubleClickDomEvent
-
attachMapMoveEndListener
protected void attachMapMoveEndListener() -
onMapMoveEndEvent
-
attachMapZoomChangedListener
protected void attachMapZoomChangedListener() -
onMapZoomChangedEvent
-
attachFeatureClickDomEventListeners
protected void attachFeatureClickDomEventListeners() -
onFeatureClickEvent
-
fireFeatureClickEvent
protected void fireFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature) -
fireSourceFeatureClickEvent
protected void fireSourceFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature, AbstractFeatureSource source) -
getFeatureBySyncId
-
getLayerBySyncId
-