eegeo.js

Adding a marker with a popup

Add a marker with a popup. All of the features of Leaflet.js markers and popups are available.

<!DOCTYPE HTML>
<html>
  <head>
    <script src="https://cdn-webgl.eegeo.com/eegeojs/early_access/latest/eegeo.js"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.1/leaflet.css" rel="stylesheet" />
  </head>
  <body>
  <div id="content" style="position: relative">
    <div id="map" style="height: 400px"></div>
    <script>
      var map = L.eeGeo.map("map", "your_api_key_here", {
        center: [37.7950, -122.401],
        zoom: 15
      });

      var marker = L.eeGeo.marker([37.7952, -122.4028], {
        elevation: 260.0,
        title: "Transamerica Pyramid"
      }).addTo(map);

      marker.bindPopup("This is the Transamerica Pyramid").openPopup();
    </script>
  </div>
  </body>
</html>