Class: Fill

ol/style/Fill~Fill


import Fill from 'ol/style/Fill';

Set fill style for vector features.

new Fill(opt_options)

Name Type Description
options

Options.

Name Type Description
color module:ol/color~Color | module:ol/colorlike~ColorLike (defaults to null)

A color, gradient or pattern. See module:ol/color~Color and module:ol/colorlike~ColorLike for possible formats. Default null; if null, the Canvas/renderer default black will be used.

Methods

Clones the style. The color is not cloned if it is an module:ol/colorlike~ColorLike.

Returns:
The cloned style.

Get the fill color.

Returns:
Color.

setColor(color)

Set the color.

Name Type Description
color module:ol/color~Color | module:ol/colorlike~ColorLike

Color.