-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
136 lines (112 loc) · 5.2 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css"
integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ=="
crossorigin=""/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/css/bootstrap-select.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"
integrity="sha512-lInM/apFSqyy1o6s89K4iQUKg6ppXEgsVxT35HbzUupEVRh2Eu9Wdl4tHj7dZO0s1uvplcYGmt3498TtHq+log=="
crossorigin=""></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-color.v1.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v1.min.js"></script>
<script src="https://d3js.org/d3-scale-chromatic.v1.min.js"></script>
<script src="lib/leaflet-providers.js"></script>
<script src="lib/jszip.min.js"> </script>
<script src="lib/lodash.js"> </script>
<script src="lib/rbush.js"> </script>
<script src="lib/knn.js"> </script>
<script src="lib/jszip-utils.js"> </script>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/js/bootstrap-select.min.js"></script>
<script src="client/colorHexs.js"> </script>
<script src="client/popUp.js"> </script>
<script src="client/controllers.js"> </script>
<script src="client/hexsClass.js"> </script>
<script src="client/legend.js"> </script>
<script src="lib/loadFile.js"> </script>
<script src="lib/unionHexs.js"> </script>
<link rel="stylesheet" href="./home.css"/>
</head>
<body>
<div id="mapid"></div>
<script>
let tileLayers = {}
tileLayers["osm"] = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
minZoom: 2,
maxZoom: 20,
tileSize: 256,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
tileLayers["here"] = L.tileLayer.provider('HERE.normalDayTransit',{
app_id : 'IbEW2PDzNwdzV4pFf35t',
app_code : 'yIfUWrkTbLG_cdWMxlLK5g',
minZoom: 2,
maxZoom: 20,
tileSize: 256,
detectRetina:true,
});
tileLayers["Thunderforest_Transport"] = L.tileLayer('http://{s}.tile.thunderforest.com/transport/{z}/{x}/{y}.png', {
//attribution: '© <a href="http://www.opencyclemap.org">OpenCycleMap</a>, © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
minZoom: 1,
maxZoom: 20,
tileSize: 256,
detectRetina: true
});
tileLayers["Esri_WorldImagery"] = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
minZoom: 1,
maxZoom: 20,
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
});
tileLayers["Stamen_TonerLite"] = L.tileLayer('http://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.{ext}', {
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://www.openstreetmap.org/copyright">OpenStreetMap</a>',
subdomains: 'abcd',
minZoom: 1,
maxZoom: 18,
ext: 'png',
detectRetina:true,
//noWrap: true
});
tileLayers["Stamen_Toner"] = L.tileLayer('http://stamen-tiles-{s}.a.ssl.fastly.net/toner/{z}/{x}/{y}.{ext}', {
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://www.openstreetmap.org/copyright">OpenStreetMap</a>',
subdomains: 'abcd',
minZoom: 1,
maxZoom: 18,
ext: 'png',
detectRetina:true,
//noWrap: true
});
let baseMaps = {
"Default": tileLayers.here,
"Transport": tileLayers.Thunderforest_Transport,
"Transport night" : tileLayers.Thunderforest_TransportDark,
"OpenStreetMap" : tileLayers.osm,
'Sat' : tileLayers.Esri_WorldImagery,
'B&WLite' : tileLayers.Stamen_TonerLite,
'B&W' : tileLayers.Stamen_Toner
};
let mymap = L.map('mapid',{
//renderer: L.canvas(),
center: [41.893056, 12.482778],
zoom: 12,
dragging: true,
zoomControl : true,
layers: [tileLayers['here']],
attributionControl:true,
zoomSnap:1,
scrollWheelZoom:true,
//zoomDelta:0.2,
//zoomSnap:0.2,
//inertia:false
});
L.control.layers(tileLayers).addTo(mymap);
var hexs = new geoJsonClass()
loadZips(hexs);
var legend = makeLegend();
legend.addTo(mymap)
var controllers = makeControllers(mymap, hexs);
</script>
</body>