Class: FillPattern

ol.style. FillPattern

Fill style with named pattern


new FillPattern(options)

Parameters:
Name Type Description
options any
Properties
Name Type Description
image ol.style.Image | undefined

an image pattern, image must be preloaded to draw on first call

opacity number | undefined

opacity with image pattern, default:1

pattern string

pattern name (override by image option)

color ol.color

pattern color

fill ol.style.Fill

fill color (background)

offset number | Array.<number>

pattern offset for hash/dot/circle/cross pattern

size number

line size for hash/dot/circle/cross pattern

spacing number

spacing for hash/dot/circle/cross pattern

angle number | bool

angle for hash pattern / true for 45deg dot/circle/cross

scale number

pattern scale

Extends

  • ol.style.Fill

Members


<static> patterns

Patterns definitions

See:
  • pattern generator http://www.imagico.de/map/jsdotpattern.php

Methods


<static> addPattern(title, options [, font])

Static fuction to add char patterns

Parameters:
Name Type Argument Default Description
title title
options object
Properties
Name Type Argument Default Description
size integer <optional>
10

default 10

width integer <optional>
10

default 10

height integer <optional>
10

default 10

circles Array.<circles> <optional>
lines Array.<pointlist> <optional>
stroke integer <optional>
fill bool <optional>
option.char char <optional>
font string <optional>
"10px Arial"

clone()

Clones the style.

Returns:
Type
ol.style.FillPattern

getImage()

Get canvas used as pattern

Returns:
Type
canvas

getPattern_(options)

Get pattern

Parameters:
Name Type Description
options olx.style.FillPatternOption