Skip to content

Instantly share code, notes, and snippets.

@Pessimistress
Last active April 26, 2019 01:35
Show Gist options
  • Save Pessimistress/7cd1d7eab1a88a9672a9d292cc9f7aaa to your computer and use it in GitHub Desktop.
Save Pessimistress/7cd1d7eab1a88a9672a9d292cc9f7aaa to your computer and use it in GitHub Desktop.
deck.gl GoogleMapsOverlay Code Sample
<html>
<head>
<script src="https://unpkg.com/deck.gl@^7.0.0/dist.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=<google_maps_api_key>&libraries=visualization&v=3.34"></script>
<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 map = new google.maps.Map(document.getElementById('container'), {
center: {lat: 51.47, lng: 0.45},
zoom: 5
});
const deckOverlay = new deck.GoogleMapsOverlay({
layers: [
...
]
});
deckOverlay.setMap(map);
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment