Protected
disposedThe object has already been disposed.
Protected
applyProtected
Apply any properties from another object without triggering events.
The source object.
Dispatches an event and calls all listeners listening for events
of this type. The event parameter can either be a string or an
Object with a type
property.
Event object.
false
if anyone called preventDefault on the
event object or if any of the listeners returned false.
Protected
disposeGet the feature's default geometry. A feature may have any number of named geometries. The "default" geometry (the one that is rendered by default) is set when calling module:ol/Feature~Feature#setGeometry.
The default geometry for the feature.
Protected
onceProtected
onSet the default geometry for the feature. This will update the property with the name returned by module:ol/Feature~Feature#getGeometryName.
The new geometry.
Set the feature id. The feature id is considered stable and may be used when requesting features or comparing identifiers returned from a remote source. The feature id can be used with the module:ol/source/Vector~VectorSource#getFeatureById method.
The feature id.
Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).
Values.
Optional
silent: booleanUpdate without triggering an event.
Set the style for the feature to override the layer style. This can be a
single style object, an array of styles, or a function that takes a
resolution and returns an array of styles. To unset the feature style, call
setStyle()
without arguments or a falsey value.
Optional
style: StyleLikeStyle for this feature.
Protected
un
Classdesc
A vector object for geographic features with a geometry and other attribute properties, similar to the features in vector file formats like GeoJSON.
Features can be styled individually with
setStyle
; otherwise they use the style of their vector layer.Note that attribute properties are set as module:ol/Object~BaseObject properties on the feature object, so they are observable, and have get/set accessors.
Typically, a feature has a single geometry property. You can set the geometry using the
setGeometry
method and get it withgetGeometry
. It is possible to store more than one geometry on a feature using attribute properties. By default, the geometry used for rendering is identified by the property namegeometry
. If you want to use another geometry property for rendering, use thesetGeometryName
method to change the attribute property associated with the geometry for the feature. For example:Api