Class PointFeature
java.lang.Object
io.jmix.mapsflowui.kit.component.model.MapObservableObject
io.jmix.mapsflowui.kit.component.model.feature.Feature
io.jmix.mapsflowui.component.model.feature.PointFeature
- All Implemented Interfaces:
FeatureClickNotifier<PointFeature>
,Serializable
Point feature with predefined
PointGeometry
. It is displayed as a point with default style.
Usage example:
protected void addPoint(VectorSource source) { Point point = GeometryUtils.createPoint(13.046446, 47.797916); source.addFeature(new PointFeature(point)); }
- 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.MapObservableObject
children, dirty, eventBus, listener, metaProperties, 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<PointFeature>> listener) Adds feature double click listener.com.vaadin.flow.shared.Registration
addSingleClickListener
(Consumer<FeatureClickNotifier.FeatureSingleClickEvent<PointFeature>> listener) Adds feature single click listener.Adds style to the feature.org.locationtech.jts.geom.Point
getPoint()
void
setPoint
(org.locationtech.jts.geom.Point point) Sets point to the feature's geometry.Methods inherited from class io.jmix.mapsflowui.kit.component.model.feature.Feature
getStyles, getType, removeAllStyles, 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, unmarkDirtyInDepth
-
Constructor Details
-
PointFeature
public PointFeature(org.locationtech.jts.geom.Point point)
-
-
Method Details
-
getGeometry
- Overrides:
getGeometry
in classFeature
- Returns:
- feature's geometry
-
getPoint
public org.locationtech.jts.geom.Point getPoint()- Returns:
- point from feature's geometry
getGeometry()
-
setPoint
public void setPoint(org.locationtech.jts.geom.Point point) Sets point to the feature's geometry.- Parameters:
point
- point 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 PointFeature(GeometryUtils.createPoint(0, 0)) .addStyles(new Style() .withImage(new CircleStyle() .withRadius(7) .withFill(new Fill("#E7003E")) .withStroke(new Stroke() .withWidth(2.0) .withColor("#710067"))));
-
addClickListener
public com.vaadin.flow.shared.Registration addClickListener(Consumer<FeatureClickNotifier.FeatureClickEvent<PointFeature>> listener) 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<PointFeature>
- 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<PointFeature>> listener) 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<PointFeature>
- 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<PointFeature>> listener) Adds feature double click listener.- Specified by:
addDoubleClickListener
in interfaceFeatureClickNotifier<PointFeature>
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-