-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
191 lines (189 loc) · 9.15 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="css/leaflet.css">
<link rel="stylesheet" href="css/qgis2web.css"><link rel="stylesheet" href="css/fontawesome-all.min.css">
<style>
html, body, #map {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
</style>
<title></title>
</head>
<body>
<div id="map">
</div>
<script src="js/qgis2web_expressions.js"></script>
<script src="js/leaflet.js"></script>
<script src="js/multi-style-layer.js"></script>
<script src="js/leaflet.rotatedMarker.js"></script>
<script src="js/leaflet.pattern.js"></script>
<script src="js/leaflet-hash.js"></script>
<script src="js/Autolinker.min.js"></script>
<script src="js/rbush.min.js"></script>
<script src="js/labelgun.min.js"></script>
<script src="js/labels.js"></script>
<script src="data/Concelhos_3.js"></script>
<script src="data/RegiodaBairrada_4.js"></script>
<script>
var map = L.map('map', {
zoomControl:true, maxZoom:28, minZoom:1
}).fitBounds([[40.22898841396736,-9.048196163194534],[40.680177905177054,-8.004285594126383]]);
var hash = new L.Hash(map);
map.attributionControl.setPrefix('<a href="https://github.com/tomchadwin/qgis2web" target="_blank">qgis2web</a> · <a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>');
var bounds_group = new L.featureGroup([]);
function setBounds() {
}
var layer_GoogleSatellite_0 = L.tileLayer('https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', {
opacity: 1.0,
attribution: '<a href="https://www.google.at/permissions/geoguidelines/attr-guide.html">Map data ©2015 Google</a>',
});
layer_GoogleSatellite_0;
var layer_StamenTerrain_1 = L.tileLayer('http://a.tile.stamen.com/terrain/{z}/{x}/{y}.png', {
opacity: 1.0,
attribution: '<a href="http://maps.stamen.com/">Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL</a>',
});
layer_StamenTerrain_1;
var layer_StamenToner_2 = L.tileLayer('http://tile.stamen.com/toner/{z}/{x}/{y}.png', {
opacity: 1.0,
attribution: '<a href="http://maps.stamen.com/">Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL</a>',
});
layer_StamenToner_2;
map.addLayer(layer_StamenToner_2);
function pop_Concelhos_3(feature, layer) {
var popupContent = '<table>\
<tr>\
<td colspan="2">' + (feature.properties['DICO'] !== null ? Autolinker.link(String(feature.properties['DICO'])) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['Concelho'] !== null ? Autolinker.link(String(feature.properties['Concelho'])) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['Distrito'] !== null ? Autolinker.link(String(feature.properties['Distrito'])) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['NUTIII_DSG'] !== null ? Autolinker.link(String(feature.properties['NUTIII_DSG'])) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['NUTII_DSG'] !== null ? Autolinker.link(String(feature.properties['NUTII_DSG'])) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['NUTI_DSG'] !== null ? Autolinker.link(String(feature.properties['NUTI_DSG'])) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['ALT_MAX'] !== null ? Autolinker.link(String(feature.properties['ALT_MAX'])) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['ALT_MIN'] !== null ? Autolinker.link(String(feature.properties['ALT_MIN'])) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['N_Freguesi'] !== null ? Autolinker.link(String(feature.properties['N_Freguesi'])) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2"><strong>Area_Ha</strong><br />' + (feature.properties['Area_Ha'] !== null ? Autolinker.link(String(feature.properties['Area_Ha'])) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_Concelhos_3_0() {
return {
pane: 'pane_Concelhos_3',
opacity: 1,
color: 'rgba(178,223,138,1.0)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 2.0,
fillOpacity: 0,
}
}
map.createPane('pane_Concelhos_3');
map.getPane('pane_Concelhos_3').style.zIndex = 403;
map.getPane('pane_Concelhos_3').style['mix-blend-mode'] = 'normal';
var layer_Concelhos_3 = new L.geoJson(json_Concelhos_3, {
attribution: '',
pane: 'pane_Concelhos_3',
onEachFeature: pop_Concelhos_3,
style: style_Concelhos_3_0,
});
bounds_group.addLayer(layer_Concelhos_3);
function pop_RegiodaBairrada_4(feature, layer) {
var popupContent = '<table>\
<tr>\
<td colspan="2">' + (feature.properties['Regiao'] !== null ? Autolinker.link(String(feature.properties['Regiao'])) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_RegiodaBairrada_4_0() {
return {
pane: 'pane_RegiodaBairrada_4',
opacity: 1,
color: 'rgba(30,243,22,1.0)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 4.0,
fillOpacity: 0,
}
}
function style_RegiodaBairrada_4_1() {
return {
pane: 'pane_RegiodaBairrada_4',
opacity: 1,
color: 'rgba(255,127,0,1.0)',
dashArray: '1,5',
lineCap: 'butt',
lineJoin: 'miter',
weight: 1.0,
fillOpacity: 0,
}
}
map.createPane('pane_RegiodaBairrada_4');
map.getPane('pane_RegiodaBairrada_4').style.zIndex = 404;
map.getPane('pane_RegiodaBairrada_4').style['mix-blend-mode'] = 'normal';
var layer_RegiodaBairrada_4 = new L.geoJson.multiStyle(json_RegiodaBairrada_4, {
attribution: '',
pane: 'pane_RegiodaBairrada_4',
onEachFeature: pop_RegiodaBairrada_4,
styles: [style_RegiodaBairrada_4_0,style_RegiodaBairrada_4_1,]
});
bounds_group.addLayer(layer_RegiodaBairrada_4);
map.addLayer(layer_RegiodaBairrada_4);
var baseMaps = {};
L.control.layers(baseMaps,{'<img src="legend/RegiodaBairrada_4.png" /> Região da Bairrada': layer_RegiodaBairrada_4,'<img src="legend/Concelhos_3.png" /> Concelhos': layer_Concelhos_3,"Stamen Toner": layer_StamenToner_2,"Stamen Terrain": layer_StamenTerrain_1,"Google Satellite": layer_GoogleSatellite_0,}).addTo(map);
setBounds();
var i = 0;
layer_Concelhos_3.eachLayer(function(layer) {
var context = {
feature: layer.feature,
variables: {}
};
layer.bindTooltip((layer.feature.properties['Concelho'] !== null?String('<div style="color: #3d3c3c; font-size: 8pt; font-family: \'Noto Sans\', sans-serif;">' + layer.feature.properties['Concelho']) + '</div>':''), {permanent: true, offset: [-0, -16], className: 'css_Concelhos_3'});
labels.push(layer);
totalMarkers += 1;
layer.added = true;
addLabel(layer, i);
i++;
});
resetLabels([layer_Concelhos_3,layer_RegiãodaBairrada_4]);
map.on("zoomend", function(){
resetLabels([layer_Concelhos_3,layer_RegiãodaBairrada_4]);
});
map.on("layeradd", function(){
resetLabels([layer_Concelhos_3,layer_RegiãodaBairrada_4]);
});
map.on("layerremove", function(){
resetLabels([layer_Concelhos_3,layer_RegiãodaBairrada_4]);
});
</script>
</body>
</html>