-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
330 lines (302 loc) · 17.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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!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">
<link rel="stylesheet" href="css/leaflet-control-geocoder.Geocoder.css">
<link rel="stylesheet" href="css/body.css">
<title></title>
</head>
<body>
<div id="all">
<a href="https://github.com/stees/oQueTemNoBairro/" class="buttonGitHub">Repositório no GitHub</a>
<div id="header_text">
<h1>O que tem no meu bairro? (RMSP)</h1>
<p>Este site simples serve para você saber o que tem de iniciativas populares no seu entorno, dentro da Região Metropolitana de São Paulo.</p>
<p>Busque pelo seu endereço na <b>lupa</b>, aperte enter, selecione seu endereço, e veja em <b>qual subprefeitura você mora</b> clicando na área que contém o pino azul do seu endereço.</p>
</div>
<div id="map">
</div>
<script src="js/qgis2web_expressions.js"></script>
<script src="js/leaflet.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="js/leaflet-control-geocoder.Geocoder.js"></script>
<script src="data/0SPRMSPbaseSubprefeituras_1.js"></script>
<script src="data/0SPRMSPbaseRMSP_2.js"></script>
<script src="data/22centroscomunitrios_3.js"></script>
<script src="data/21associaesdebairro_4.js"></script>
<script>
var highlightLayer;
function highlightFeature(e) {
highlightLayer = e.target;
if (e.target.feature.geometry.type === 'LineString') {
highlightLayer.setStyle({
color: '#ffff00',
});
} else {
highlightLayer.setStyle({
fillColor: '#ffff00',
fillOpacity: 0.35
});
}
}
var map = L.map('map', {
zoomControl:true, maxZoom:17, minZoom:9
}).fitBounds([[-23.96,-45.73],[-23.15,-47.10]]).setMaxBounds([[-23.96,-45.73],[-23.15,-47.10]]);
var hash = new L.Hash(map);
map.attributionControl.setPrefix('<a href="https://github.com/tomchadwin/qgis2web" target="_blank">qgis2web</a> · <a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a> · <a href="https://qgis.org">QGIS</a>');
var bounds_group = new L.featureGroup([]);
function setBounds() {
}
var layer_OpenStreetMap_0 = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
opacity: 1.0,
attribution: '© OpenStreetMap contributors',
minZoom: 9,
maxZoom: 17,
minNativeZoom: 0,
maxNativeZoom: 19
});
layer_OpenStreetMap_0;
map.addLayer(layer_OpenStreetMap_0);
function pop_0SPRMSPbaseSubprefeituras_1(feature, layer) {
layer.on({
mouseout: function(e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
},
mouseover: highlightFeature,
});
var popupContent = '<table>\
<tr>\
<td colspan="1"><strong>Subprefeitura</strong><br />' + (feature.properties['Subprefeitura'] !== null ? Autolinker.link(feature.properties['Subprefeitura'].toLocaleString(), {truncate: {length: 30, location: 'smart'}}) : '') + '</td>\
</tr>\
<tr>\
<td colspan="1"><strong>Instagram</strong><br />' + (feature.properties['Instagram'] !== null ? Autolinker.link(feature.properties['Instagram'].toLocaleString(), {truncate: {length: 60, location: 'smart'}}) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_0SPRMSPbaseSubprefeituras_1_0() {
return {
pane: 'pane_0SPRMSPbaseSubprefeituras_1',
opacity: 1,
color: 'rgba(35,35,35,0.5)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 1.0,
fill: true,
fillOpacity: 1,
fillColor: 'rgba(192,192,192,0.5)',
interactive: true,
}
}
map.createPane('pane_0SPRMSPbaseSubprefeituras_1');
map.getPane('pane_0SPRMSPbaseSubprefeituras_1').style.zIndex = 401;
map.getPane('pane_0SPRMSPbaseSubprefeituras_1').style['mix-blend-mode'] = 'normal';
var layer_0SPRMSPbaseSubprefeituras_1 = new L.geoJson(json_0SPRMSPbaseSubprefeituras_1, {
attribution: '',
interactive: true,
dataVar: 'json_0SPRMSPbaseSubprefeituras_1',
layerName: 'layer_0SPRMSPbaseSubprefeituras_1',
pane: 'pane_0SPRMSPbaseSubprefeituras_1',
onEachFeature: pop_0SPRMSPbaseSubprefeituras_1,
style: style_0SPRMSPbaseSubprefeituras_1_0,
});
bounds_group.addLayer(layer_0SPRMSPbaseSubprefeituras_1);
map.addLayer(layer_0SPRMSPbaseSubprefeituras_1);
function pop_0SPRMSPbaseRMSP_2(feature, layer) {
layer.on({
mouseout: function(e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
},
mouseover: highlightFeature,
});
var popupContent = '<table>\
<tr>\
<td colspan="2">' + (feature.properties['fid'] !== null ? Autolinker.link(feature.properties['fid'].toLocaleString(), {truncate: {length: 30, location: 'smart'}}) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['Nome'] !== null ? Autolinker.link(feature.properties['Nome'].toLocaleString(), {truncate: {length: 30, location: 'smart'}}) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + (feature.properties['Lei'] !== null ? Autolinker.link(feature.properties['Lei'].toLocaleString(), {truncate: {length: 30, location: 'smart'}}) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_0SPRMSPbaseRMSP_2_0() {
return {
pane: 'pane_0SPRMSPbaseRMSP_2',
opacity: 1,
color: 'rgba(35,35,35,1.0)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 1.0,
fillOpacity: 0,
interactive: false,
}
}
map.createPane('pane_0SPRMSPbaseRMSP_2');
map.getPane('pane_0SPRMSPbaseRMSP_2').style.zIndex = 402;
map.getPane('pane_0SPRMSPbaseRMSP_2').style['mix-blend-mode'] = 'normal';
var layer_0SPRMSPbaseRMSP_2 = new L.geoJson(json_0SPRMSPbaseRMSP_2, {
attribution: '',
interactive: false,
dataVar: 'json_0SPRMSPbaseRMSP_2',
layerName: 'layer_0SPRMSPbaseRMSP_2',
pane: 'pane_0SPRMSPbaseRMSP_2',
onEachFeature: pop_0SPRMSPbaseRMSP_2,
style: style_0SPRMSPbaseRMSP_2_0,
});
bounds_group.addLayer(layer_0SPRMSPbaseRMSP_2);
map.addLayer(layer_0SPRMSPbaseRMSP_2);
var osmGeocoder = new L.Control.Geocoder({
collapsed: false,
position: 'topleft',
text: 'Search',
title: 'Testing'
}).addTo(map);
document.getElementsByClassName('leaflet-control-geocoder-icon')[0]
.className += ' fa fa-search';
document.getElementsByClassName('leaflet-control-geocoder-icon')[0]
.title += 'Search for a place';
setBounds();
function pop_22centroscomunitrios_3(feature, layer) {
layer.on({
mouseout: function(e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
},
mouseover: highlightFeature,
});
var popupContent = '<table>\
<tr>\
<td colspan="2" style="text-align:center">' + '<b>' + (feature.properties['Nome'] !== null ? Autolinker.link(feature.properties['Nome'].toLocaleString(), {truncate: {length: 30, location: 'smart'}}) : '') + '</b>'+ '</td>\
</tr>\
<tr>\
<td colspan="2">' + 'Como chegar: ' + (feature.properties['Endereço'] !== null ? Autolinker.link('https://www.google.com/maps/dir/here/' + feature.properties['Endereço'].replace(/ /g, "+")+'/@'+layer.getLatLng().lat+','+layer.getLatLng().lng, {truncate: {length: 30, location: 'smart'}}) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + 'Site: ' + (feature.properties['Site'] !== null ? Autolinker.link(feature.properties['Site'].toLocaleString(), {truncate: {length: 50, location: 'smart'}}) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_22centroscomunitrios_3_0() {
return {
pane: 'pane_22centroscomunitrios_3',
radius: 8.0,
opacity: 1,
color: 'rgba(50,87,128,1.0)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 2.0,
fill: true,
fillOpacity: 1,
fillColor: 'rgba(104,167,239,1.0)',
interactive: true,
}
}
map.createPane('pane_22centroscomunitrios_3');
map.getPane('pane_22centroscomunitrios_3').style.zIndex = 403;
map.getPane('pane_22centroscomunitrios_3').style['mix-blend-mode'] = 'normal';
var layer_22centroscomunitrios_3 = new L.geoJson(json_22centroscomunitrios_3, {
attribution: '',
interactive: true,
dataVar: 'json_22centroscomunitrios_3',
layerName: 'layer_22centroscomunitrios_3',
pane: 'pane_22centroscomunitrios_3',
onEachFeature: pop_22centroscomunitrios_3,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.circleMarker(latlng, style_22centroscomunitrios_3_0(feature));
},
});
bounds_group.addLayer(layer_22centroscomunitrios_3);
map.addLayer(layer_22centroscomunitrios_3);
function pop_21associaesdebairro_4(feature, layer) {
layer.on({
mouseout: function(e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
},
mouseover: highlightFeature,
});
var popupContent = '<table>\
<tr>\
<td colspan="2" style="text-align:center">' + '<b>' + (feature.properties['Nome'] !== null ? Autolinker.link(feature.properties['Nome'].toLocaleString(), {truncate: {length: 30, location: 'smart'}}) : '') + '</b>'+ '</td>\
</tr>\
<tr>\
<td colspan="2">' + 'Como chegar: ' + (feature.properties['Endereço'] !== null ? Autolinker.link('https://www.google.com/maps/dir/here/' + feature.properties['Endereço'].replace(/ /g, "+")+'/@'+layer.getLatLng().lat+','+layer.getLatLng().lng, {truncate: {length: 30, location: 'smart'}}) : '') + '</td>\
</tr>\
<tr>\
<td colspan="2">' + 'Site: ' + (feature.properties['Site'] !== null ? Autolinker.link(feature.properties['Site'].toLocaleString(), {truncate: {length: 50, location: 'smart'}}) : '') + '</td>\
</tr>\
</table>';
layer.bindPopup(popupContent, {maxHeight: 400});
}
function style_21associaesdebairro_4_0() {
return {
pane: 'pane_21associaesdebairro_4',
radius: 8.0,
opacity: 1,
color: 'rgba(128,17,25,1.0)',
dashArray: '',
lineCap: 'butt',
lineJoin: 'miter',
weight: 2.0,
fill: true,
fillOpacity: 1,
fillColor: 'rgba(219,30,42,1.0)',
interactive: true,
}
}
map.createPane('pane_21associaesdebairro_4');
map.getPane('pane_21associaesdebairro_4').style.zIndex = 404;
map.getPane('pane_21associaesdebairro_4').style['mix-blend-mode'] = 'normal';
var layer_21associaesdebairro_4 = new L.geoJson(json_21associaesdebairro_4, {
attribution: '',
interactive: true,
dataVar: 'json_21associaesdebairro_4',
layerName: 'layer_21associaesdebairro_4',
pane: 'pane_21associaesdebairro_4',
onEachFeature: pop_21associaesdebairro_4,
pointToLayer: function (feature, latlng) {
var context = {
feature: feature,
variables: {}
};
return L.circleMarker(latlng, style_21associaesdebairro_4_0(feature));
},
});
bounds_group.addLayer(layer_21associaesdebairro_4);
map.addLayer(layer_21associaesdebairro_4);
var baseMaps = {};
L.control.layers(baseMaps,{'<img src="legend/21associaesdebairro_4.png" /> Associações de bairro': layer_21associaesdebairro_4,'<img src="legend/22centroscomunitrios_3.png" /> Centros comunitários': layer_22centroscomunitrios_3,'<img src="legend/0SPRMSPbaseRMSP_2.png" /> Região Metropolitana de São Paulo': layer_0SPRMSPbaseRMSP_2,'<img src="legend/0SPRMSPbaseSubprefeituras_1.png" /> Subprefeituras de São Paulo': layer_0SPRMSPbaseSubprefeituras_1},{collapsed:false}).addTo(map);
setBounds();
</script>
</div>
</body>
</html>