Class HeatmapDataVectorSource<E>
java.lang.Object
io.jmix.mapsflowui.kit.component.model.MapObservableObject
io.jmix.mapsflowui.kit.component.model.source.Source
io.jmix.mapsflowui.kit.component.model.source.AbstractVectorSource
io.jmix.mapsflowui.component.model.source.AbstractDataVectorSource<E>
io.jmix.mapsflowui.component.model.source.HeatmapDataVectorSource<E>
- Type Parameters:
E
- item type
- All Implemented Interfaces:
GeoObjectClickNotifier<E>
,Source.HasAttributions
,Source.HasWrapX
,Serializable
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class HeatmapDataVectorSource<E>
extends AbstractDataVectorSource<E>
implements org.springframework.context.ApplicationContextAware, GeoObjectClickNotifier<E>
A source containing geo-objects (entities having a property of a
Geometry
type) for HeatmapLayer
.
This source acts as a connector between the data (geo-objects provided by
DataVectorSourceItems
interface implementation) and the map UI component.
It carries the data along with some additional information on how
the geo-objects should be displayed on a map.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractVectorSource
AbstractVectorSource.HasOverlaps, AbstractVectorSource.HasUseSpatialIndex, AbstractVectorSource.HasVectorSourceOptions
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
Source.HasAttributions, Source.HasAttributionsCollapsible, Source.HasProjection, Source.HasSourceOptions, Source.HasWrapX
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
MapObservableObject.ObjectChangeEvent
Nested classes/interfaces inherited from interface io.jmix.mapsflowui.component.model.source.GeoObjectClickNotifier
GeoObjectClickNotifier.AbstractGeoObjectClickEvent<E>, GeoObjectClickNotifier.GeoObjectClickEvent<E>, GeoObjectClickNotifier.GeoObjectDoubleClickEvent<E>, GeoObjectClickNotifier.GeoObjectSingleClickEvent<E>
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
protected HeatmapDataVectorSourceBinding<E>
Fields inherited from class io.jmix.mapsflowui.component.model.source.AbstractDataVectorSource
items
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractVectorSource
overlaps, useSpatialIndex
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
attributions, attributionsCollapsible, id, projection, wrapX
Fields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
children, dirty, eventBus, listener, metaProperties, parent, removedChildren, syncId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
Adds geo-object click listener.com.vaadin.flow.shared.Registration
addGeoObjectDoubleClickListener
(Consumer<GeoObjectClickNotifier.GeoObjectDoubleClickEvent<E>> listener) Adds geo-object double click listener.com.vaadin.flow.shared.Registration
addGeoObjectSingleClickListener
(Consumer<GeoObjectClickNotifier.GeoObjectSingleClickEvent<E>> listener) Adds geo-object single click listener.protected void
void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setWeightProvider
(Function<E, Double> weightProvider) Sets weight (intensity) provider.protected void
withAttributions
(List<String> attributions) withItems
(DataVectorSourceItems<E> items) withWeightProvider
(Function<E, Double> weightProvider) Methods inherited from class io.jmix.mapsflowui.component.model.source.AbstractDataVectorSource
getAttributions, getItems, getType, getWrapX, setAttributions, setItems, setWrapX
Methods inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractVectorSource
getOverlaps, getUseSpatialIndex, setOverlaps, setUseSpatialIndex
Methods inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
getAttributionsCollapsible, getId, getProjection, setAttributionsCollapsible, setId, setProjection
Methods inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
addChild, addListener, clearRemovedChildren, clearRemovedChildrenInDepth, equals, fireChangeEvent, getChildren, getEventBus, getMetaProperties, getRemovedChildren, getSyncId, hashCode, isDirty, isDirtyInDepth, markAsDirty, markAsDirtyInDepth, removeChild, setMapObjectChangeListener, setMetaProperty, setParent, unmarkDirtyInDepth
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
binder
-
weightProvider
-
-
Constructor Details
-
HeatmapDataVectorSource
public HeatmapDataVectorSource()
-
-
Method Details
-
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
-
getWeightProvider
- Returns:
- weight (intensity) provider or
null
if not set
-
setWeightProvider
Sets weight (intensity) provider. It has precedence over theHeatmapLayer.setWeightProperty(String)
. The provider is called for each item and should return calculated weight value. For instance:source.setWeightProvider(office -> { int employeesNumber = office.getEmployeesNumber(); if (employeesNumber > 50) { return 0.7; } return 0.3; });
- Parameters:
weightProvider
- provider to set
-
addGeoObjectClickListener
public com.vaadin.flow.shared.Registration addGeoObjectClickListener(Consumer<GeoObjectClickNotifier.GeoObjectClickEvent<E>> listener) Description copied from interface:GeoObjectClickNotifier
Adds geo-object click listener. Note, if the user makes double click, theGeoObjectClickNotifier.GeoObjectClickEvent
will be fired twice.- Specified by:
addGeoObjectClickListener
in interfaceGeoObjectClickNotifier<E>
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addGeoObjectSingleClickListener
public com.vaadin.flow.shared.Registration addGeoObjectSingleClickListener(Consumer<GeoObjectClickNotifier.GeoObjectSingleClickEvent<E>> listener) Description copied from interface:GeoObjectClickNotifier
Adds geo-object single click listener. Single click means that an event won't be fired if the user makes double click.- Specified by:
addGeoObjectSingleClickListener
in interfaceGeoObjectClickNotifier<E>
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addGeoObjectDoubleClickListener
public com.vaadin.flow.shared.Registration addGeoObjectDoubleClickListener(Consumer<GeoObjectClickNotifier.GeoObjectDoubleClickEvent<E>> listener) Description copied from interface:GeoObjectClickNotifier
Adds geo-object double click listener.- Specified by:
addGeoObjectDoubleClickListener
in interfaceGeoObjectClickNotifier<E>
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
withWeightProvider
- Parameters:
weightProvider
- provider to set- Returns:
- current instance
-
withAttributions
- Parameters:
attributions
- info about copyrights and licences- Returns:
- current instance
-
withWrapX
- Parameters:
wrapX
- whether the source should be looped along the X coordinate- Returns:
- current instance
-
withItems
- Parameters:
items
- items to set- Returns:
- current instance
-
unbindItems
protected void unbindItems()- Specified by:
unbindItems
in classAbstractDataVectorSource<E>
-
bindItems
protected void bindItems()- Specified by:
bindItems
in classAbstractDataVectorSource<E>
-