eegeo.js

Exiting an indoor map

Automatically exit an indoor map 5 seconds after entering. Click one of the blue entrance markers to enter an indoor map.

<!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 style="position: relative">
    <div id="map" style="height: 400px"></div>
    <script>
      var map = L.eeGeo.map("map", "your_api_key_here", {
        center: [37.7858, -122.401],
        zoom: 15,
        indoorsEnabled: true
      });
      
      function onIndoorMapEntered() {
        setTimeout(function() {
          map.indoors.exit();
        }, 5000);
      }

      map.indoors.on("indoormapenter", onIndoorMapEntered);
    </script>
  </div>
  </body>
</html>