With GMaps.js you can add markers this way:
map.addMarker({ lat: -12.043333, lng: -77.028333, title: 'Lima', click: function(e) { alert('You clicked in this marker'); } });
latitude and longitude are required. You can also attach additional information with details
, which will be passed to Event object (e
) in the events previously defined.
NoteIf you want to show an Info Window, you must add:
infoWindow: { content: '<p>HTML Content</p>' }