forked from willemarcel/salvadorbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
38 lines (34 loc) · 1.22 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Mapa dos Campi da UFRB</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
<style type="text/css">
body { padding: 0; margin: 0; }
html, body, #map { height: 100%; }
</style>
<script src="leaflet.js"></script>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<link rel="points" type="application/json" href="ufrb.geojson">
</head>
<body>
<div id="map"></div>
<script>
var mapTiles = L.tileLayer('http://otile4.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
attribution: 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> | © <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
});
$.getJSON($('link[rel="points"]').attr("href"), function(data) {
var geojson = L.geoJson(data, {
onEachFeature: function (feature, layer) {
layer.bindPopup('<a href="' + feature.properties.site + '">' + feature.properties.name + '</a>');
}
});
var map = L.map('map').fitBounds(geojson.getBounds());
mapTiles.addTo(map);
geojson.addTo(map);
var popup = L.marker().bindPopup();
});
</script>
</body>
</html>