forked from calvinmetcalf/leaflet.filegdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
66 lines (64 loc) · 2.34 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
<!doctype html><html lang="en"> <head>
<meta charset='utf-8'/>
<title>
Leaflet File GDB
</title>
<link rel="stylesheet" href="site/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="site/leaflet.ie.css" />
<![endif]-->
<style>
html { height: 100% }
body { height: 100%; margin: 0; padding: 0;}
#map{ height: 100% }
</style>
<link rel="stylesheet" href="site/gh-pages.css" />
</head>
<body><div class="github-fork-ribbon-wrapper right">
<div class="github-fork-ribbon">
<a href="https://github.com/calvinmetcalf/leaflet.filegdb">Fork me on GitHub</a>
</div>
</div>
<div id="map"></div>
<script src="site/leaflet.js"></script>
<script src="site/catiline.js"></script>
<script src="leaflet.fgdb.js"></script>
<script src="site/colorbrewer.js"></script>
<script src="site/spin.js"></script>
<script>
//(function(){
function color(s){
return colorbrewer.Spectral[11][Math.abs(JSON.stringify(s).split("").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0)) % 11];
}
var m = L.map('map').setView([ 42.3560069, -71.0458374], 11);
L.tileLayer('http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg',{attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'}).addTo(m);
var options = {
onEachFeature: function(feature, layer) {
if (feature.properties) {
layer.bindPopup(Object.keys(feature.properties).map(function(k) {
return k + ": " + feature.properties[k];
}).join("<br />"), {
maxHeight: 200
});
}
},
style:function(f){
return {
opacity: 1,
fillOpacity: 0.7,
radius: 6,
color: color(f)
};
}, pointToLayer: function(feature, latlng) {
return L.circleMarker(latlng, {
opacity: 1,
fillOpacity: 0.7,
color: color(feature)
});
}
};
L.fileGDB('site/fgdb.gdb.zip',options).addTo(m);
//})();
</script>
</body>
</html>