Using indoor map load events

Obtain notification that an indoor map has been loaded or unloaded by the streaming system.

<!DOCTYPE HTML>
<html>
  <head>
    <script src="https://cdn-webgl.wrld3d.com/wrldjs/dist/latest/wrld.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.Wrld.map("map", "your_api_key_here", {
        center: [37.782084, -122.404578],
        zoom: 18,
        indoorsEnabled: true
      });

      function onIndoorMapLoad(event) {
        console.log("Indoor map loaded: " + event.indoorMapId);
        var readableName = map.indoors.tryGetReadableName(event.indoorMapId);
        console.log("readableName: " + readableName);
      }

      function onIndoorMapUnload(event) {
        console.log("Indoor map unloaded: " + event.indoorMapId);
      }

      map.indoors.on("indoormapload", onIndoorMapLoad);
      map.indoors.on("indoormapunload", onIndoorMapUnload);
    </script>
  </div>
  </body>
</html>
v0.1.2009