Class HeatMapLayer
- All Implemented Interfaces:
Layer,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
The layer's data can be provided either by data container or by providing data delegate which builds a map of points and their intensity values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidReturns a data container which is used to obtain the heatmap points.Function<HeatMapLayer,Map<org.locationtech.jts.geom.Point, Double>> Returns a function which will be used to load a map of points and their intensity values.getId()Returns a property which value defines the intensity of the point on a heatmap.intReturns maximum layer zoom level.intReturns minimum layer zoom level.Returns heatmap options.booleanWhether the layer is to be editable on a map.booleanWhether the layer is to be visible on a map.voidrefresh()Notify clients that the layer has changed and need to be redrawn.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetDataContainer(CollectionContainer<?> dataContainer) Sets a data container which will be used to obtain the heatmap points.voidsetDataDelegate(Function<HeatMapLayer, Map<org.locationtech.jts.geom.Point, Double>> dataDelegate) Sets a function which will be used to load a map of points and their intensity values.voidsetEditable(boolean editable) Sets whether the layer is to be editable on a map.voidsetIntensityProperty(String intensityProperty) Sets a property which value defines the intensity of the point on a heatmap.voidsetMaxZoom(int maxZoom) Sets maximum zoom level up to which the layer is visible (inclusive).voidsetMinZoom(int minZoom) Sets minimum zoom level down to which the layer is visible (inclusive).voidsetOptions(HeatMapOptions options) Sets custom heatmap options.voidsetVisible(boolean visible) Sets whether the layer should be visible on a map.toString()
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
HeatMapLayer
-
-
Method Details
-
getOptions
Returns heatmap options. -
setOptions
Sets custom heatmap options. -
getDataDelegate
Returns a function which will be used to load a map of points and their intensity values. -
setDataDelegate
public void setDataDelegate(Function<HeatMapLayer, Map<org.locationtech.jts.geom.Point, Double>> dataDelegate) Sets a function which will be used to load a map of points and their intensity values.If this function is specified along with
dataContainer, thedataContainerwill be ignored and this function will be used to obtain the heatmap data. -
getDataContainer
Returns a data container which is used to obtain the heatmap points. -
setDataContainer
@StudioProperty(type=COLLECTION_DATACONTAINER_REF) public void setDataContainer(CollectionContainer<?> dataContainer) Sets a data container which will be used to obtain the heatmap points.The items of the data container should be geo-objects having a
Geometryproperty ofPointtype. The intensity value of each point equals 1 by default. If the intensity value should be taken from some other property (for example, 'amount'), this property can be specified insetIntensityProperty(String). If the intensity value should be calculated another way, consider usingsetDataDelegate(java.util.function.Function<io.jmix.mapsui.component.layer.HeatMapLayer, java.util.Map<org.locationtech.jts.geom.Point, java.lang.Double>>)instead of this method, to build your own map of points and their intensity values.The layer does not react to changes in the data container, so if you need to update the layer, invoke
Layer.refresh()method. -
getIntensityProperty
Returns a property which value defines the intensity of the point on a heatmap. -
setIntensityProperty
Sets a property which value defines the intensity of the point on a heatmap.Used in combination with
setDataContainer(io.jmix.ui.model.CollectionContainer<?>)to mark the property of the data container's entity meta-class. -
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
-
setMaxZoom
public void setMaxZoom(int maxZoom) Description copied from interface:LayerSets maximum zoom level up to which the layer is visible (inclusive).- Specified by:
setMaxZoomin interfaceLayer- Parameters:
maxZoom- maximum layer zoom level
-
getMaxZoom
public int getMaxZoom()Description copied from interface:LayerReturns maximum layer zoom level.- Specified by:
getMaxZoomin interfaceLayer- Returns:
- maximum layer zoom level
-
setMinZoom
public void setMinZoom(int minZoom) Description copied from interface:LayerSets minimum zoom level down to which the layer is visible (inclusive).Default value: 0.
- Specified by:
setMinZoomin interfaceLayer- Parameters:
minZoom- minimum layer zoom level
-
getMinZoom
public int getMinZoom()Description copied from interface:LayerReturns minimum layer zoom level.- Specified by:
getMinZoomin interfaceLayer- Returns:
- minimum layer zoom level
-
getId
-
setVisible
public void setVisible(boolean visible) Description copied from interface:LayerSets whether the layer should be visible on a map.Default value:
true.- Specified by:
setVisiblein interfaceLayer- Parameters:
visible- true/false
-
isVisible
public boolean isVisible()Description copied from interface:LayerWhether the layer is to be visible on a map. -
setEditable
public void setEditable(boolean editable) Description copied from interface:LayerSets whether the layer is to be editable on a map.Default value:
false.- Specified by:
setEditablein interfaceLayer- Parameters:
editable- true/false
-
isEditable
public boolean isEditable()Description copied from interface:LayerWhether the layer is to be editable on a map.- Specified by:
isEditablein interfaceLayer- Returns:
trueif the layer is set to be editable; otherwisefalse
-
fireLayerChangedEvent
-
refresh
public void refresh()Description copied from interface:LayerNotify clients that the layer has changed and need to be redrawn. -
toString
-