-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathungvar.html
551 lines (450 loc) · 20.6 KB
/
ungvar.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
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="images/my.ico">
<meta charset="UTF-8">
<title>UNGVÁR</title>
<script src="https://www.google.com/jsapi"> </script>
<script src="http://earth-api-samples.googlecode.com/svn/trunk/lib/kmldomwalk.js" type="text/javascript"> </script>
<script type="text/javascript">
var ge;
var map = null;
var tour = null;
google.load("earth", "1.x");
google.load("maps", "2.x");
function init() {
google.earth.createInstance('map3d', initCB, failureCB);
map = new GMap2(document.getElementById('map'));
}
function initCB(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
ge.getSun().setVisibility(true);
ge.getOptions().setAtmosphereVisibility(true);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
var la = ge.createLookAt('');
la.set(48.622236, 22.29823, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 35, 70, 100);
ge.getView().setAbstractView(la);
//NACTENI 3D MODELU
var link = ge.createLink('');
var href = 'http://www.timemachine.comuv.com/teatrabata.kmz'
link.setHref(href);
var networkLink = ge.createNetworkLink('');
networkLink.set(link, true, false);
ge.getFeatures().appendChild(networkLink);
var link = ge.createLink('');
var href = 'http://www.timemachine.comuv.com/furedi.kmz'
link.setHref(href);
var networkLink = ge.createNetworkLink('');
networkLink.set(link, true, false);
ge.getFeatures().appendChild(networkLink);
var link = ge.createLink('');
var href = 'http://www.timemachine.comuv.com/korona.kmz'
link.setHref(href);
var networkLink = ge.createNetworkLink('');
networkLink.set(link, true, false);
ge.getFeatures().appendChild(networkLink);
var link = ge.createLink('');
var href = 'http://www.timemachine.comuv.com/radiolekarna.kmz'
link.setHref(href);
var networkLink = ge.createNetworkLink('');
networkLink.set(link, true, false);
ge.getFeatures().appendChild(networkLink);
var link = ge.createLink('');
var href = 'http://www.timemachine.comuv.com/cars.kmz'
link.setHref(href);
var networkLink = ge.createNetworkLink('');
networkLink.set(link, true, false);
ge.getFeatures().appendChild(networkLink);
// kod pro zobrazeni prehledove mapy
google.earth.addEventListener(ge.getView(), 'viewchange', function(evt) {
map.clearOverlays();
var totalBounds = new GLatLngBounds();
// get the globe bounds (method 1)
var globeBounds = ge.getView().getViewportGlobeBounds();
var fakeBoundsCenter = null;
if (globeBounds) {
globeBounds.setNorth(Math.min(globeBounds.getNorth(), 85));
globeBounds.setSouth(Math.max(globeBounds.getSouth(), -85));
if (globeBounds.getEast() == 180 && globeBounds.getWest() == -180) {
fakeBoundsCenter = new GLatLng(0, 0);
var globeBoundsPolygon = new GPolygon([
new GLatLng(globeBounds.getNorth(), -179),
new GLatLng(globeBounds.getNorth(), 0),
new GLatLng(globeBounds.getNorth(), 179),
new GLatLng(globeBounds.getSouth(), 179),
new GLatLng(globeBounds.getSouth(), 0),
new GLatLng(globeBounds.getSouth(), -179),
new GLatLng(globeBounds.getNorth(), -179)],
'#0000ff', 2, 1.00,
'#0000ff', 0.25,
{ clickable: false });}
else {
var globeBoundsPolygon = new GPolygon([
new GLatLng(globeBounds.getNorth(), globeBounds.getWest()),
new GLatLng(globeBounds.getNorth(), globeBounds.getEast()),
new GLatLng(globeBounds.getSouth(), globeBounds.getEast()),
new GLatLng(globeBounds.getSouth(), globeBounds.getWest()),
new GLatLng(globeBounds.getNorth(), globeBounds.getWest())],
'#0000ff', 2, 1.00, '#0000ff', 0.25,
{ clickable: false });}
map.addOverlay(globeBoundsPolygon);
var polyBounds = globeBoundsPolygon.getBounds();
totalBounds.extend(polyBounds.getNorthEast());
totalBounds.extend(polyBounds.getSouthWest());
}
// hit test the corners (method 2)
var hitTestTL = ge.getView().hitTest(0, ge.UNITS_FRACTION, 0, ge.UNITS_FRACTION, ge.HIT_TEST_GLOBE);
var hitTestTR = ge.getView().hitTest(1, ge.UNITS_FRACTION, 0, ge.UNITS_FRACTION, ge.HIT_TEST_GLOBE);
var hitTestBR = ge.getView().hitTest(1, ge.UNITS_FRACTION, 1, ge.UNITS_FRACTION, ge.HIT_TEST_GLOBE);
var hitTestBL = ge.getView().hitTest(0, ge.UNITS_FRACTION, 1, ge.UNITS_FRACTION, ge.HIT_TEST_GLOBE);
// ensure that all hit tests succeeded (i.e. the viewport is 2d-mappable)
if (hitTestTL && hitTestTR && hitTestBL && hitTestBR) {
var hitTestBoundsPolygon = new GPolygon([
new GLatLng(hitTestTL.getLatitude(), hitTestTL.getLongitude()),
new GLatLng(hitTestTR.getLatitude(), hitTestTR.getLongitude()),
new GLatLng(hitTestBR.getLatitude(), hitTestBR.getLongitude()),
new GLatLng(hitTestBL.getLatitude(), hitTestBL.getLongitude()),
new GLatLng(hitTestTL.getLatitude(), hitTestTL.getLongitude())],
'#ff0000', 2, 1.00,
'#ff0000', 0.25,
{ clickable: false });
map.addOverlay(hitTestBoundsPolygon);
var polyBounds = hitTestBoundsPolygon.getBounds();
totalBounds.extend(polyBounds.getNorthEast());
totalBounds.extend(polyBounds.getSouthWest());
}
if (!totalBounds.isEmpty()) {
map.setCenter(fakeBoundsCenter ? fakeBoundsCenter : totalBounds.getCenter(),
map.getBoundsZoomLevel(totalBounds));
}
});
//NADMORSKA VYSKA
// listen to the click event on the globe and window
google.earth.addEventListener(ge.getWindow(), 'mousemove', function(event) {
var statusHTML = 'N/A';
if (event.getDidHitGlobe()) {
var latitude = event.getLatitude();
var longitude = event.getLongitude();
var groundAltitude = ge.getGlobe().getGroundAltitude(latitude, longitude);
if (groundAltitude) {
statusHTML = '<span style="color:#000; font-weight:bold;">' +
groundAltitude.toFixed(2) + ' m.n.m.</span>';
}
}
document.getElementById('ground-altitude').innerHTML = statusHTML;
});
//PROHLIDKA
var href = 'http://timemachine.comuv.com/tour1.kmz';
google.earth.fetchKml(ge, href, fetchCallback);
function fetchCallback(fetchedKml) {
// Alert if no KML was found at the specified URL.
if (!fetchedKml) {
setTimeout(function() {
alert('Bad or null KML');
}, 0);
return;
}
// Add the fetched KML into this Earth instance.
ge.getFeatures().appendChild(fetchedKml);
// Walk through the KML to find the tour object; assign to variable 'tour.'
walkKmlDom(fetchedKml, function() {
if (this.getType() == 'KmlTour') {
tour = this;
return false;
}
});
}
document.getElementById('installed-plugin-version').innerHTML =
ge.getPluginVersion().toString();
}
// konec funkce initCB
function failureCB(errorCode) {
}
function enterTour() {
if (!tour) {
alert('No tour found!');
return;
}
ge.getTourPlayer().setTour(tour);
}
function playTour() {
ge.getTourPlayer().play();
}
function pauseTour() {
ge.getTourPlayer().pause();
}
function resetTour() {
ge.getTourPlayer().reset();
}
function exitTour() {
// just like setBalloon(null)
ge.getTourPlayer().setTour(null);
}
//POLOSA ZAGRUZKI
setInterval(function() {
var streamingPercent = ge.getStreamingPercent();
var progressBar = document.getElementById('progress-bar');
if (streamingPercent == 100) {
// streaming complete, hide the progress bar
progressBar.style.backgroundColor = '#0a0';
progressBar.style.width = '180px';
} else {
// show the progress bar, max width is 180 as per the stylesheet
progressBar.style.backgroundColor = '#00f';
progressBar.style.width = (180 * streamingPercent / 100) + 'px';
}
}, 100);
function updateOptions() {
var options = ge.getOptions();
var form = document.options;
options.setStatusBarVisibility(form.statusbar.checked);
options.setGridVisibility(form.grid.checked);
options.setOverviewMapVisibility(form.overview.checked);
options.setScaleLegendVisibility(form.scaleLegend.checked);
}
//FUNKCE ZAPNOUT/VYPNOUT STINOVANI
function showSun() {
ge.getSun().setVisibility(true);
}
function hideSun() {
ge.getSun().setVisibility(false);
}
//FUNKCE ZPET NA MODEL
function naSouradnice() {
var lookAt = ge.createLookAt('');
lookAt.setLatitude(48.622236);
lookAt.setLongitude(22.29823);
lookAt.setRange(500.0);
ge.getView().setAbstractView(lookAt);
}
//NACTENI VSECH PLACEMARKU
function go() {
placemark1();
placemark2();
placemark3();
placemark4();
placemark5();
}
//PLACEMARK 1
function placemark1() {
var placemark = ge.createPlacemark('');
placemark.setDescription("<p><b>MĚSTSKÉ DIVADLO</b></p><p>Divadlo bylo postaveno v roce 1920.</p>");
var point = ge.createPoint('');
point.setLatitude(48.622141);
point.setLongitude(22.298448);
placemark.setGeometry(point);
var styleMap = ge.createStyleMap('');
var normalStyle = ge.createStyle('');
var normalIcon = ge.createIcon('');
normalIcon.setHref('http://maps.google.com/mapfiles/ms/micons/arts.png');
normalStyle.getIconStyle().setIcon(normalIcon);
var highlightStyle = ge.createStyle('');
var highlightIcon = ge.createIcon('');
highlightIcon.setHref('http://maps.google.com/mapfiles/ms/micons/arts.png');
highlightStyle.getIconStyle().setIcon(highlightIcon);
highlightStyle.getIconStyle().setScale(1.5);
styleMap.setNormalStyle(normalStyle);
styleMap.setHighlightStyle(highlightStyle);
placemark.setStyleSelector(styleMap);
ge.getFeatures().appendChild(placemark);
}
//PLACEMARK 2
function placemark2() {
var placemark = ge.createPlacemark('');
placemark.setDescription("<p><b>BAŤŮV PALÁC</p></b><p>Baťův palác byl postaven v roce 1929 podle návrhu architekta Josefa Gočára. V prvním patře se nacházely obuvní obchody, kde se také prodávaly pneumatiky. V druhém patře byly obuvní opravovány. Ve třetím patře se nacházely pedikúrové salony, které byly tzv. know-how Tomáše Baťi, který prohlašoval, že mezi peče o nohy nepatří jen obuvnictví ale i pedikúra jako základ zdrávi noh obyvatelstva. Díla Josefa Gočáre především z kubistického a funkcionalistického období patří k vrcholům české moderní architektury. Mezí další významná Gočarová díla patří kubistický Dům U Černé Matky Boží a Legiobanka v rondokubistickém slohu v Praze, ale také i budova pošty v Užhorodě.</p><br>");
var point = ge.createPoint('');
point.setLatitude(48.622302);
point.setLongitude(22.298678);
placemark.setGeometry(point);
var styleMap = ge.createStyleMap('');
var normalStyle = ge.createStyle('');
var normalIcon = ge.createIcon('');
normalIcon.setHref('http://maps.google.com/mapfiles/kml/pal4/icon39.png');
normalStyle.getIconStyle().setIcon(normalIcon);
var highlightStyle = ge.createStyle('');
var highlightIcon = ge.createIcon('');
highlightIcon.setHref('http://maps.google.com/mapfiles/kml/pal4/icon39.png');
highlightStyle.getIconStyle().setIcon(highlightIcon);
highlightStyle.getIconStyle().setScale(1.5);
styleMap.setNormalStyle(normalStyle);
styleMap.setHighlightStyle(highlightStyle);
placemark.setStyleSelector(styleMap);
ge.getFeatures().appendChild(placemark);
}
//PLACEMARK 3
function placemark3() {
var placemark = ge.createPlacemark('');
placemark.setDescription("<p><b>RESTAURACE A CUKRÁRNY</p></b><p>Zbořeny po druhé světové válce.</p>");
var point = ge.createPoint('');
point.setLatitude(48.622211);
point.setLongitude(22.298271);
placemark.setGeometry(point);
var styleMap = ge.createStyleMap('');
var normalStyle = ge.createStyle('');
var normalIcon = ge.createIcon('');
normalIcon.setHref('http://maps.google.com/mapfiles/kml/pal2/icon55.png');
normalStyle.getIconStyle().setIcon(normalIcon);
var highlightStyle = ge.createStyle('');
var highlightIcon = ge.createIcon('');
highlightIcon.setHref('http://maps.google.com/mapfiles/kml/pal2/icon55.png');
highlightStyle.getIconStyle().setIcon(highlightIcon);
highlightStyle.getIconStyle().setScale(1.5);
styleMap.setNormalStyle(normalStyle);
styleMap.setHighlightStyle(highlightStyle);
placemark.setStyleSelector(styleMap);
ge.getFeatures().appendChild(placemark);
google.earth.addEventListener(placemark, 'click', function(event) {
// prevent the default balloon from popping up
event.preventDefault();
var balloon = ge.createHtmlStringBalloon('');
balloon.setFeature(placemark); // optional
balloon.setMaxWidth(500);
// fotka a text
balloon.setContentString(
'<img src="http://timemachine.comuv.com/Teatral.jpg"><br>'
+ '<font size=10>Restaurace a cukrárny</font><br><font size=3>Domy byly zbořeny po druhé světové válce</font>'
);
ge.setBalloon(balloon);
});
}
//PLACEMARK 4
function placemark4() {
var placemark = ge.createPlacemark('');
var point = ge.createPoint('');
point.setLatitude(48.62233);
point.setLongitude(22.298442);
placemark.setGeometry(point);
var styleMap = ge.createStyleMap('');
var normalStyle = ge.createStyle('');
var normalIcon = ge.createIcon('');
normalIcon.setHref('http://maps.google.com/mapfiles/kml/shapes/movies.png');
normalStyle.getIconStyle().setIcon(normalIcon);
var highlightStyle = ge.createStyle('');
var highlightIcon = ge.createIcon('');
highlightIcon.setHref('http://maps.google.com/mapfiles/kml/shapes/movies.png');
highlightStyle.getIconStyle().setIcon(highlightIcon);
highlightStyle.getIconStyle().setScale(1.5);
styleMap.setNormalStyle(normalStyle);
styleMap.setHighlightStyle(highlightStyle);
placemark.setStyleSelector(styleMap);
// add the placemark to the earth DOM
ge.getFeatures().appendChild(placemark);
google.earth.addEventListener(placemark, 'click', function(event) {
// prevent the default balloon from popping up
event.preventDefault();
var balloon = ge.createHtmlStringBalloon('');
balloon.setFeature(placemark); // optional
balloon.setMaxWidth(500);
// YouTube video embed... the in the beginning is a fix for IE6
balloon.setContentString(
' <object width="420" height="315"><param name="movie" '
+ 'value="http://www.youtube.com/v/pZUdEE4yfqs?hl=cs_CZ&"/>'
+ '<param name="allowFullScreen" value="true"/>'
+ '<embed src="http://www.youtube.com/v/pZUdEE4yfqs?hl=cs_CZ&" '
+ 'type="application/x-shockwave-flash" allowfullscreen="true" '
+ 'width="420" height="315"></embed></object>');
ge.setBalloon(balloon);
});
}
//PLACEMARK 5
function placemark5() {
var placemark = ge.createPlacemark('');
var point = ge.createPoint('');
point.setLatitude(48.622208);
point.setLongitude(22.298386);
placemark.setGeometry(point);
var styleMap = ge.createStyleMap('');
var normalStyle = ge.createStyle('');
var normalIcon = ge.createIcon('');
normalIcon.setHref('http://maps.google.com/mapfiles/kml/shapes/movies.png');
normalStyle.getIconStyle().setIcon(normalIcon);
var highlightStyle = ge.createStyle('');
var highlightIcon = ge.createIcon('');
highlightIcon.setHref('http://maps.google.com/mapfiles/kml/shapes/movies.png');
highlightStyle.getIconStyle().setIcon(highlightIcon);
highlightStyle.getIconStyle().setScale(1.5);
styleMap.setNormalStyle(normalStyle);
styleMap.setHighlightStyle(highlightStyle);
placemark.setStyleSelector(styleMap);
// add the placemark to the earth DOM
ge.getFeatures().appendChild(placemark);
google.earth.addEventListener(placemark, 'click', function(event) {
// prevent the default balloon from popping up
event.preventDefault();
var balloon = ge.createHtmlStringBalloon('');
balloon.setFeature(placemark); // optional
balloon.setMaxWidth(500);
// YouTube video embed... the in the beginning is a fix for IE6
balloon.setContentString(
' <object width="420" height="315"><param name="movie" '
+ 'value="http://www.youtube.com/v/SY4hQOcU9io?version=3&"/>'
+ '<param name="allowFullScreen" value="true"/>'
+ '<embed src="http://www.youtube.com/v/SY4hQOcU9io?version=3&" '
+ 'type="application/x-shockwave-flash" allowfullscreen="true" '
+ 'width="420" height="315"></embed></object>');
ge.setBalloon(balloon);
});}
google.setOnLoadCallback(init);
</script>
<link rel="stylesheet" type="text/css" href="style.css" >
</head>
<body>
<div id="shapka" class="header">VÍTEJTE NA STRÁNCE STARÉHO UŽHORODU</div>
<div id="1-kolonka" class="col-left">
<div class="padding10">
<p class="textLeft">Pohybováním s jezdcem nastavíte optimální osvětlení. Tímto zastavíte blikání zeleného pruhu po nahraní modelu</p>
<input type="button" value="Zpět na 3D model" onclick='naSouradnice()' />
<div id="options_container">
<form name="options" action='javascript:updateOptions();'>
<p><input type="checkbox" id="lista" onclick='updateOptions()' name="statusbar" />
<label for="lista" class="opt">Info lišta</label></p>
<p><input type="checkbox" id="sit" onclick='updateOptions()' name="grid" />
<label for="sit" class="opt">Zeměpisná síť</label></p>
<p><input type="checkbox" id="mapka" onclick='updateOptions()' name="overview" />
<label for="mapka" class="opt">Přehledová mapa</label></p>
<p><input type="checkbox" id="meitko" onclick='updateOptions()' name="scaleLegend" />
<label for="meritko" class="opt">Měřítko</label></p>
</form>
</div>
<form name="placemarks">
<p><input type="checkbox" id="pins" onclick="go()"/>
<label for"popisky" id="label1" class="clbc1">Informace o budovách</label>
<label class="clbc1">(vypnutí ikon není zatím funkční, proto pro jejich odstranění prosím zmáčkněte F5)</label></p>
<p><input type="button" value="Vypnout stínování" id="show-sun" onclick='hideSun()'/></p>
<p><input type="button" value="Zapnout stínování" id="show-sun" onclick='showSun()'/></p>
<p class="textLeft">Udělejte si prohlídku starým městem</p>
<p><input type="button" value="Enter Tour" onclick='enterTour()'/><input type="button" value="Exit Tour" onclick='exitTour()'/></p>
<p><input type="button" value="Play" onclick='playTour()'/><input type="button" value="Pause" onclick='pauseTour()'/></p>
<p><input type="button" value="Stop/Reset" onclick='resetTour()'/></p>
</form>
<div class="omodelu">
<p>Autor modelu:<br>Pavlo Kryshenyk<br>Univerzita Karlova v Praze</p>
</div>
</div>
</div>
<div class="col-cent"><div id="map3d"></div></div>
<div id="3-kolonka" class="col-right">
<div class="padding10">
<p class="nahr">Nahráváni vrstev může trvat delší dobu, počkejte prosím až se načte celý model.</p>
<div id="progress-container"><div id="progress-bar"></div></div><br/>
<p class="textLeft">Naveďte kurzor na určitý bod a uvidíte jeho nadmořskou výšku</p>
<div class="clbc1">
<p>Nadmořská výška:<br><span id="ground-altitude">N/A</span></p>
<div id="map" style="width: 180px; height: 180px;"></div>
<p class="textLeft">Minimální hardwarové požadavky:</p>
<p class="textLeft">Intel Pentium 3 1GHz, 1GB RAM, rychlost připojení 512kbit/s, grafická karta s 128 MB paměti kompatibilní s rozhraním DirectX</p>
<p class="textLeft">Doporučené hardwarové požadavky:</p>
<p class="textLeft">Intel Pentium 4 2,4 GHz nebo Athlon 2400 +, 2GB RAM, rychlost připojení 1 Mbit/s, grafická karta s 256 MB paměti kompatibilní s rozhraním DirectX</p>
<div><p class="links">Stránka pro milovníky starého Užhorodu</p>
<!-- oldUngvar banner -->
<a target="_blank" HREF="http://ungvar.vox.com.ua"><img SRC="http://ungvar.vox.com.ua/img/but/oldUngvar-88x31.gif" width="88" height="31" border="0" title="oldUngvar - Užhorod ve starých pohlednicich"></a>
</div>
</div>
</div>
</div>
<div id="podval" class="footer">
<p class="clbc1">© 2013 Pavlo Kryshenyk</p>
</div>
</body>
</html>