mapillary-js/debug/index.html
2016-02-05 16:06:46 +01:00

52 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Mapillary-js Debug Page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel='stylesheet' href='dist/mapillary-js.min.css' />
<style>
body { margin: 0; padding: 0; }
html, body, #viewer { width: 640px; height: 480px; }
</style>
</head>
<body style="padding: 2em;">
<div id='viewer'></div>
<button onclick="viewer.activateCover()">Activate Cover</button><button onclick="viewer.deactivateCover()">Deactivate Cover</button>
<br>
<button onclick="play()">Play</button><button onclick="stop()">Stop</button>
<script src='build/bundle.js'></script>
<script>
var viewer = new Mapillary.Viewer(
"viewer",
"MkJKbDA0bnZuZlcxeTJHTmFqN3g1dzo5NWEzOTg3OWUxZDI3MjM4",
"zarcRdNFZwg3FkXNcsFeGw",
{ "debug": true, "cover": false }
);
viewer.activateComponent("player");
var player = viewer.getComponent("player");
function play() {
viewer.deactivateComponent("cache");
player.play();
}
function stop() {
viewer.activateComponent("cache");
player.stop();
}
viewer.on("nodechanged", function (node) {
console.log(node.key);
});
viewer.on("loadingchanged", function (loading) {
console.log("loading:", loading);
});
</script>
</body>
</html>