Add Marker on Click Example

This demonstrates how you can add a marker to the map. In this particular example, we're adding a marker as a reaction to a click event on a button.

Add Marker!


<link rel="stylesheet" href="">

<script src=""></script>
<script src=""></script>


<div id="planit"></div>
<div style="text-align: center;">
  <a href="#" id="add-marker" class="button" 
     style="margin:-25px 0 0 0; display:block;">Add Marker!</a>


p =;

  randomX = Math.random() * 100;
  randomY = Math.random() * 100;
    coords: [randomX, randomY],
    color: '#12abe3'