Class: Fill

ol/style/Fill~Fill


import Fill from 'ol/style/Fill.js';

Set fill style for vector features.

new Fill(options)

Name Type Description
color Color | ColorLike | PatternDescriptor | null (defaults to null)

A color, gradient or pattern. See Color and ColorLike for possible formats. For polygon fills (not for RegularShape fills), a pattern can also be provided as PatternDescriptor. Default null; if null, the Canvas/renderer default black will be used.

Methods

Clones the style. The color is not cloned if it is a ColorLike.

Returns:
The cloned style.

Get the fill color.

Returns:
Color.

setColor(color)

Set the color.

Name Type Description
color Color | ColorLike | PatternDescriptor | null

Color.