Move the blue sphere indoors
Display the blue sphere inside an indoor map.
<!DOCTYPE HTML>
<html>
<head>
<script src="https://unpkg.com/wrld.js@1.x.x"></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/v1/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/v1/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 = Wrld.map("map", "your_api_key_here", {
center: [56.459721, -2.977541],
zoom: 18,
indoorsEnabled: true
});
var indoorControl = new WrldIndoorControl("widget-container", map);
var initialBlueSphereLocation = Wrld.latLng(56.460017, -2.978245);
var alteredBlueSphereLocation = Wrld.latLng(56.459943, -2.978216);
var locationToggle = false;
function onInitialStreamingComplete() {
map.blueSphere.setEnabled(true);
map.blueSphere.setLocation([56.459721, -2.977541]);
map.blueSphere.setIndoorMap("westport_house", 2);
setInterval(function() {
locationToggle = !locationToggle;
map.blueSphere.setLocation(locationToggle ? alteredBlueSphereLocation : initialBlueSphereLocation);
}, 2000);
}
map.on("initialstreamingcomplete", onInitialStreamingComplete);
</script>
</div>
</body>
</html>