Module: ol/style/Style

ol/style/Style


Classes

Style

Type Definitions

GeometryFunction()

A function that takes an module:ol/Feature~Feature as argument and returns an module:ol/geom/Geometry~Geometry that will be rendered and styled for the feature.

Options{Object}

Properties:
Name Type Argument Description
geometry string | module:ol/geom/Geometry~Geometry | module:ol/style/Style~GeometryFunction <optional>

Feature property or geometry or function returning a geometry to render for this style.

fill module:ol/style/Fill~Fill <optional>

Fill style.

image module:ol/style/Image~ImageStyle <optional>

Image style.

renderer module:ol/style/Style~RenderFunction <optional>

Custom renderer. When configured, fill, stroke and image will be ignored, and the provided function will be called with each render frame for each geometry.

hitDetectionRenderer module:ol/style/Style~RenderFunction <optional>

Custom renderer for hit detection. If provided will be used in hit detection rendering.

stroke module:ol/style/Stroke~Stroke <optional>

Stroke style.

text module:ol/style/Text~Text <optional>

Text style.

zIndex number <optional>

Z index.

RenderFunction()

Custom renderer function. Takes two arguments:

  1. The pixel coordinates of the geometry in GeoJSON notation.
  2. The module:ol/render~State of the layer renderer.

StyleFunction()

A function that takes an module:ol/Feature~Feature and a {number} representing the view's resolution. The function should return a module:ol/style/Style~Style or an array of them. This way e.g. a vector layer can be styled. If the function returns undefined, the feature will not be rendered.

A Style, an array of Style, or a StyleFunction.