Class: Feature

ol.render.Feature

Lightweight, read-only, ol.Feature and ol.geom.Geometry like structure, optimized for rendering and styling. Geometry access through the API is limited to getting the type and extent of the geometry.

Methods

get(key){*}

src/ol/render/feature.js, line 66

Get a feature property by its key.

Name Type Description
key string

Key

Returns:
Value for the requested key.

getExtent(){ol.Extent}

src/ol/render/feature.js, line 84

Get the extent of this feature's geometry.

Returns:
Extent.

getGeometry(){ol.render.Feature}

src/ol/render/feature.js, line 127

For API compatibility with ol.Feature, this method is useful when determining the geometry type in style function (see #getType).

Returns:
Feature.

getId(){number|string|undefined}

src/ol/render/feature.js, line 101

Get the feature identifier. This is a stable identifier for the feature and is set when reading data from a remote source.

Returns:
Id.

getProperties(){Object.<string, *>}

src/ol/render/feature.js, line 137

Get the feature properties.

Returns:
Feature properties.

getType(){ol.geom.GeometryType}

src/ol/render/feature.js, line 169

Get the type of this feature's geometry.

Returns:
Geometry type.