Package io.jmix.mapsflowui.component
Class GeoMap
java.lang.Object
com.vaadin.flow.component.Component
io.jmix.mapsflowui.kit.component.JmixMap
io.jmix.mapsflowui.component.GeoMap
- 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
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
public class GeoMap
extends JmixMap
implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
UI component that displays a geographical data provided by
Layer
s.
The map is built by superposing layers. Initially, map does not have layers.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
protected Collection<ProjectionRegistration>
Fields inherited from class io.jmix.mapsflowui.kit.component.JmixMap
featureClickDomRegistration, featureDoubleClickDomRegistration, featureSingleClickDomRegistration, mapClickDomRegistration, mapDoubleClickDomRegistration, mapSingleClickDomRegistration, options, serializer, synchronizeMapExecution
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addClickListener
(com.vaadin.flow.component.ComponentEventListener<MapClickEvent> listener) Adds map click listener.com.vaadin.flow.shared.Registration
addDoubleClickListener
(com.vaadin.flow.component.ComponentEventListener<MapDoubleClickEvent> listener) Adds map double click listener.void
Adds layer to the map.com.vaadin.flow.shared.Registration
addSingleClickListener
(com.vaadin.flow.component.ComponentEventListener<MapSingleClickEvent> listener) Adds map single click listener.void
protected void
protected MapOptions
protected JmixMapSerializer
protected void
fireFeatureClickEvent
(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature) protected void
fireMapClickEvent
(MapClickDomEvent domEvent) protected void
protected void
protected void
fireSourceFeatureClickEvent
(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature, AbstractFeatureSource source) <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.protected void
onDetach
(com.vaadin.flow.component.DetachEvent detachEvent) protected void
protected void
protected void
protected void
void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setMapView
(MapView view) Sets map view.void
setProjection
(CRS projection) Sets the projection for coordinates supplied from and returned by API methods.Methods inherited from class io.jmix.mapsflowui.kit.component.JmixMap
attachFeatureClickDomEventListeners, attachMapClickDomEventListener, attachMapDoubleClickDomEventListener, attachMapOptionsChangeListener, attachMapSingleClickDomEventListener, getFeatureBySyncId, getLayer, getLayerBySyncId, getLayers, onAttach, onMapOptionsChange, performUpdateMap, removeLayer, requestUpdateMap
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, 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
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
projections
-
-
Constructor Details
-
GeoMap
public GeoMap()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
autowireDependencies
protected void autowireDependencies() -
addLayer
Adds layer to the map. -
getLayerOrNull
Returns a layer by its ID ornull
if the map does not contain a layer with the provided ID.- Overrides:
getLayerOrNull
in classJmixMap
- Type Parameters:
L
- layer type- Parameters:
layerId
- ID of a layer- Returns:
- layer
-
getMapView
- Overrides:
getMapView
in classJmixMap
- Returns:
- map view
-
setMapView
Sets map view. It replaces previous default map view. To change zoom or center coordinate, useJmixMap.getMapView()
, for instance:map.getMapView().setZoom(10);
- Overrides:
setMapView
in classJmixMap
- Parameters:
view
- map view to set- See Also:
-
setProjection
Sets the projection for coordinates supplied from and returned by API methods.Note, the projection will be used for all maps on the page.
- Parameters:
projection
- projection to set
-
addClickListener
public com.vaadin.flow.shared.Registration addClickListener(com.vaadin.flow.component.ComponentEventListener<MapClickEvent> listener) Adds map click listener. Note, if the user makes double click on a map, theMapClickEvent
will be fired twice.- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addSingleClickListener
public com.vaadin.flow.shared.Registration addSingleClickListener(com.vaadin.flow.component.ComponentEventListener<MapSingleClickEvent> listener) Adds map single click listener. Single click means that an event won't be fired if the user makes double click.- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addDoubleClickListener
public com.vaadin.flow.shared.Registration addDoubleClickListener(com.vaadin.flow.component.ComponentEventListener<MapDoubleClickEvent> listener) Adds map double click listener.- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
getAdditionalPropertiesToUpdate
- Overrides:
getAdditionalPropertiesToUpdate
in classJmixMap
-
createSerializer
- Overrides:
createSerializer
in classJmixMap
-
createMapOptions
- Overrides:
createMapOptions
in classJmixMap
-
onFeatureClickEvent
- Overrides:
onFeatureClickEvent
in classJmixMap
-
fireFeatureClickEvent
protected void fireFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature) - Overrides:
fireFeatureClickEvent
in classJmixMap
-
fireSourceFeatureClickEvent
protected void fireSourceFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature, AbstractFeatureSource source) - Overrides:
fireSourceFeatureClickEvent
in classJmixMap
-
onMapClickDomEvent
- Overrides:
onMapClickDomEvent
in classJmixMap
-
fireMapClickEvent
-
onMapSingleClickDomEvent
- Overrides:
onMapSingleClickDomEvent
in classJmixMap
-
fireMapSingleClickDomEvent
-
onMapDoubleClickDomEvent
- Overrides:
onMapDoubleClickDomEvent
in classJmixMap
-
fireMapDoubleClickDomEvent
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetach
in classcom.vaadin.flow.component.Component
-