-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
55 lines (45 loc) · 1.29 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!doctype html>
<html>
<head>
<title>buildings</title>
<style type="text/css">
#map {
position:absolute;
top:0; bottom: 0; right: 0; left: 0;
}
</style>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<script type="text/javascript" src="../street-names/js/lib/leaflet.js"></script>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<div id='map'></div>
<script type="text/javascript">
var map = L.map('map',{
maxBounds: [[46.6412301,23.4324747],[46.9201137,23.8047838]]
})
.fitBounds([[46.7412301, 23.53816],[46.76813, 23.59253]]);
var AltTiles = 'http://b.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png';
var StamenTiles = 'http://a.tile.stamen.com/toner-lite/{z}/{x}/{y}.png';
L.tileLayer(AltTiles).addTo(map);
d3.json('temp-data/pins.json', function(data) {
L.geoJson(data.features, {
onEachFeature: function(feature, layer) {
layer.on('click', function() {
console.log(layer.feature.properties);
});
}
}).addTo(map);
});
d3.json('json/buildings.json', function(data) {
L.geoJson(data.features, {
onEachFeature: function(feature, layer) {
layer.on('click', function() {
console.log(layer.feature.properties);
});
}
}).addTo(map);
});
</script>
</body>
</html>