wrld.js

Adding a building highlight

Add a highlight for a building.

<!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.796, -122.4027],
            zoom: 16
        });

        function onInitialStreamingComplete() {
            var buildingHighlight = L.Wrld.buildings.buildingHighlight(
                L.Wrld.buildings.buildingHighlightOptions()
                    .highlightBuildingAtLocation([37.795189, -122.402777])
                    .color([255, 255, 0, 128])
                )
                .addTo(map);
        };

        map.on("initialstreamingcomplete", onInitialStreamingComplete);
    </script>
  </div>
  </body>
</html>
v0.1.1452