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
Layers.
The map is built by superposing layers. Initially, map does not have layers.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected Collection<ProjectionRegistration>Fields inherited from class io.jmix.mapsflowui.kit.component.JmixMap
featureClickDomRegistration, featureDoubleClickDomRegistration, featureSingleClickDomRegistration, mapClickDomRegistration, mapDoubleClickDomRegistration, mapSingleClickDomRegistration, options, serializer, synchronizeMapExecution -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddClickListener(com.vaadin.flow.component.ComponentEventListener<MapClickEvent> listener) Adds map click listener.com.vaadin.flow.shared.RegistrationaddDoubleClickListener(com.vaadin.flow.component.ComponentEventListener<MapDoubleClickEvent> listener) Adds map double click listener.voidAdds layer to the map.com.vaadin.flow.shared.RegistrationaddSingleClickListener(com.vaadin.flow.component.ComponentEventListener<MapSingleClickEvent> listener) Adds map single click listener.voidprotected voidprotected MapOptionsprotected JmixMapSerializerprotected voidfireFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature) protected voidfireMapClickEvent(MapClickDomEvent domEvent) protected voidprotected voidprotected voidfireSourceFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature, AbstractFeatureSource source) <L extends Layer<?>>
LgetLayerOrNull(String layerId) Returns a layer by its ID ornullif the map does not contain a layer with the provided ID.protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) protected voidprotected voidprotected voidprotected voidvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetMapView(MapView view) Sets map view.voidsetProjection(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, requestUpdateMapMethods 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, 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
-
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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
autowireDependencies
protected void autowireDependencies() -
addLayer
Adds layer to the map. -
getLayerOrNull
Returns a layer by its ID ornullif the map does not contain a layer with the provided ID.- Overrides:
getLayerOrNullin classJmixMap- Type Parameters:
L- layer type- Parameters:
layerId- ID of a layer- Returns:
- layer
-
getMapView
- Overrides:
getMapViewin 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:
setMapViewin 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, theMapClickEventwill 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:
getAdditionalPropertiesToUpdatein classJmixMap
-
createSerializer
- Overrides:
createSerializerin classJmixMap
-
createMapOptions
- Overrides:
createMapOptionsin classJmixMap
-
onFeatureClickEvent
- Overrides:
onFeatureClickEventin classJmixMap
-
fireFeatureClickEvent
protected void fireFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature) - Overrides:
fireFeatureClickEventin classJmixMap
-
fireSourceFeatureClickEvent
protected void fireSourceFeatureClickEvent(EventBus eventBus, AbstractFeatureClickDomEvent event, Feature feature, AbstractFeatureSource source) - Overrides:
fireSourceFeatureClickEventin classJmixMap
-
onMapClickDomEvent
- Overrides:
onMapClickDomEventin classJmixMap
-
fireMapClickEvent
-
onMapSingleClickDomEvent
- Overrides:
onMapSingleClickDomEventin classJmixMap
-
fireMapSingleClickDomEvent
-
onMapDoubleClickDomEvent
- Overrides:
onMapDoubleClickDomEventin classJmixMap
-
fireMapDoubleClickDomEvent
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetachin classcom.vaadin.flow.component.Component
-