-
Notifications
You must be signed in to change notification settings - Fork 0
/
map2.html
405 lines (351 loc) · 12.5 KB
/
map2.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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.2/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.2/mapbox-gl.css' rel='stylesheet' />
<script src="jquery-2.1.4.min.js"></script>
<script src="diffWidget.js"></script>
<link rel="stylesheet" href="style3.css" />
</head>
<body>
<nav class="horizontal">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="colonias.html">Explorador de colonias</a></li>
<li><a href="registro.html">Subir historia</a></li>
<li><a href="tutorial/tutorial.html">Tutorial</a></li>
</ul>
</nav>
<div id='map'></div>
<div id='features'>
<h1>Colonia Juárez</h1>
<section id='baker' class='active'>
<h3>Barcelona #24</h3>
<p>lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom</p>
<div id="ex1">
<table>
<tr> <th>Transformación:</th><td>Renovación alta</td> </tr>
<tr> <th>Dirección:</th><td>Barcelona #24</td> </tr>
<tr> <th>Foto inicial:</th><td>2008</td> <th>Foto final:</th><td>2014</td> </tr>
</table>
</div>
<div id="texto-derecha">
<table>
<tr> <th>Espacio Público</th><td>presente</td> </tr>
<tr> <th>Movilidad</th><td>presente</td> </tr>
<tr> <th>Nuevas construcciones para la clase alta</th><td>presente</td> </tr>
<tr> <th>Incremento en la altura del inmueble</th><td>presente</td> </tr>
<tr> <th>Presencia de dispositivos de seguridad</th><td>presente</td> </tr>
<tr> <th>Signos de presencia de alguna</p> cultura extranjera:</th><td>ausente</td> </tr>
<tr> <th>Embellecimiento de la fachada:</th><td>presente</td> </tr>
<tr> <th>Cambio de uso de suelo:</th><td>presente</td> </tr>
</table>
</div>
</section>
<section id='aldgate'>
<h3>Roma #14</h3>
<p>lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom</p>
<div id="ex2">
<table>
<tr> <th>Transformación:</th><td>Renovación media</td> </tr>
<tr> <th>Dirección:</th><td>Roma #14</td> </tr>
<tr> <th>Foto inicial:</th><td>2009</td> <th>Foto final:</th><td>2014</td> </tr>
</table>
</div>
<div id="texto-derecha">
<table>
<tr> <th>Espacio Público</th><td>ausente</td> </tr>
<tr> <th>Movilidad</th><td>ausente</td> </tr>
<tr> <th>Nuevas construcciones para la clase alta</th><td>ausente</td> </tr>
<tr> <th>Incremento en la altura del inmueble</th><td>ausente</td> </tr>
<tr> <th>Presencia de dispositivos de seguridad</th><td>ausente</td> </tr>
<tr> <th>Signos de presencia de alguna cultura extranjera:</th><td>presente</td> </tr>
<tr> <th>Embellecimiento de la fachada:</th><td>presente</td> </tr>
<tr> <th>Cambio de uso de suelo:</th><td>presente</td> </tr>
</table>
</div>
</section>
<section id='london-bridge'>
<h3>Lucerna #72</h3>
<p>lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom</p>
<div id="ex3">
<table>
<tr> <th>Transformación:</th><td>Renovación ligera</td> </tr>
<tr> <th>Dirección:</th><td>Lucerna #72</td> </tr>
<tr> <th>Foto inicial:</th><td>2011</td> <th>Foto final:</th><td>2015</td> </tr>
</table>
</div>
<div id="texto-derecha">
<table>
<tr> <th>Espacio Público</th><td>presente</td> </tr>
<tr> <th>Movilidad</th><td>presente</td> </tr>
<tr> <th>Nuevas construcciones para la clase alta</th><td>ausente</td> </tr>
<tr> <th>Incremento en la altura del inmueble</th><td>ausente</td> </tr>
<tr> <th>Presencia de dispositivos de seguridad</th><td>ausente</td> </tr>
<tr> <th>Signos de presencia de alguna cultura extranjera:</th><td>ausente</td> </tr>
<tr> <th>Embellecimiento de la fachada:</th><td>presente</td> </tr>
<tr> <th>Cambio de uso de suelo:</th><td>ausente</td> </tr>
</table>
</div>
</section>
<section id='woolwich'>
<h3>Lisboa #49</h3>
<p>lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom</p>
<div id="ex4">
<table>
<tr> <th>Transformación:</th><td>Deteriro fuerte</td> </tr>
<tr> <th>Dirección:</th><td>Lisboa #49</td> </tr>
<tr> <th>Foto inicial:</th><td>2009</td> <th>Foto final:</th><td>2014</td> </tr>
</table>
</div>
<div id="texto-derecha">
<table>
<tr> <th>Deterioro Espacio Público</th><td>ausente</td> </tr>
<tr> <th>Demolición parcial o total del inmueble</th><td>presente</td> </tr>
<tr> <th>Vandalización del inmueble</th><td>presente</td> </tr>
<tr> <th>Desaparición de negocios</th><td>presente</td> </tr>
</table>
</div>
</section>
<section id='gloucester'>
<h3>Lisboa #40</h3>
<p>lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom</p>
<div id="ex5">
<table>
<tr> <th>Transformación:</th><td>Deterioro medio</td> </tr>
<tr> <th>Dirección:</th><td>Lisboa #40</td> </tr>
<tr> <th>Foto inicial:</th><td>2008</td> <th>Foto final:</th><td>2015</td> </tr>
</table>
</div>
<div id="texto-derecha">
<table>
<tr> <th>Deterioro Espacio Público</th><td>presente</td> </tr>
<tr> <th>Demolición parcial o total del inmueble</th><td>presente</td> </tr>
<tr> <th>Vandalización del inmueble</th><td>presente</td> </tr>
<tr> <th>Desaparición de negocios</th><td>presente</td> </tr>
</table>
</div>
</section>
<section id='caulfield-gardens'>
<h3>Abraham Gonzalez #82</h3>
<p>lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom lorem impusiom</p>
<div id="ex6">
<table>
<tr> <th>Transformación:</th><td>Deterioro fuerte</td> </tr>
<tr> <th>Dirección:</th><td>Abraham Gonzalez #82</td> </tr>
<tr> <th>Foto inicial:</th><td>2009</td> <th>Foto final:</th><td>2015</td> </tr>
</table>
</div>
<div id="texto-derecha">
<table>
<tr> <th>Deterioro Espacio Público</th><td>ausente</td> </tr>
<tr> <th>Demolición parcial o total del inmueble</th><td>presente</td> </tr>
<tr> <th>Vandalización del inmueble</th><td>ausente</td> </tr>
<tr> <th>Desaparición de negocios</th><td>presente</td> </tr>
</table>
</div>
</section>
<section id='charing-cross'>
<h3>Subido por:</h3>
<p>Arturo Cadena</p>
<small id="citation">
Adapted from Mapbox GL</a>
</small>
</section>
</div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoiYWNhZGhlIiwiYSI6IllHYWhiSUEifQ.al-_5fA7j3QPv54YJSTyOQ';
if (!mapboxgl.supported()) {
alert('Your browser does not support Mapbox GL, please update the last version or open it in Chrome or Safari');
} else {
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/satellite-v8',
center: [-99.1569565, 19.4280902],
zoom: 15.5,
bearing: 27,
pitch: 45
}); }
var chapters = {
'baker': {
bearing: 27,
center: [-99.1569565, 19.4280902],
zoom: 19.5,
pitch: 20
},
'aldgate': {
duration: 6000,
center: [-99.158939, 19.4290865],
bearing: 150,
zoom: 17.5,
pitch: 0
},
'london-bridge': {
bearing: 90,
center: [-99.1594879, 19.4301614],
zoom: 17.5,
speed: 0.6,
pitch: 40
},
'woolwich': {
bearing: 90,
center: [-99.1583296, 19.4292419],
zoom: 17.5
},
'gloucester': {
bearing: 45,
center: [-99.1580997, 19.4296886],
zoom: 17.5,
pitch: 20,
speed: 0.5
},
'caulfield-gardens': {
bearing: 180,
center: [-99.156391, 19.4284789],
zoom: 17.5
},
'charing-cross': {
bearing: 90,
center: [-99.1569565, 19.4280902],
zoom: 17.5,
pitch: 20
}
};
// On every scroll event, check which element is on screen
window.onscroll = function() {
var chapterNames = Object.keys(chapters);
for (var i = 0; i < chapterNames.length; i++) {
var chapterName = chapterNames[i];
if (isElementOnScreen(chapterName)) {
setActiveChapter(chapterName);
break;
}
}
};
var activeChapterName = 'baker';
function setActiveChapter(chapterName) {
if (chapterName === activeChapterName) return;
map.flyTo(chapters[chapterName]);
document.getElementById(chapterName).setAttribute('class', 'active');
document.getElementById(activeChapterName).setAttribute('class', '');
activeChapterName = chapterName;
}
function isElementOnScreen(id) {
var element = document.getElementById(id);
var bounds = element.getBoundingClientRect();
return bounds.top < window.innerHeight && bounds.bottom > 0;
}
var markers = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"description": "<h1>Holi</h1>",
"marker-symbol": "theatre"
},
"geometry": {
"type": "Point",
"coordinates": [-99.1569565, 19.4280902]
}
},
{
"type": "Feature",
"properties": {
"description": "<h1>Holi</h1>",
"marker-symbol": "theatre"
},
"geometry": {
"type": "Point",
"coordinates": [-0.07571203, 51.51424049]
}
}
]
};
map.on('style.load', function () {
// Add marker data as a new GeoJSON source.
map.addSource("markers", {
"type": "geojson",
"data": markers
});
// Add a layer showing the markers.
map.addLayer({
"id": "markers",
"interactive": true,
"type": "symbol",
"source": "markers",
"layout": {
"icon-image": "{marker-symbol}-1ma5",
}
});
});
// When a click event occurs near a marker icon, open a popup at the location of
// the feature, with description HTML from its properties.
map.on('click', function (e) {
map.featuresAt(e.point, {layer: 'markers', radius: 10, includeGeometry: true}, function (err, features) {
if (err || !features.length)
return;
var feature = features[0];
new mapboxgl.Popup()
.setLngLat(feature.geometry.coordinates)
.setHTML(feature.properties.description)
.addTo(map);
});
});
// Use the same approach as above to indicate that the symbols are clickable
// by changing the cursor style to 'pointer'.
map.on('mousemove', function (e) {
map.featuresAt(e.point, {layer: 'markers', radius: 10}, function (err, features) {
map.getCanvas().style.cursor = (!err && features.length) ? 'pointer' : '';
});
});
// Div widget
$(document).ready(function(){
$('#ex1').diffWidget({
'width': '100%',
'height': '100%',
'top': 'images/bcn_1.png',
'bottom': 'images/bcn_2.png',
'position': '100%'
});
$('#ex2').diffWidget({
'width': '100%',
'height': '100%',
'top': 'images/bar_1.png',
'bottom': 'images/bar_2.png',
'position': '100%'
});
$('#ex3').diffWidget({
'width': '550px',
'height': '100%',
'top': 'images/pape_1.png',
'bottom': 'images/pape_2.png',
'position': '100%'
});
$('#ex4').diffWidget({
'width': '550px',
'height': '100%',
'top': 'images/rosa_1.png',
'bottom': 'images/rosa_2.png',
'position': '100%'
});
$('#ex5').diffWidget({
'width': '550px',
'height': '100%',
'top': 'images/copias_1.png',
'bottom': 'images/copias_2.png',
'position': '100%'
});
$('#ex6').diffWidget({
'width': '550px',
'height': '100%',
'top': 'images/venta_1.png',
'bottom': 'images/venta_2.png',
'position': '100%'
});
});
</script>
</body>
</html>