-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschoolsboundaries.html
59 lines (47 loc) · 1.86 KB
/
schoolsboundaries.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Charter Schools Demo</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- leaflet css -->
<link rel="stylesheet" href="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<!-- map styles-->
<style>
html { height: 100%}
body { height: 100%; margin: 0; padding: 0;}
.map { width: 100%; height: 100%; }
</style>
</head>
<body>
<div id="map" id="map" class="map"></div>
<!-- Leaflet JS | You must call this in before you call in your own javascript for the map!-->
<script src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<!--Leaflet geoJSON plugin -->
<script src="leaflet.ajax.min.js"></script>
<script>
var map = L.map('map').setView([25.779, -80.2787], 10);
L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'examples.map-i875mjb7'
}).addTo(map);
function popUp(feature, layer) {
layer.bindPopup(
"<strong>Name:</strong> " + feature.properties.NAME +
"<br/><strong>Address:</strong> " + feature.properties.ADDRESS +
"<br/><strong>Phone:</strong> " + feature.properties.PHONE +
"</p>")
}
var boundaries = new L.GeoJSON.AJAX("http://gis.mdc.opendata.arcgis.com/datasets/b4275c23add9401bbf3305139450c1ec_0.geojson").addTo(map);
var schools = new L.GeoJSON.AJAX("http://gis.mdc.opendata.arcgis.com/datasets/d27bba9d06964aae96cacb9aa7748fac_0.geojson",{
filter: function(feature, layer) {
return feature.properties.GRADES == "9-12";
},
onEachFeature: popUp
}).addTo(map);
</script>
</body>
</html>