Module: ol/style/Style




Type Definitions


A function that takes an Feature as argument and returns an Geometry that will be rendered and styled for the feature.


Name Type Argument Description
geometry string | Geometry | GeometryFunction <optional>

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

fill Fill <optional>

Fill style.

image ImageStyle <optional>

Image style.

renderer 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 RenderFunction <optional>

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

stroke Stroke <optional>

Stroke style.

text Text <optional>

Text style.

zIndex number <optional>

Z index.


Custom renderer function. Takes two arguments:

  1. The pixel coordinates of the geometry in GeoJSON notation.
  2. The State of the layer renderer.


A function that takes an Feature and a {number} representing the view's resolution. The function should return a 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.

StyleLike{Style} {Array<Style>} {StyleFunction}

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