ol.style.Icon

new Icon

Stability: experimental
Parameters:
Name Type Argument Description
options olx.style.IconOptions <optional>

Options.

Properties
Name Type Description
anchor Array.<number> | undefined

Anchor. Default value is [0.5, 0.5] (icon center).

anchorOrigin ol.style.IconAnchorOrigin | undefined

Origin of the anchor: bottom-left, bottom-right, top-left or top-right. Default is top-left.

anchorXUnits ol.style.IconAnchorUnits | undefined

Units in which the anchor x value is specified. A value of 'fraction' indicates the x value is a fraction of the icon. A value of 'pixels' indicates the x value in pixels. Default is 'fraction'.

anchorYUnits ol.style.IconAnchorUnits | undefined

Units in which the anchor y value is specified. A value of 'fraction' indicates the y value is a fraction of the icon. A value of 'pixels' indicates the y value in pixels. Default is 'fraction'.

crossOrigin null | string | undefined

crossOrigin setting for image.

origin Array.<number> | undefined

The top left corner, which, together with the size, define the sub-rectangle to use from the original icon image. Default value is [0, 0].

scale number | undefined

Scale.

rotateWithView boolean | undefined

Whether to rotate the icon with the view. Default is false.

rotation number | undefined

Rotation.

size ol.Size | undefined

Icon size in pixel.

src string

Image source URI.

Source:
  • iconstyle.js, line 45

Extends

Methods

getAnchor

Stability: experimental
Source:
  • iconstyle.js, line 144
Returns:

Anchor.

Type
Array.<number>

getImage

Stability: experimental
Parameters:
Name Type Description
pixelRatio number

Pixel ratio.

Source:
  • iconstyle.js, line 189
Returns:

Image element.

Type
HTMLCanvasElement | HTMLVideoElement | Image

getRotation

Stability: experimental
Inherited From:
Source:
  • imagestyle.js, line 104
Returns:

Rotation.

Type
number

getScale

Stability: experimental
Inherited From:
Source:
  • imagestyle.js, line 113
Returns:

Scale.

Type
number

getSize

Stability: experimental
Source:
  • iconstyle.js, line 223
Returns:

Size.

Type
ol.Size

getSrc

Stability: experimental
Source:
  • iconstyle.js, line 214
Returns:

Image src.

Type
string | undefined