Marker

Creates a marker.

Parameters

NameDescription
positionThe coordinates of the marker
mapThe map instance to which the marker attaches to
iconoptional You can choose one of the following icon colors:
green, blue, black, gold, grey, red, orange, violet or yellow.

Alternatively, you can use a valid URL of an image, for example: https://upload.wikimedia.org/wikipedia/commons/0/06/Gfi-set01-info-blue.png

Default: 'green'
titleoptional Add an HTML tooltip to the marker that shows on hovering

Default: ''

(Not available for Next Billion Maps GL)

Example

var marker = new nextbillion.maps.Marker({
position: loc,
map: map,
// "title" is not available for Next Billion Maps GL
title: 'Hello World!',
icon: 'gold',
})