Skip to content

Instantly share code, notes, and snippets.

@talllguy
Last active March 26, 2016 01:42
Show Gist options
  • Save talllguy/e8d67315990ca1f00f33 to your computer and use it in GitHub Desktop.
Save talllguy/e8d67315990ca1f00f33 to your computer and use it in GitHub Desktop.
mapillary-js slider
license: CC0
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://npmcdn.com/mapillary-js@1.1.0/dist/mapillary-js.min.js"></script>
<link rel="stylesheet" href="https://npmcdn.com/mapillary-js@1.1.0/dist/mapillary-js.min.css"/>
<style>
body { background-color: silver; }
.mly-wrapper { margin: 0 auto; }
.mly-wrapper {
position: relative;
background-color: grey;
width: 640px;
height: 480px;
}
#mly, .mapillary-js {
position: relative;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div class="mly-wrapper"><div class="mly" id="viewer"></div></div>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
var viewer = new Mapillary.Viewer(
"viewer",
"MkJKbDA0bnZuZlcxeTJHTmFqN3g1dzo5NWEzOTg3OWUxZDI3MjM4",
"7hLK9LjamiMQ-Jehwoy0zQ",
{
"cover": false,
"imageplane": false,
"direction": false,
"sequence": false,
"mouse": false,
"keyboard": false,
"slider": {
keys: {
background: "RRkBfmsQo0EDSvXm2k7VcA",
foreground: "7hLK9LjamiMQ-Jehwoy0zQ", // Same as initial key above
},
initialPosition: 1.0,
}
});
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment