Class VectorLayerHolder<T>
java.lang.Object
io.jmix.mapsui.component.leaflet.translators.VectorLayerHolder<T>
- All Implemented Interfaces:
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
-
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()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 GeoObjectWrapper<T>addGeoObject(T entity) protected voidapplyWeightForPoint(GeoObjectWrapper<?> wrapper) Applies weight value for a point (if the weight property is specified in the clustering options).voidThis 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 voidensureItemSelection(T entity) Invoke when geo-object's wrapper is changed.protected static ObjectgeoObjectKey(Object entity) Returns a key for the given geo-object to be used ingeoObjectsMap.Gets theLeafletLayerprotected voidprotected voidprotected booleanprotected voidprotected voidmergeGeoObject(T entity) Invoked in case of replacing an existing entity with a new instance.protected voidprotected voidonGeoObjectClick(T clickedGeoObject) voidrefresh()voidrefreshParameters(Collection<String> changedParameters) protected voidremoveGeoObject(T entity) protected voidremoveGeoObjectByKey(Object geoObjectKey) protected voidremoveWrapper(GeoObjectWrapper<?> wrapper) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetEditableMap(LEditableMap lEditableMap) voidsetLeafletMap(LMap leafletMap) voidshutdown()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
-
setLeafletMap
- Specified by:
setLeafletMapin interfaceLeafletMapAware
-
setEditableMap
- Specified by:
setEditableMapin interfaceLeafletMapAware
-
getLeafletLayer
Description copied from interface:LeafletLayerHolderGets theLeafletLayer- Specified by:
getLeafletLayerin interfaceLeafletLayerHolder<T>- Returns:
- Leaflet layer component
-
getVectorLayer
-
activate
public void activate()Description copied from interface:LeafletLayerHolderWhen 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:
activatein interfaceLeafletLayerHolder<T>
-
deactivate
public void deactivate()Description copied from interface:LeafletLayerHolderThis 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:
deactivatein interfaceLeafletLayerHolder<T>
-
shutdown
public void shutdown()Description copied from interface:LeafletLayerHolderSignals that the holder is no more needed (for example when it is replaced with another holder instance).- Specified by:
shutdownin interfaceLeafletLayerHolder<T>
-
refresh
public void refresh()- Specified by:
refreshin interfaceRefreshable
-
refreshParameters
- Specified by:
refreshParametersin interfaceRefreshable
-
notifyConnector
protected void notifyConnector() -
getGeoObjectWrappersMap
-
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
-