-
Notifications
You must be signed in to change notification settings - Fork 0
/
school_map.html
39 lines (37 loc) · 13.9 KB
/
school_map.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
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<style>
#mapb1c470fb215f4a118cc2d922292185e9 {
height:100%;
}
</style>
</head>
<body>
<div id="mapb1c470fb215f4a118cc2d922292185e9"></div>
<script text="text/javascript">
var map = L.map('mapb1c470fb215f4a118cc2d922292185e9');
L.tileLayer(
"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
{maxZoom:19, attribution: '<a href="https://github.com/jwass/mplleaflet">mplleaflet</a> | Map data (c) <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'}).addTo(map);
var gjData = {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-79.94272825922499, 40.4441619]}, "properties": {"html": "<svg width=\"18px\" height=\"18px\" viewBox=\"-9.0 -9.0 18.0 18.0\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> <path d=\"M 0.0 6.944444444444445 C 1.8416881944444448 6.944444444444445 3.608193547117038 6.21273396936279 4.9104637582399135 4.9104637582399135 C 6.21273396936279 3.608193547117038 6.944444444444445 1.8416881944444448 6.944444444444445 -0.0 C 6.944444444444445 -1.8416881944444448 6.21273396936279 -3.608193547117038 4.9104637582399135 -4.9104637582399135 C 3.608193547117038 -6.21273396936279 1.8416881944444448 -6.944444444444445 0.0 -6.944444444444445 C -1.8416881944444448 -6.944444444444445 -3.608193547117038 -6.21273396936279 -4.9104637582399135 -4.9104637582399135 C -6.21273396936279 -3.608193547117038 -6.944444444444445 -1.8416881944444448 -6.944444444444445 -0.0 C -6.944444444444445 1.8416881944444448 -6.21273396936279 3.608193547117038 -4.9104637582399135 4.9104637582399135 C -3.608193547117038 6.21273396936279 -1.8416881944444448 6.944444444444445 0.0 6.944444444444445 Z\" stroke=\"#0000FF\" stroke-width=\"1.0\" stroke-opacity=\"0.7\" fill=\"#0000FF\" fill-opacity=\"0.7\" /></svg>", "anchor_x": 9.0, "anchor_y": 9.0}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-77.07457962060826, 38.90893925]}, "properties": {"html": "<svg width=\"18px\" height=\"18px\" viewBox=\"-9.0 -9.0 18.0 18.0\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> <path d=\"M 0.0 6.944444444444445 C 1.8416881944444448 6.944444444444445 3.608193547117038 6.21273396936279 4.9104637582399135 4.9104637582399135 C 6.21273396936279 3.608193547117038 6.944444444444445 1.8416881944444448 6.944444444444445 -0.0 C 6.944444444444445 -1.8416881944444448 6.21273396936279 -3.608193547117038 4.9104637582399135 -4.9104637582399135 C 3.608193547117038 -6.21273396936279 1.8416881944444448 -6.944444444444445 0.0 -6.944444444444445 C -1.8416881944444448 -6.944444444444445 -3.608193547117038 -6.21273396936279 -4.9104637582399135 -4.9104637582399135 C -6.21273396936279 -3.608193547117038 -6.944444444444445 -1.8416881944444448 -6.944444444444445 -0.0 C -6.944444444444445 1.8416881944444448 -6.21273396936279 3.608193547117038 -4.9104637582399135 4.9104637582399135 C -3.608193547117038 6.21273396936279 -1.8416881944444448 6.944444444444445 0.0 6.944444444444445 Z\" stroke=\"#0000FF\" stroke-width=\"1.0\" stroke-opacity=\"0.7\" fill=\"#0000FF\" fill-opacity=\"0.7\" /></svg>", "anchor_x": 9.0, "anchor_y": 9.0}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-87.67581113482166, 42.055116399999996]}, "properties": {"html": "<svg width=\"18px\" height=\"18px\" viewBox=\"-9.0 -9.0 18.0 18.0\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> <path d=\"M 0.0 6.944444444444445 C 1.8416881944444448 6.944444444444445 3.608193547117038 6.21273396936279 4.9104637582399135 4.9104637582399135 C 6.21273396936279 3.608193547117038 6.944444444444445 1.8416881944444448 6.944444444444445 -0.0 C 6.944444444444445 -1.8416881944444448 6.21273396936279 -3.608193547117038 4.9104637582399135 -4.9104637582399135 C 3.608193547117038 -6.21273396936279 1.8416881944444448 -6.944444444444445 0.0 -6.944444444444445 C -1.8416881944444448 -6.944444444444445 -3.608193547117038 -6.21273396936279 -4.9104637582399135 -4.9104637582399135 C -6.21273396936279 -3.608193547117038 -6.944444444444445 -1.8416881944444448 -6.944444444444445 -0.0 C -6.944444444444445 1.8416881944444448 -6.21273396936279 3.608193547117038 -4.9104637582399135 4.9104637582399135 C -3.608193547117038 6.21273396936279 -1.8416881944444448 6.944444444444445 0.0 6.944444444444445 Z\" stroke=\"#0000FF\" stroke-width=\"1.0\" stroke-opacity=\"0.7\" fill=\"#0000FF\" fill-opacity=\"0.7\" /></svg>", "anchor_x": 9.0, "anchor_y": 9.0}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-96.35212800264428, 30.6108365]}, "properties": {"html": "<svg width=\"18px\" height=\"18px\" viewBox=\"-9.0 -9.0 18.0 18.0\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> <path d=\"M 0.0 6.944444444444445 C 1.8416881944444448 6.944444444444445 3.608193547117038 6.21273396936279 4.9104637582399135 4.9104637582399135 C 6.21273396936279 3.608193547117038 6.944444444444445 1.8416881944444448 6.944444444444445 -0.0 C 6.944444444444445 -1.8416881944444448 6.21273396936279 -3.608193547117038 4.9104637582399135 -4.9104637582399135 C 3.608193547117038 -6.21273396936279 1.8416881944444448 -6.944444444444445 0.0 -6.944444444444445 C -1.8416881944444448 -6.944444444444445 -3.608193547117038 -6.21273396936279 -4.9104637582399135 -4.9104637582399135 C -6.21273396936279 -3.608193547117038 -6.944444444444445 -1.8416881944444448 -6.944444444444445 -0.0 C -6.944444444444445 1.8416881944444448 -6.21273396936279 3.608193547117038 -4.9104637582399135 4.9104637582399135 C -3.608193547117038 6.21273396936279 -1.8416881944444448 6.944444444444445 0.0 6.944444444444445 Z\" stroke=\"#0000FF\" stroke-width=\"1.0\" stroke-opacity=\"0.7\" fill=\"#0000FF\" fill-opacity=\"0.7\" /></svg>", "anchor_x": 9.0, "anchor_y": 9.0}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-71.09567787663931, 42.3583961]}, "properties": {"html": "<svg width=\"18px\" height=\"18px\" viewBox=\"-9.0 -9.0 18.0 18.0\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> <path d=\"M 0.0 6.944444444444445 C 1.8416881944444448 6.944444444444445 3.608193547117038 6.21273396936279 4.9104637582399135 4.9104637582399135 C 6.21273396936279 3.608193547117038 6.944444444444445 1.8416881944444448 6.944444444444445 -0.0 C 6.944444444444445 -1.8416881944444448 6.21273396936279 -3.608193547117038 4.9104637582399135 -4.9104637582399135 C 3.608193547117038 -6.21273396936279 1.8416881944444448 -6.944444444444445 0.0 -6.944444444444445 C -1.8416881944444448 -6.944444444444445 -3.608193547117038 -6.21273396936279 -4.9104637582399135 -4.9104637582399135 C -6.21273396936279 -3.608193547117038 -6.944444444444445 -1.8416881944444448 -6.944444444444445 -0.0 C -6.944444444444445 1.8416881944444448 -6.21273396936279 3.608193547117038 -4.9104637582399135 4.9104637582399135 C -3.608193547117038 6.21273396936279 -1.8416881944444448 6.944444444444445 0.0 6.944444444444445 Z\" stroke=\"#0000FF\" stroke-width=\"1.0\" stroke-opacity=\"0.7\" fill=\"#0000FF\" fill-opacity=\"0.7\" /></svg>", "anchor_x": 9.0, "anchor_y": 9.0}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-71.12678237443698, 42.36790855]}, "properties": {"html": "<svg width=\"18px\" height=\"18px\" viewBox=\"-9.0 -9.0 18.0 18.0\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> <path d=\"M 0.0 6.944444444444445 C 1.8416881944444448 6.944444444444445 3.608193547117038 6.21273396936279 4.9104637582399135 4.9104637582399135 C 6.21273396936279 3.608193547117038 6.944444444444445 1.8416881944444448 6.944444444444445 -0.0 C 6.944444444444445 -1.8416881944444448 6.21273396936279 -3.608193547117038 4.9104637582399135 -4.9104637582399135 C 3.608193547117038 -6.21273396936279 1.8416881944444448 -6.944444444444445 0.0 -6.944444444444445 C -1.8416881944444448 -6.944444444444445 -3.608193547117038 -6.21273396936279 -4.9104637582399135 -4.9104637582399135 C -6.21273396936279 -3.608193547117038 -6.944444444444445 -1.8416881944444448 -6.944444444444445 -0.0 C -6.944444444444445 1.8416881944444448 -6.21273396936279 3.608193547117038 -4.9104637582399135 4.9104637582399135 C -3.608193547117038 6.21273396936279 -1.8416881944444448 6.944444444444445 0.0 6.944444444444445 Z\" stroke=\"#0000FF\" stroke-width=\"1.0\" stroke-opacity=\"0.7\" fill=\"#0000FF\" fill-opacity=\"0.7\" /></svg>", "anchor_x": 9.0, "anchor_y": 9.0}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-73.99625393609625, 40.72925325]}, "properties": {"html": "<svg width=\"18px\" height=\"18px\" viewBox=\"-9.0 -9.0 18.0 18.0\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> <path d=\"M 0.0 6.944444444444445 C 1.8416881944444448 6.944444444444445 3.608193547117038 6.21273396936279 4.9104637582399135 4.9104637582399135 C 6.21273396936279 3.608193547117038 6.944444444444445 1.8416881944444448 6.944444444444445 -0.0 C 6.944444444444445 -1.8416881944444448 6.21273396936279 -3.608193547117038 4.9104637582399135 -4.9104637582399135 C 3.608193547117038 -6.21273396936279 1.8416881944444448 -6.944444444444445 0.0 -6.944444444444445 C -1.8416881944444448 -6.944444444444445 -3.608193547117038 -6.21273396936279 -4.9104637582399135 -4.9104637582399135 C -6.21273396936279 -3.608193547117038 -6.944444444444445 -1.8416881944444448 -6.944444444444445 -0.0 C -6.944444444444445 1.8416881944444448 -6.21273396936279 3.608193547117038 -4.9104637582399135 4.9104637582399135 C -3.608193547117038 6.21273396936279 -1.8416881944444448 6.944444444444445 0.0 6.944444444444445 Z\" stroke=\"#0000FF\" stroke-width=\"1.0\" stroke-opacity=\"0.7\" fill=\"#0000FF\" fill-opacity=\"0.7\" /></svg>", "anchor_x": 9.0, "anchor_y": 9.0}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-118.28586726915087, 34.0218833]}, "properties": {"html": "<svg width=\"18px\" height=\"18px\" viewBox=\"-9.0 -9.0 18.0 18.0\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> <path d=\"M 0.0 6.944444444444445 C 1.8416881944444448 6.944444444444445 3.608193547117038 6.21273396936279 4.9104637582399135 4.9104637582399135 C 6.21273396936279 3.608193547117038 6.944444444444445 1.8416881944444448 6.944444444444445 -0.0 C 6.944444444444445 -1.8416881944444448 6.21273396936279 -3.608193547117038 4.9104637582399135 -4.9104637582399135 C 3.608193547117038 -6.21273396936279 1.8416881944444448 -6.944444444444445 0.0 -6.944444444444445 C -1.8416881944444448 -6.944444444444445 -3.608193547117038 -6.21273396936279 -4.9104637582399135 -4.9104637582399135 C -6.21273396936279 -3.608193547117038 -6.944444444444445 -1.8416881944444448 -6.944444444444445 -0.0 C -6.944444444444445 1.8416881944444448 -6.21273396936279 3.608193547117038 -4.9104637582399135 4.9104637582399135 C -3.608193547117038 6.21273396936279 -1.8416881944444448 6.944444444444445 0.0 6.944444444444445 Z\" stroke=\"#0000FF\" stroke-width=\"1.0\" stroke-opacity=\"0.7\" fill=\"#0000FF\" fill-opacity=\"0.7\" /></svg>", "anchor_x": 9.0, "anchor_y": 9.0}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-122.30800894320257, 47.65432379999999]}, "properties": {"html": "<svg width=\"18px\" height=\"18px\" viewBox=\"-9.0 -9.0 18.0 18.0\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> <path d=\"M 0.0 6.944444444444445 C 1.8416881944444448 6.944444444444445 3.608193547117038 6.21273396936279 4.9104637582399135 4.9104637582399135 C 6.21273396936279 3.608193547117038 6.944444444444445 1.8416881944444448 6.944444444444445 -0.0 C 6.944444444444445 -1.8416881944444448 6.21273396936279 -3.608193547117038 4.9104637582399135 -4.9104637582399135 C 3.608193547117038 -6.21273396936279 1.8416881944444448 -6.944444444444445 0.0 -6.944444444444445 C -1.8416881944444448 -6.944444444444445 -3.608193547117038 -6.21273396936279 -4.9104637582399135 -4.9104637582399135 C -6.21273396936279 -3.608193547117038 -6.944444444444445 -1.8416881944444448 -6.944444444444445 -0.0 C -6.944444444444445 1.8416881944444448 -6.21273396936279 3.608193547117038 -4.9104637582399135 4.9104637582399135 C -3.608193547117038 6.21273396936279 -1.8416881944444448 6.944444444444445 0.0 6.944444444444445 Z\" stroke=\"#0000FF\" stroke-width=\"1.0\" stroke-opacity=\"0.7\" fill=\"#0000FF\" fill-opacity=\"0.7\" /></svg>", "anchor_x": 9.0, "anchor_y": 9.0}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-73.9829166, 40.7739902]}, "properties": {"html": "<svg width=\"18px\" height=\"18px\" viewBox=\"-9.0 -9.0 18.0 18.0\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"> <path d=\"M 0.0 6.944444444444445 C 1.8416881944444448 6.944444444444445 3.608193547117038 6.21273396936279 4.9104637582399135 4.9104637582399135 C 6.21273396936279 3.608193547117038 6.944444444444445 1.8416881944444448 6.944444444444445 -0.0 C 6.944444444444445 -1.8416881944444448 6.21273396936279 -3.608193547117038 4.9104637582399135 -4.9104637582399135 C 3.608193547117038 -6.21273396936279 1.8416881944444448 -6.944444444444445 0.0 -6.944444444444445 C -1.8416881944444448 -6.944444444444445 -3.608193547117038 -6.21273396936279 -4.9104637582399135 -4.9104637582399135 C -6.21273396936279 -3.608193547117038 -6.944444444444445 -1.8416881944444448 -6.944444444444445 -0.0 C -6.944444444444445 1.8416881944444448 -6.21273396936279 3.608193547117038 -4.9104637582399135 4.9104637582399135 C -3.608193547117038 6.21273396936279 -1.8416881944444448 6.944444444444445 0.0 6.944444444444445 Z\" stroke=\"#0000FF\" stroke-width=\"1.0\" stroke-opacity=\"0.7\" fill=\"#0000FF\" fill-opacity=\"0.7\" /></svg>", "anchor_x": 9.0, "anchor_y": 9.0}}]};
if (gjData.features.length != 0) {
var gj = L.geoJson(gjData, {
style: function (feature) {
return feature.properties;
},
pointToLayer: function (feature, latlng) {
var icon = L.divIcon({'html': feature.properties.html,
iconAnchor: [feature.properties.anchor_x,
feature.properties.anchor_y],
className: 'empty'}); // What can I do about empty?
return L.marker(latlng, {icon: icon});
}
});
gj.addTo(map);
map.fitBounds(gj.getBounds());
} else {
map.setView([0, 0], 1);
}
</script>
</body>