Class VectorLayerHolder<T>
java.lang.Object
io.jmix.mapsui.component.leaflet.translators.VectorLayerHolder<T>
- All Implemented Interfaces:
HasContextMenu
,LeafletLayerHolder<LFeatureGroup>
,LeafletMapAware
,Refreshable
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class VectorLayerHolder<T>
extends Object
implements LeafletLayerHolder<LFeatureGroup>, LeafletMapAware, org.springframework.context.ApplicationContextAware, Refreshable, HasContextMenu
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
When a layer corresponding to the holder is selected, this method is invoked in order to switch the holder into an active mode, which basically means enable listeners and turn on a drawing mode if needed.protected void
protected GeoObjectWrapper<T>
addGeoObject
(T entity) protected void
applyWeightForPoint
(GeoObjectWrapper<?> wrapper) Applies weight value for a point (if the weight property is specified in the clustering options).void
This method is invoked when the layer corresponding to the holder is no more active and it signals the holder to switch off listeners and a drawing mode.protected void
ensureItemSelection
(T entity) Invoke when geo-object's wrapper is changed.protected static Object
geoObjectKey
(Object entity) Returns a key for the given geo-object to be used ingeoObjectsMap
.Gets theLeafletLayer
protected void
protected void
protected boolean
protected void
protected void
mergeGeoObject
(T entity) Invoked in case of replacing an existing entity with a new instance.protected void
protected void
onGeoObjectClick
(T clickedGeoObject) void
refresh()
void
refreshParameters
(Collection<String> changedParameters) protected void
removeGeoObject
(T entity) protected void
removeGeoObjectByKey
(Object geoObjectKey) protected void
removeWrapper
(GeoObjectWrapper<?> wrapper) void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setContextMenuProcessor
(ContextMenuProcessor contextMenuProcessor) void
setEditableMap
(LEditableMap lEditableMap) void
setLeafletMap
(LMap leafletMap) void
setMessages
(Messages messages) void
shutdown()
Signals that the holder is no more needed (for example when it is replaced with another holder instance).
-
Method Details
-
itemsSetChanged
-
initLeafletLayer
protected void initLeafletLayer() -
initGeometryChangedSubscription
protected void initGeometryChangedSubscription() -
addGeoObject
-
removeGeoObject
-
removeGeoObjectByKey
-
removeWrapper
-
mergeGeoObject
Invoked in case of replacing an existing entity with a new instance.Assumes that the previous item belongs to the layer.
-
geoObjectKey
Returns a key for the given geo-object to be used ingeoObjectsMap
. Returns entity id whenever possible, otherwise returns entity. -
applyWeightForPoint
Applies weight value for a point (if the weight property is specified in the clustering options).- Parameters:
wrapper
- point wrapper
-
ensureItemSelection
Invoke when geo-object's wrapper is changed.Ensures the editable mode for the selected geo-object's wrapper.
-
isEditable
protected boolean isEditable() -
onGeoObjectClick
-
addContextMenuHandlers
protected void addContextMenuHandlers() -
createContextMenuInvocationContext
-
setContextMenuProcessor
- Specified by:
setContextMenuProcessor
in interfaceHasContextMenu
-
setLeafletMap
- Specified by:
setLeafletMap
in interfaceLeafletMapAware
-
setEditableMap
- Specified by:
setEditableMap
in interfaceLeafletMapAware
-
getLeafletLayer
Description copied from interface:LeafletLayerHolder
Gets theLeafletLayer
- Specified by:
getLeafletLayer
in interfaceLeafletLayerHolder<T>
- Returns:
- Leaflet layer component
-
getVectorLayer
-
activate
public void activate()Description copied from interface:LeafletLayerHolder
When a layer corresponding to the holder is selected, this method is invoked in order to switch the holder into an active mode, which basically means enable listeners and turn on a drawing mode if needed.- Specified by:
activate
in interfaceLeafletLayerHolder<T>
-
deactivate
public void deactivate()Description copied from interface:LeafletLayerHolder
This method is invoked when the layer corresponding to the holder is no more active and it signals the holder to switch off listeners and a drawing mode.- Specified by:
deactivate
in interfaceLeafletLayerHolder<T>
-
shutdown
public void shutdown()Description copied from interface:LeafletLayerHolder
Signals that the holder is no more needed (for example when it is replaced with another holder instance).- Specified by:
shutdown
in interfaceLeafletLayerHolder<T>
-
refresh
public void refresh()- Specified by:
refresh
in interfaceRefreshable
-
refreshParameters
- Specified by:
refreshParameters
in interfaceRefreshable
-
notifyConnector
protected void notifyConnector() -
getGeoObjectWrappersMap
-
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
-
setMessages
-