Class: Placemark

ol.Overlay. Placemark

A placemark element to be displayed over the map and attached to a single map location. The placemarks are customized using CSS.


new Placemark(options)

Parameters:
Name Type Description
options

Extend ol/Overlay/Popup options

Properties
Name Type Description
color String

placemark color

backgroundColor String

placemark color

contentColor String

placemark color

radius Number

placemark radius in pixel

popupClass String

the a class of the overlay to style the popup.

onclose: function | undefined

callback function when popup is closed

onshow function | undefined

callback function when popup is shown

Example
var popup = new ol.Overlay.Placemark();
map.addOverlay(popup);
popup.show(coordinate);
popup.hide();

Extends

Methods


setBackgroundColor(color)

Set the placemark background color.

Parameters:
Name Type Description
color string

setClassName(name)

Set the placemark class.

Parameters:
Name Type Description
name string

setColor(color)

Set the placemark color.

Parameters:
Name Type Description
color string

setContentColor(color)

Set the placemark content color.

Parameters:
Name Type Description
color string

setRadius(size)

Set the placemark radius.

Parameters:
Name Type Description
size number

size in pixel


show(coordinate, html)

Set the position and the content of the placemark (hide it before to enable animation).

Parameters:
Name Type Description
coordinate ol.Coordinate | string

the coordinate of the popup or the HTML content.

html string | undefined

the HTML content (undefined = previous content).