Class: ImageStyle

ol/style/Image~ImageStyle


import ImageStyle from 'ol/style/Image';

A base class used for creating subclasses and not instantiated in apps. Base class for module:ol/style/Icon~Icon, module:ol/style/Circle~CircleStyle and module:ol/style/RegularShape~RegularShape.

new ImageStyle(options)

Name Type Description
options

Options.

Name Type Description
opacity number
rotateWithView boolean
rotation number
scale number

Subclasses

Methods

Clones the style.

Returns:
The cloned style.

getOpacity(){number}

Get the symbolizer opacity.

Returns:
Opacity.

getRotateWithView(){boolean}

Determine whether the symbolizer rotates with the map.

Returns:
Rotate with map.

getRotation(){number}

Get the symoblizer rotation.

Returns:
Rotation.

getScale(){number}

Get the symbolizer scale.

Returns:
Scale.

getSnapToPixel(){boolean}

This method is deprecated and always returns false.

Deprecated
  • Yes
Returns:
false.

setOpacity(opacity)

Set the opacity.

Name Type Description
opacity number

Opacity.

setRotateWithView(rotateWithView)

Set whether to rotate the style with the view.

Name Type Description
rotateWithView boolean

Rotate with map.

setRotation(rotation)

Set the rotation.

Name Type Description
rotation number

Rotation.

setScale(scale)

Set the scale.

Name Type Description
scale number

Scale.

setSnapToPixel(snapToPixel)

This method is deprecated and does nothing.

Name Type Description
snapToPixel boolean

Snap to pixel?

Deprecated
  • Yes