-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
70 lines (60 loc) · 2.93 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>mizziCAP! la mappa degli Opendatari in terra sicula</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.0.0/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.0.0/mapbox.css' rel='stylesheet' />
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.2.0/leaflet-omnivore.min.js'></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/leaflet.markercluster.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.css' rel='stylesheet' />
<link href='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.Default.css' rel='stylesheet' />
<meta property="og:image" content="http://siciliahub.github.io/mizziCAP/imgs/share_mizzicap.jpg" />
<meta property="og:title" content="mizziCAP! la mappa degli Opendatari in terra sicula" />
<meta property="og:url" content="http://siciliahub.github.io/mizziCAP/" />
<link rel="stylesheet" type="text/css" href="./css/stile.css">
</head>
<body>
<div id='map'>
<div id="map-ui">
<p>Un'idea di Giulio Di Chiara per <strong><a href="https://www.facebook.com/groups/opendatasicilia/permalink/597005833751409/" target="_blank">OpenDataSicilia</a></strong></p>
</div>
</div>
<script src='https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-hash/v0.2.1/leaflet-hash.js'></script>
<script>
L.mapbox.accessToken = 'pk.eyJ1IjoiYWJvcnJ1c28iLCJhIjoibFpOMXpEZyJ9.HNHxWxDvvFz5i2mgMEll7Q';
var map = L.mapbox.map('map', 'aborruso.ilc3l20e').addControl(L.mapbox.geocoderControl('mapbox.places', {
autocomplete: true
}));
map.options.maxZoom = 13;
var southWest = L.latLng(36.085,7.559),
northEast = L.latLng(46.965,13.975),
bounds = L.latLngBounds(southWest, northEast);
map.fitBounds(bounds);
function eachLayer(layer) {
var feature = layer.toGeoJSON();
if (feature.properties) {
layer.bindPopup('<strong>' + feature.properties.Nome + ' ' +feature.properties.Cognome + '</strong>' + ' | ' + '<a target="_blank" href="http://twitter.com/'+ feature.properties.twitter + '">' + feature.properties.twitter +'</a>' + '<hr>' + '<strong>Professione</strong>: ' + feature.properties.Professione + '<br>' + '<strong>Dataset di interesse</strong>: ' + feature.properties.dataset );
}
}
var points = omnivore.csv('geocoded.csv', {
icon: L.mapbox.marker.icon({
'marker-size': 'large',
'marker-symbol': 'bus',
'marker-color': '#fa0'
})
}).on('ready', function() {
//map.fitBounds(points.getBounds());
var markers = L.markerClusterGroup({
showCoverageOnHover: false,
maxClusterRadius: 100
});
markers.addLayer(points);
map.addLayer(markers);
points.eachLayer(eachLayer);
});
var hash = L.hash(map);
</script>
</body>
</html>