Skip to content

Commit

Permalink
Add vanilla js example (visgl#1860)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress authored May 25, 2018
1 parent 526e0d5 commit 9ef477a
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions examples/get-started/scripting/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<html>
<head>
<!-- deck.gl standalone bundle -->
<script src="https://unpkg.com/deck.gl@~5.2.0/deckgl.min.js"></script>

<!-- Mapbox dependencies: only if base map is needed -->
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.css" rel="stylesheet" />

<style type="text/css">
body {margin: 0; padding: 0;}
#container {width: 100vw; height: 100vh;}
</style>
</head>

<body>
<div id="container"></div>
</body>

<script type="text/javascript">
const deckgl = new deck.DeckGL({
container: 'container',
mapboxAccessToken: '<your-mapbox-token>',
longitude: -122.45,
latitude: 37.8,
zoom: 12,
layers: [
new deck.ScatterplotLayer({
data: [
{position: [-122.45, 37.8], color: [255, 0, 0], radius: 1000}
]
}),
new deck.TextLayer({
data: [
{position: [-122.45, 37.8], text: 'Hello World'}
]
})
]
});
</script>
</html>

0 comments on commit 9ef477a

Please sign in to comment.