Skip to content

Instantly share code, notes, and snippets.

@jatorre
Last active May 26, 2016 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jatorre/2de69597ff2dfb76ebce5298de5ce07d to your computer and use it in GitHub Desktop.
Save jatorre/2de69597ff2dfb76ebce5298de5ce07d to your computer and use it in GitHub Desktop.
Mapzen
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2/leaflet.css">
<link rel="stylesheet" href="https://erasermap.com/css/main.css">
</head>
<body>
<div id="map"></div>
<script src='https://geoiplookup.wikimedia.org/'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.2/leaflet.js"></script>
<script src="https://mapzen.com/tangram/tangram.min.js"></script>
<script src="https://erasermap.com/map/bundle.min.js"></script>
<script>
// when GeoIP is available, set the map's initial view to detected coords.
var lat, lon;
if (typeof Geo === 'object') {
lon = Geo.lon
lat = Geo.lat
} else {
lon = -74.009
lat = 40.70531
}
var webmap = WebMap.init(document.getElementById('map'), [lat, lon], 14);
//going with rawgit file since bubble wrap style is still work in process,
//and has some dependancies.
webmap.setupScene('https://mapzen.com/carto/bubble-wrap-style/2/bubble-wrap.yaml');
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment