Creates a marker.


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:

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

Default: ''

(Not available for Next Billion Maps GL)


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