Skip to content

Instantly share code, notes, and snippets.

@ryanbaumann
Last active February 13, 2020 23:33
Show Gist options
  • Save ryanbaumann/f7b2b2c3220f02349acff01e1c211bae to your computer and use it in GitHub Desktop.
Save ryanbaumann/f7b2b2c3220f02349acff01e1c211bae to your computer and use it in GitHub Desktop.
Mapbox gl-js Inspect streets v11
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Mapbox GL Inspect</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.7.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.7.0/mapbox-gl.css' rel='stylesheet' />
<script src='https://github.com/lukasmartinelli/mapbox-gl-inspect/releases/download/v1.3.1/mapbox-gl-inspect.js'></script>
<link href='https://github.com/lukasmartinelli/mapbox-gl-inspect/releases/download/v1.3.1/mapbox-gl-inspect.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.mapboxgl-popup {
max-height: 400px;
}
.mapboxgl-popup-content {
overflow-y: scroll;
}
</style>
</head>
<body>
<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6IjIzcmN0NlkifQ.0LRTNgCc-envt9d5MzR75w';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11',
center: [-74.50, 40],
zoom: 3,
hash: true
});
map.addControl(new mapboxgl.NavigationControl());
map.addControl(new MapboxInspect({
showInspectMap: true,
showMapPopupOnHover: false,
showInspectMapPopupOnHover: false,
showMapPopup: true
}));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment