Class MarkerFeature
- All Implemented Interfaces:
- FeatureClickNotifier<MarkerFeature>,- Serializable
PointGeometry. It is displayed with marker icon in a map component.
 Usage example:
 protected void addMarker(VectorSource source) {
     Point point = GeometryUtils.createPoint(-0.12081, 51.51592);
     source.addFeature(new MarkerFeature(point));
 }
 - See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObjectMapObservableObject.ObjectChangeEventNested classes/interfaces inherited from interface io.jmix.mapsflowui.component.model.feature.FeatureClickNotifierFeatureClickNotifier.AbstractFeatureClickEvent<F>, FeatureClickNotifier.FeatureClickEvent<F extends Feature>, FeatureClickNotifier.FeatureDoubleClickEvent<F extends Feature>, FeatureClickNotifier.FeatureSingleClickEvent<F extends Feature>
- 
Field SummaryFields inherited from class io.jmix.mapsflowui.kit.component.model.feature.Featuregeometry, properties, stylesFields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObjectchildren, dirty, eventBus, listener, metaProperties, parent, removedChildren, syncId
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationAdds feature click listener.com.vaadin.flow.shared.RegistrationaddDoubleClickListener(Consumer<FeatureClickNotifier.FeatureDoubleClickEvent<MarkerFeature>> listener) Adds feature double click listener.com.vaadin.flow.shared.RegistrationaddSingleClickListener(Consumer<FeatureClickNotifier.FeatureSingleClickEvent<MarkerFeature>> listener) Adds feature single click listener.voidAdds style to the feature.org.locationtech.jts.geom.PointgetPoint()voidsetPoint(org.locationtech.jts.geom.Point point) Sets point 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.FeaturegetProperties, getStyles, getType, removeAllProperties, removeAllStyles, removeProperty, removeStylesMethods inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObjectaddChild, addListener, clearRemovedChildren, clearRemovedChildrenInDepth, equals, fireChangeEvent, getChildren, getEventBus, getMetaProperties, getRemovedChildren, getSyncId, hashCode, isDirty, isDirtyInDepth, markAsDirty, markAsDirtyInDepth, removeChild, setMapObjectChangeListener, setMetaProperty, setParent, unmarkDirtyInDepth
- 
Constructor Details- 
MarkerFeaturepublic MarkerFeature(org.locationtech.jts.geom.Point point) 
 
- 
- 
Method Details- 
getGeometry- Overrides:
- getGeometryin class- Feature
- Returns:
- feature's geometry
 
- 
getPointpublic org.locationtech.jts.geom.Point getPoint()- Returns:
- point from feature's geometry getGeometry()
 
- 
setPointpublic void setPoint(org.locationtech.jts.geom.Point point) Sets point to the feature's geometry.- Parameters:
- point- point to set
 
- 
addStylesAdds 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.MarkerFeatureby default contains icon style. If you want to change icon, at first remove default style usingFeature.removeAllStyles()and then add new one.If it is need to apply additional style, just add a new one. For instance: new MarkerFeature(GeometryUtils.createPoint(13.511928527176917, 52.36486800974413)) .withStyles(new MarkerStyle() .withText(new TextStyle() .withText("Departure") .withOffsetY(10)) .build());
- 
withStylesSeeaddStyles(Style...).- Overrides:
- withStylesin class- Feature
- Parameters:
- styles- styles to add
- Returns:
- current instance
 
- 
withPropertiesDescription copied from class:FeatureSets 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:
- withPropertiesin class- Feature
- Parameters:
- properties- properties to set
- Returns:
- current instance
 
- 
withPropertyDescription copied from class:FeatureSets 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:
- withPropertyin class- Feature
- Parameters:
- name- property name
- value- value
- Returns:
- current instance
 
- 
addClickListenerpublic com.vaadin.flow.shared.Registration addClickListener(Consumer<FeatureClickNotifier.FeatureClickEvent<MarkerFeature>> listener) Description copied from interface:FeatureClickNotifierAdds feature click listener. Note, if the user makes double click on a feature, theFeatureClickNotifier.FeatureClickEventwill be fired twice.- Specified by:
- addClickListenerin interface- FeatureClickNotifier<MarkerFeature>
- Parameters:
- listener- listener to add
- Returns:
- a registration object for removing an event listener
 
- 
addSingleClickListenerpublic com.vaadin.flow.shared.Registration addSingleClickListener(Consumer<FeatureClickNotifier.FeatureSingleClickEvent<MarkerFeature>> listener) Description copied from interface:FeatureClickNotifierAdds feature single click listener. Single click means that an event won't be fired if the user makes double click.- Specified by:
- addSingleClickListenerin interface- FeatureClickNotifier<MarkerFeature>
- Parameters:
- listener- listener to add
- Returns:
- a registration object for removing an event listener
 
- 
addDoubleClickListenerpublic com.vaadin.flow.shared.Registration addDoubleClickListener(Consumer<FeatureClickNotifier.FeatureDoubleClickEvent<MarkerFeature>> listener) Description copied from interface:FeatureClickNotifierAdds feature double click listener.- Specified by:
- addDoubleClickListenerin interface- FeatureClickNotifier<MarkerFeature>
- Parameters:
- listener- listener to add
- Returns:
- a registration object for removing an event listener
 
 
-