Class Feature
- All Implemented Interfaces:
HasFeatureModifyStyles,HasFeatureSelectStyles,Serializable
- Direct Known Subclasses:
LineStringFeature,MarkerFeature,MultiLineStringFeature,MultiMarkerFeature,MultiPointFeature,MultiPolygonFeature,PointFeature,PolygonFeature
For more details see: Feature docs
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
MapObservableObject.ObjectChangeEvent -
Field Summary
FieldsFields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
children, dirty, eventBus, metaProperties, parent, removedChildren, syncId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllModifyStyles(Collection<Style> styles) voidaddAllSelectStyles(Collection<Style> styles) voidaddModifyStyles(Style... styles) Adds modify styles to a feature.voidaddSelectStyles(Style... styles) Adds select styles to a feature.voidAdds style to the feature.protected StringgetType()voidRemoves all added modify styles from a feature.voidRemoves all properties from the feature.voidRemoves all added select styles from feature.voidRemoves all added styles from feature.voidremoveModifyStyles(Style... styles) Removes modify styles from a feature.voidremoveProperty(String name) Removes property from the feature.voidremoveSelectStyles(Style... styles) Removes styles from feature.voidremoveStyles(Style... styles) Removes styles from feature.protected voidprotected voidwithModifyStyles(Style... styles) 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.withSelectStyles(Style... styles) withStyles(Style... styles) SeeaddStyles(Style...).Methods inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
addChild, addListener, clearRemovedChildren, clearRemovedChildrenInDepth, equals, fireChangeEvent, getChildren, getEventBus, getMetaProperties, getRemovedChildren, getSuperParent, getSyncId, hashCode, isAttachedToMap, isDirty, isDirtyInDepth, markAsDirty, markAsDirtyInDepth, removeChild, setMetaProperty, setParent, unmarkDirtyInDepth
-
Field Details
-
geometry
-
styles
-
selectStyles
-
modifyStyles
-
properties
-
-
Constructor Details
-
Feature
-
-
Method Details
-
getType
- Specified by:
getTypein classMapObservableObject
-
getGeometry
- Returns:
- feature's geometry
-
getStyles
- Returns:
- list of added styles or empty list if no styles added
-
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.- Parameters:
styles- styles to add
-
withStyles
SeeaddStyles(Style...).- Parameters:
styles- styles to add- Returns:
- current instance
-
removeStyles
Removes styles from feature.- Parameters:
styles- styles to remove
-
removeAllStyles
public void removeAllStyles()Removes all added styles from feature. -
getSelectStyles
- Specified by:
getSelectStylesin interfaceHasFeatureSelectStyles- Returns:
- collection of added select styles or empty collection if no styles added
-
addSelectStyles
Description copied from interface:HasFeatureSelectStylesAdds select styles to a feature.The styles will be applied for a feature's geometry when the user selects it.
To enable select mode set
SupportsFeatureSelect.setFeatureSelectEnabled(Boolean)totrue.- Specified by:
addSelectStylesin interfaceHasFeatureSelectStyles- Parameters:
styles- styles to add
-
addAllSelectStyles
- Specified by:
addAllSelectStylesin interfaceHasFeatureSelectStyles- Parameters:
styles- styles to add- See Also:
-
removeSelectStyles
Description copied from interface:HasFeatureSelectStylesRemoves styles from feature.- Specified by:
removeSelectStylesin interfaceHasFeatureSelectStyles- Parameters:
styles- styles to remove
-
removeAllSelectStyles
public void removeAllSelectStyles()Description copied from interface:HasFeatureSelectStylesRemoves all added select styles from feature.- Specified by:
removeAllSelectStylesin interfaceHasFeatureSelectStyles
-
withSelectStyles
- Parameters:
styles- styles to add- Returns:
- current instance
-
getModifyStyles
- Specified by:
getModifyStylesin interfaceHasFeatureModifyStyles- Returns:
- collection of modify styles or empty collection if no styles were added
-
addModifyStyles
Description copied from interface:HasFeatureModifyStylesAdds modify styles to a feature.Note, modify styles will be applied not to the feature's geometry, but to the generated vertex point of the feature's geometry. This is because the map generates a point for geometry's vertices to enable modification: adding new vertex, change vertex position. So the provided styles should be valid for the point feature. So the provided styles should be valid for the point feature.
To enable modify mode set
SupportsFeatureModify.setFeatureModifyEnabled(Boolean)totrue.- Specified by:
addModifyStylesin interfaceHasFeatureModifyStyles- Parameters:
styles- styles to add
-
addAllModifyStyles
- Specified by:
addAllModifyStylesin interfaceHasFeatureModifyStyles- Parameters:
styles- styles to add- See Also:
-
removeModifyStyles
Description copied from interface:HasFeatureModifyStylesRemoves modify styles from a feature.- Specified by:
removeModifyStylesin interfaceHasFeatureModifyStyles- Parameters:
styles- styles to remove
-
removeAllModifyStyles
public void removeAllModifyStyles()Description copied from interface:HasFeatureModifyStylesRemoves all added modify styles from a feature.- Specified by:
removeAllModifyStylesin interfaceHasFeatureModifyStyles
-
withModifyStyles
- Parameters:
styles- styles to add- Returns:
- current instance
-
getProperties
-
withProperties
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); });- Parameters:
properties- properties to set- Returns:
- current instance
-
withProperty
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); });- Parameters:
name- property namevalue- value- Returns:
- current instance
-
removeProperty
Removes property from the feature.- Parameters:
name- property name to remove
-
removeAllProperties
public void removeAllProperties()Removes all properties from the feature. -
updateSelectStyleIds
protected void updateSelectStyleIds() -
updateModifyStyleIds
protected void updateModifyStyleIds()
-