Skip to content

Instantly share code, notes, and snippets.

@hpanno
Last active December 14, 2016 20:05
Show Gist options
  • Save hpanno/706371d4536cfadd5f8f59685868ee96 to your computer and use it in GitHub Desktop.
Save hpanno/706371d4536cfadd5f8f59685868ee96 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<title>SLU Water Sources</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>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-ajax/2.1.0/leaflet.ajax.js"></script>
<style>
#map {
height: 100%;
width: 100%;
position: absolute;
}
html,body{margin: 0; padding: 0}
</style>
</head>
<body>
<div id="map"></div>
<script>
var slo_county = [35.2827, -120.6596];
var map = L.Mapzen.map('map', {
center: slo_county,
zoom: 20,
scene: L.Mapzen.BasemapStyles.Refill
});
var water_sources = new L.GeoJSON.AJAX('https://gist.github.com/hpanno/a1a02237cfc7a84bc4f1#file-map-geojson')
style:{
color: '#518946',
opacity: 1,
fillcolor: '#BCE3B4',
fillOpacity: 0.8'
}
});
water_sources.addTo(map);
//Mapzen seach box
var geocoder = L.Mapzen.geocoder('mapzen-JA21Wes');
geocoder.setPosition('topright');
geocoder.addTo(map);
//Mapzen locator(find my location)
var locator = L.Mapzen.locator();
locator.addTo(map);
//Mapzen has (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