Class: Feature

ol.render.Feature


Lightweight, read-only, ol.Feature and ol.geom.Geometry like structure, optimized for vector tile 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 75

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 94

Get the extent of this feature's geometry.

Returns:
Extent.

getGeometry(){ol.render.Feature}

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

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 111

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 147

Get the feature properties.

Returns:
Feature properties.

getType(){ol.geom.GeometryType}

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

Get the type of this feature's geometry.

Returns:
Geometry type.