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
FieldsModifier and TypeFieldDescriptionprotected com.vaadin.flow.shared.Registrationprotected com.vaadin.flow.shared.Registrationprotected com.vaadin.flow.shared.Registrationprotected com.vaadin.flow.shared.Registrationprotected com.vaadin.flow.shared.Registrationprotected com.vaadin.flow.shared.Registrationprotected com.vaadin.flow.shared.Registrationprotected final MapOptionsprotected JmixMapSerializerprotected com.vaadin.flow.internal.StateTree.ExecutionRegistration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds layer to the map.protected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected MapOptionsprotected JmixMapSerializerprotected voidfireFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature) protected voidfireSourceFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature, AbstractFeatureSource source) protected FeaturegetFeatureBySyncId(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 ornullif the map does not contain a layer with the provided ID.Collection<Layer<?>>doublegetZoom()Delegates to the map's view.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidperformUpdateMap(com.vaadin.flow.internal.ExecutionContext context) voidremoveLayer(Layer<?> layer) Removes layer from the map.protected voidvoidsetMapView(MapView view) Sets map view.voidsetZoom(double zoom) Zooms to a specific zoom level.voidzoomToExtent(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, 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, 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 ornullif 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:
onAttachin 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
-