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 91

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 110

Get the extent of this feature's geometry.

Returns:
Extent.

getGeometry(){ol.render.Feature}

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

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 187

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 223

Get the feature properties.

Returns:
Feature properties.

getType(){ol.geom.GeometryType}

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

Get the type of this feature's geometry.

Returns:
Geometry type.