public class HeatMapLayer
extends java.lang.Object
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.
| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
| Constructor and Description |
|---|
HeatMapLayer(java.lang.String id) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
fireLayerChangedEvent(LayerChangedEvent event) |
io.jmix.ui.model.CollectionContainer<?> |
getDataContainer()
Returns a data container which is used to obtain the heatmap points.
|
java.util.function.Function<HeatMapLayer,java.util.Map<org.locationtech.jts.geom.Point,java.lang.Double>> |
getDataDelegate()
Returns a function which will be used to load a map of points and their intensity values.
|
java.lang.String |
getId() |
java.lang.String |
getIntensityProperty()
Returns a property which value defines the intensity of the point on a heatmap.
|
int |
getMaxZoom()
Returns maximum layer zoom level.
|
int |
getMinZoom()
Returns minimum layer zoom level.
|
HeatMapOptions |
getOptions()
Returns heatmap options.
|
boolean |
isEditable()
Whether the layer is to be editable on a map.
|
boolean |
isVisible()
Whether the layer is to be visible on a map.
|
void |
refresh()
Notify clients that the layer has changed and need to be redrawn.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setDataContainer(io.jmix.ui.model.CollectionContainer<?> dataContainer)
Sets a data container which will be used to obtain the heatmap points.
|
void |
setDataDelegate(java.util.function.Function<HeatMapLayer,java.util.Map<org.locationtech.jts.geom.Point,java.lang.Double>> dataDelegate)
Sets a function which will be used to load a map of points and their intensity values.
|
void |
setEditable(boolean editable)
Sets whether the layer is to be editable on a map.
|
void |
setIntensityProperty(java.lang.String intensityProperty)
Sets a property which value defines the intensity of the point on a heatmap.
|
void |
setMaxZoom(int maxZoom)
Sets maximum zoom level up to which the layer is visible (inclusive).
|
void |
setMinZoom(int minZoom)
Sets minimum zoom level down to which the layer is visible (inclusive).
|
void |
setOptions(HeatMapOptions options)
Sets custom heatmap options.
|
void |
setVisible(boolean visible)
Sets whether the layer should be visible on a map.
|
java.lang.String |
toString() |
protected org.springframework.context.ApplicationContext applicationContext
public HeatMapOptions getOptions()
public void setOptions(HeatMapOptions options)
public java.util.function.Function<HeatMapLayer,java.util.Map<org.locationtech.jts.geom.Point,java.lang.Double>> getDataDelegate()
public void setDataDelegate(java.util.function.Function<HeatMapLayer,java.util.Map<org.locationtech.jts.geom.Point,java.lang.Double>> dataDelegate)
If this function is specified along with dataContainer,
the dataContainer will be ignored
and this function will be used to obtain the heatmap data.
public io.jmix.ui.model.CollectionContainer<?> getDataContainer()
@StudioProperty(type=COLLECTION_DATACONTAINER_REF) public void setDataContainer(io.jmix.ui.model.CollectionContainer<?> dataContainer)
The items of the data container should be geo-objects having a Geometry property of Point type.
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 in setIntensityProperty(String).
If the intensity value should be calculated another way, consider using setDataDelegate(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.
public java.lang.String getIntensityProperty()
@StudioProperty(type=STRING) public void setIntensityProperty(java.lang.String intensityProperty)
Used in combination with setDataContainer(io.jmix.ui.model.CollectionContainer<?>) to mark the property
of the data container's entity meta-class.
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void setMaxZoom(int maxZoom)
LayersetMaxZoom in interface LayermaxZoom - maximum layer zoom levelpublic int getMaxZoom()
LayergetMaxZoom in interface Layerpublic void setMinZoom(int minZoom)
LayerDefault value: 0.
setMinZoom in interface LayerminZoom - minimum layer zoom levelpublic int getMinZoom()
LayergetMinZoom in interface Layerpublic void setVisible(boolean visible)
Layer
Default value: true.
setVisible in interface Layervisible - true/falsepublic boolean isVisible()
Layerpublic void setEditable(boolean editable)
Layer
Default value: false.
setEditable in interface Layereditable - true/falsepublic boolean isEditable()
LayerisEditable in interface Layertrue if the layer is set to be editable;
otherwise falseprotected void fireLayerChangedEvent(LayerChangedEvent event)
public void refresh()
Layerpublic java.lang.String toString()
toString in class java.lang.Object