Querying indoor map entity information

Obtain information about the entities within an indoor map

<!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: [56.459801, -2.977928],
        zoom: 18,
        indoorsEnabled: true
      });
      
      var markers = [];

      function onInitialStreamingComplete() {
        map.indoors.enter("westport_house");
        L.Wrld.indoorMapEntities
          .indoorMapEntityInformation("westport_house")
          .addTo(map);
      }

      function onIndoorMapEntityInformationChanged(event) {
        markers.forEach(function(marker) {
          marker.remove();
        });
      
        markers = [];

        var indoorMapEntityInformation = event.indoorMapEntityInformation;

        var indoorMapId = indoorMapEntityInformation.getIndoorMapId();
        var loadState = indoorMapEntityInformation.getLoadState();
        var indoorMapEntities = indoorMapEntityInformation.getIndoorMapEntities();
      
        console.log("Indoor Map Id: " + indoorMapId);
        console.log("Load State: " + loadState);
        console.log("Entities: " + indoorMapEntities.length);
      
        indoorMapEntities.forEach(function(entity) {
          var indoorMapEntityId = entity.getIndoorMapEntityId();
          var indoorMapFloorId = entity.getIndoorMapFloorId();
          var position = entity.getPosition();
          
          addMarker(position, indoorMapEntityId, indoorMapId, indoorMapFloorId);
        });
      }
      
      function addMarker(position, indoorMapEntityId, indoorMapId, indoorMapFloorId) {
        var marker = L.marker(position, {        
          title: indoorMapEntityId,
          indoorMapId: indoorMapId,
          indoorMapFloorId: indoorMapFloorId
        }).addTo(map);
        
        markers.push(marker);
      }
      
      function onIndoorMapEntered() {
        map.indoors.setFloor(2);
        map.setView([56.459984, -2.978238], 19);
      }

      map.on("initialstreamingcomplete", onInitialStreamingComplete);
      map.indoors.on("indoormapenter", onIndoorMapEntered);
      map.indoorMapEntities.on("indoormapentityinformationchanged", onIndoorMapEntityInformationChanged);
    </script>
  </div>
  </body>
</html>
v0.1.1960