Skip to content

Instantly share code, notes, and snippets.

@rfriberg
Last active February 28, 2017 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rfriberg/3c1e2447a77958e893a74a279014499b to your computer and use it in GitHub Desktop.
Save rfriberg/3c1e2447a77958e893a74a279014499b to your computer and use it in GitHub Desktop.
Bells and Whistles
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bells and Whistles</title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://mapzen.com/js/mapzen.css">
<script src="https://mapzen.com/js/mapzen.min.js"></script>
<style>
#map {
height: 100%;
width: 100%;
position: absolute;
}
html,body{margin: 0; padding: 0}
</style>
</head>
<body>
<div id="map"></div>
<script>
// Mapzen API key (replace key with your own)
// To generate your own key, go to https://mapzen.com/developers/
L.Mapzen.apiKey = 'mapzen-JA21Wes';
var map = L.Mapzen.map('map', {
center: [37.7749, -122.4194],
zoom: 13,
scene: L.Mapzen.BasemapStyles.Refill
});
// Mapzen search box
var geocoder = L.Mapzen.geocoder();
geocoder.setPosition('topright');
geocoder.addTo(map);
// Mapzen locator (i.e., Find my location)
var locator = L.Mapzen.locator();
locator.addTo(map);
// Mapzen hash (for deep linking to map location and state)
L.Mapzen.hash({
map: map,
geocoder: geocoder
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment