Class: Icon

Icon

experimental new ol.style.Icon(opt_options)

Name Type Argument Description
options optional

Options.

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.

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.

Extends

Methods

experimental getAnchor(){Array.<number>}

experimental getImage(pixelRatio){HTMLCanvasElement|HTMLVideoElement|Image}

Name Type Description
pixelRatio number

Pixel ratio.

Returns:
element.

experimental inherited getRotation(){number}

experimental inherited getScale(){number}

experimental getSize(){ol.Size}

experimental getSrc(){string|undefined}

Returns:
src.