wrld.js

Adding the Indoor Control to a map

Display a slider for moving between floors. Click the blue door marker to enter an indoor map. Use the button above the slider to exit.

This is an optional component with a few dependencies. To use it, you will have to include wrld.css and indoor_control.js, along with JQuery and JQuery UI, as shown in the code sample below.

<!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" />

    <link href="https://cdn-webgl.wrld3d.com/wrldjs/addons/resources/latest/css/wrld.css" rel="stylesheet"/>
    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
    <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js"></script>
    <script src="https://cdn-webgl.wrld3d.com/wrldjs/addons/indoor_control/latest/indoor_control.js"></script>
  </head>
  
  <body>
  <div style="position: relative">
    <div id="widget-container" class="wrld-widget-container"></div>
    <div id="map" style="height: 400px"></div>
    <script>
      var map = L.Wrld.map("map", "your_api_key_here", {
        center: [37.782276519634706, -122.40476157895424],
        zoom: 17,
        indoorsEnabled: true
      });

      var indoorControl = new WrldIndoorControl("widget-container", map);
    </script>

  </div>
  </body>
</html>
v0.1.1452