Class: Icon

cercalia.Icon

The cercalia.Marker can contain icons. This icons can be created using this class. This icon can include rotation, transparency.
If icon option is not included in the cercalia.Marker constructor, by default cercalia API use the icon.

new cercalia.Icon(options)

Name Type Description
options
Name Type Description
anchor Array.<number> | undefined optional

Anchor. Default value [0.5, 0.5].

opacity number | undefined optional

Icon opacity. Default value 1.

rotation number | undefined optional

Icon rotation. Default value 0.

size Array.<number> | undefined optional

Icon dimensions. Default value: [23, 33].

src string

Image path URL. Default cercalia icon: marker.png

scale number | undefined optional

Icon image resizing factor. Default value 1.

Methods

staticcercalia.Icon.createDefault()

Default icon

Returns:
opacity Return icon anchor
Returns:
object ClassName

getIconStyle(){ol.style.Icon}

Returns:
opacity Image opacity.
Returns:
Icon rotation (degrees).

getSize(){Array.<number>}

Returns:
size
Returns:
Image URL

Set icon anchor

Name Type Description
opacity number

Opacity.

Returns the icon image source

Name Type Description
opacity number

Opacity.

Apply a rotation, degrees.

Name Type Description
rotation string

degrees rotation.

Name Type Description
size Array.<number>

Size image source.

Deprecated
  • Yes

Assign the icon image source

Name Type Description
src string

Image URL.