Class MultiPointFeature
java.lang.Object
io.jmix.mapsflowui.kit.component.model.MapObservableObject
io.jmix.mapsflowui.kit.component.model.feature.Feature
io.jmix.mapsflowui.component.model.feature.MultiPointFeature
- All Implemented Interfaces:
FeatureClickNotifier<MultiPointFeature>
,Serializable
Multipoint feature with predefined
MultiPointGeometry
. It is displayed as points with default style.
Usage example:
private void addMultiPoint(VectorSource vectorSource) { GeometryFactory factory = GeometryUtils.getGeometryFactory(); MultiPoint multiPoint = factory.createMultiPoint(new Point[]{ GeometryUtils.createPoint(2.348582286131592, 48.84306719072006), GeometryUtils.createPoint(-0.1503049900024013, 51.54906255948154)}); vectorSource.addFeature(new MultiPointFeature(multiPoint)); }
- See Also:
-
Nested Class Summary
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.feature.FeatureClickNotifier
FeatureClickNotifier.AbstractFeatureClickEvent<F>, FeatureClickNotifier.FeatureClickEvent<F extends Feature>, FeatureClickNotifier.FeatureDoubleClickEvent<F extends Feature>, FeatureClickNotifier.FeatureSingleClickEvent<F extends Feature>
-
Field Summary
Fields inherited from class io.jmix.mapsflowui.kit.component.model.feature.Feature
geometry, properties, styles
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 feature click listener.com.vaadin.flow.shared.Registration
addDoubleClickListener
(Consumer<FeatureClickNotifier.FeatureDoubleClickEvent<MultiPointFeature>> listener) Adds feature double click listener.com.vaadin.flow.shared.Registration
addSingleClickListener
(Consumer<FeatureClickNotifier.FeatureSingleClickEvent<MultiPointFeature>> listener) Adds feature single click listener.void
Adds style to the feature.org.locationtech.jts.geom.MultiPoint
void
setMultiPoint
(org.locationtech.jts.geom.MultiPoint multiPoint) Sets multipoint to the feature's geometry.withProperties
(Map<String, Object> properties) Sets the properties that will be associated with the feature.withProperty
(String name, Object value) Sets the property that will be associated with the feature.withStyles
(Style... styles) SeeaddStyles(Style...)
.Methods inherited from class io.jmix.mapsflowui.kit.component.model.feature.Feature
getProperties, getStyles, getType, removeAllProperties, removeAllStyles, removeProperty, removeStyles
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
-
Constructor Details
-
MultiPointFeature
public MultiPointFeature(org.locationtech.jts.geom.MultiPoint multiPoint)
-
-
Method Details
-
getGeometry
- Overrides:
getGeometry
in classFeature
- Returns:
- feature's geometry
-
getMultiPoint
public org.locationtech.jts.geom.MultiPoint getMultiPoint()- Returns:
- multipoint from feature's geometry
getGeometry()
-
setMultiPoint
public void setMultiPoint(org.locationtech.jts.geom.MultiPoint multiPoint) Sets multipoint to the feature's geometry.- Parameters:
multiPoint
- multipoint to set
-
addStyles
Adds style to the feature. Note, if the feature contains custom styles, the default styles or added ones to the layer won't be applied to this feature. And you have to provide fully described style to the specific feature. For instance, custom point styles:new MultiPointFeature(multiPoint) .withStyles(new PointStyle() .withImage(new CircleStyle() .withRadius(7) .withFill(new Fill("#E7003E")) .withStroke(new Stroke() .withWidth(2.0) .withColor("#710067"))) .build());
-
withStyles
SeeaddStyles(Style...)
.- Overrides:
withStyles
in classFeature
- Parameters:
styles
- styles to add- Returns:
- current instance
-
withProperties
Description copied from class:Feature
Sets the properties that will be associated with the feature.For instance, if cluster specified weight property it will try to get it from the feature's properties. The same with heatmap when it is specified its weight property.
Another example of using feature's properties is listening click events in source. For instance:
vectorSource.addSourceFeatureClickListener(event -> { Feature feature = event.getFeature(); String description = (String) feature.getProperties().get("description"); notifications.show(description); });
- Overrides:
withProperties
in classFeature
- Parameters:
properties
- properties to set- Returns:
- current instance
-
withProperty
Description copied from class:Feature
Sets the property that will be associated with the feature.For instance, if cluster specified weight property it will try to get it from the feature's properties. The same with heatmap when it is specified its weight property.
Another example of using feature's properties is listening click events in source. For instance:
vectorSource.addSourceFeatureClickListener(event -> { Feature feature = event.getFeature(); String description = (String) feature.getProperties().get("description"); notifications.show(description); });
- Overrides:
withProperty
in classFeature
- Parameters:
name
- property namevalue
- value- Returns:
- current instance
-
addClickListener
public com.vaadin.flow.shared.Registration addClickListener(Consumer<FeatureClickNotifier.FeatureClickEvent<MultiPointFeature>> listener) Description copied from interface:FeatureClickNotifier
Adds feature click listener. Note, if the user makes double click on a feature, theFeatureClickNotifier.FeatureClickEvent
will be fired twice.- Specified by:
addClickListener
in interfaceFeatureClickNotifier<MultiPointFeature>
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addSingleClickListener
public com.vaadin.flow.shared.Registration addSingleClickListener(Consumer<FeatureClickNotifier.FeatureSingleClickEvent<MultiPointFeature>> listener) Description copied from interface:FeatureClickNotifier
Adds feature single click listener. Single click means that an event won't be fired if the user makes double click.- Specified by:
addSingleClickListener
in interfaceFeatureClickNotifier<MultiPointFeature>
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addDoubleClickListener
public com.vaadin.flow.shared.Registration addDoubleClickListener(Consumer<FeatureClickNotifier.FeatureDoubleClickEvent<MultiPointFeature>> listener) Description copied from interface:FeatureClickNotifier
Adds feature double click listener.- Specified by:
addDoubleClickListener
in interfaceFeatureClickNotifier<MultiPointFeature>
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-