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
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Returns 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.int
Returns maximum layer zoom level.int
Returns minimum layer zoom level.Returns heatmap options.boolean
Whether the layer is to be editable on a map.boolean
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
(CollectionContainer<?> dataContainer) Sets a data container which will be used to obtain the heatmap points.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.void
setEditable
(boolean editable) Sets whether the layer is to be editable on a map.void
setIntensityProperty
(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.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
, thedataContainer
will 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
Geometry
property ofPoint
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 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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
setMaxZoom
public void setMaxZoom(int maxZoom) Description copied from interface:Layer
Sets maximum zoom level up to which the layer is visible (inclusive).- Specified by:
setMaxZoom
in interfaceLayer
- Parameters:
maxZoom
- maximum layer zoom level
-
getMaxZoom
public int getMaxZoom()Description copied from interface:Layer
Returns maximum layer zoom level.- Specified by:
getMaxZoom
in interfaceLayer
- Returns:
- maximum layer zoom level
-
setMinZoom
public void setMinZoom(int minZoom) Description copied from interface:Layer
Sets minimum zoom level down to which the layer is visible (inclusive).Default value: 0.
- Specified by:
setMinZoom
in interfaceLayer
- Parameters:
minZoom
- minimum layer zoom level
-
getMinZoom
public int getMinZoom()Description copied from interface:Layer
Returns minimum layer zoom level.- Specified by:
getMinZoom
in interfaceLayer
- Returns:
- minimum layer zoom level
-
getId
-
setVisible
public void setVisible(boolean visible) Description copied from interface:Layer
Sets whether the layer should be visible on a map.Default value:
true
.- Specified by:
setVisible
in interfaceLayer
- Parameters:
visible
- true/false
-
isVisible
public boolean isVisible()Description copied from interface:Layer
Whether the layer is to be visible on a map. -
setEditable
public void setEditable(boolean editable) Description copied from interface:Layer
Sets whether the layer is to be editable on a map.Default value:
false
.- Specified by:
setEditable
in interfaceLayer
- Parameters:
editable
- true/false
-
isEditable
public boolean isEditable()Description copied from interface:Layer
Whether the layer is to be editable on a map.- Specified by:
isEditable
in interfaceLayer
- Returns:
true
if the layer is set to be editable; otherwisefalse
-
fireLayerChangedEvent
-
refresh
public void refresh()Description copied from interface:Layer
Notify clients that the layer has changed and need to be redrawn. -
toString
-