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.HasVectorSourceOptionsNested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
Source.HasAttributions, Source.HasAttributionsCollapsible, Source.HasProjection, Source.HasSourceOptions, Source.HasWrapXNested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
MapObservableObject.ObjectChangeEventNested 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
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected HeatmapDataVectorSourceBinding<E>Fields inherited from class io.jmix.mapsflowui.component.model.source.AbstractDataVectorSource
itemsFields inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractVectorSource
overlaps, useSpatialIndexFields inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
attributions, attributionsCollapsible, id, projection, wrapXFields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
children, dirty, eventBus, listener, metaProperties, parent, removedChildren, syncId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationAdds geo-object click listener.com.vaadin.flow.shared.RegistrationaddGeoObjectDoubleClickListener(Consumer<GeoObjectClickNotifier.GeoObjectDoubleClickEvent<E>> listener) Adds geo-object double click listener.com.vaadin.flow.shared.RegistrationaddGeoObjectSingleClickListener(Consumer<GeoObjectClickNotifier.GeoObjectSingleClickEvent<E>> listener) Adds geo-object single click listener.protected voidvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetWeightProvider(Function<E, Double> weightProvider) Sets weight (intensity) provider.protected voidwithAttributions(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, setWrapXMethods inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractVectorSource
getOverlaps, getUseSpatialIndex, setOverlaps, setUseSpatialIndexMethods inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
getAttributionsCollapsible, getId, getProjection, setAttributionsCollapsible, setId, setProjectionMethods 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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getWeightProvider
- Returns:
- weight (intensity) provider or
nullif 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:GeoObjectClickNotifierAdds geo-object click listener. Note, if the user makes double click, theGeoObjectClickNotifier.GeoObjectClickEventwill be fired twice.- Specified by:
addGeoObjectClickListenerin 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:GeoObjectClickNotifierAdds geo-object single click listener. Single click means that an event won't be fired if the user makes double click.- Specified by:
addGeoObjectSingleClickListenerin 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:GeoObjectClickNotifierAdds geo-object double click listener.- Specified by:
addGeoObjectDoubleClickListenerin 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:
unbindItemsin classAbstractDataVectorSource<E>
-
bindItems
protected void bindItems()- Specified by:
bindItemsin classAbstractDataVectorSource<E>
-