@@ -413,7 +413,7 @@ |
||
413 | 413 | <?php |
414 | 414 | if (isset($_COOKIE['lastcentercoord']) || (isset($globalCenterLatitude) && isset($globalCenterLongitude) && $globalCenterLatitude != '' && $globalCenterLongitude != '')) { |
415 | 415 | if (isset($_COOKIE['lastcentercoord'])) { |
416 | - $lastcentercoord = explode(',',$_COOKIE['lastcentercoord']); |
|
416 | + $lastcentercoord = explode(',', $_COOKIE['lastcentercoord']); |
|
417 | 417 | if (!isset($lastcentercoord[3])) $zoom = $lastcentercoord[2]*1000000.0; |
418 | 418 | else $zoom = $lastcentercoord[3]; |
419 | 419 | $viewcenterlatitude = $lastcentercoord[0]; |
@@ -5,21 +5,30 @@ discard block |
||
5 | 5 | |
6 | 6 | document.cookie = 'MapFormat=3d; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
7 | 7 | <?php |
8 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
9 | - else $MapType = $globalMapProvider; |
|
8 | + if (isset($_COOKIE['MapType'])) { |
|
9 | + $MapType = $_COOKIE['MapType']; |
|
10 | + } else { |
|
11 | + $MapType = $globalMapProvider; |
|
12 | + } |
|
10 | 13 | |
11 | 14 | // unset($_COOKIE['MapType']); |
12 | 15 | if ($MapType != 'Mapbox' && $MapType != 'OpenStreetMap' && $MapType != 'Bing-Aerial' && $MapType != 'Bing-Hybrid' && $MapType != 'Bing-Road') { |
13 | - if (isset($globalBingMapKey) && $globalBingMapKey != '') $MapType = 'Bing-Aerial'; |
|
14 | - else $MapType = 'OpenStreetMap'; |
|
16 | + if (isset($globalBingMapKey) && $globalBingMapKey != '') { |
|
17 | + $MapType = 'Bing-Aerial'; |
|
18 | + } else { |
|
19 | + $MapType = 'OpenStreetMap'; |
|
20 | + } |
|
15 | 21 | } |
16 | 22 | if (($MapType == 'Bing-Aerial' || $MapType == 'Bing-Hybrid' || $MapType == 'Bing-Road') && (!isset($globalBingMapKey) || $globalBingMapKey == '')) { |
17 | 23 | $MapType = 'OpenStreetMap'; |
18 | 24 | } |
19 | 25 | if ($MapType == 'Mapbox') { |
20 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
21 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
22 | -?> |
|
26 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
27 | + $MapBoxId = $globalMapboxId; |
|
28 | + } else { |
|
29 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
30 | + } |
|
31 | + ?> |
|
23 | 32 | var imProv = Cesium.MapboxImageryProvider({ |
24 | 33 | credit: 'Map data © OpenStreetMap contributors, ' + |
25 | 34 | 'CC-BY-SA, ' + |
@@ -124,13 +133,23 @@ discard block |
||
124 | 133 | */ |
125 | 134 | ?> |
126 | 135 | <?php |
127 | - } elseif (isset($globalMapCustomLayer[$MapType])) { |
|
136 | + } elseif (isset($globalMapCustomLayer[$MapType])) { |
|
128 | 137 | $customid = $MapType; |
129 | 138 | ?> |
130 | 139 | var imProv = Cesium.createOpenStreetMapImageryProvider({ |
131 | 140 | url : '<?php print $globalMapCustomLayer[$customid]['url']; ?>', |
132 | - maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '99'; ?>, |
|
133 | - minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>, |
|
141 | + maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) { |
|
142 | + print $globalMapCustomLayer[$customid]['maxZoom']; |
|
143 | +} else { |
|
144 | + print '99'; |
|
145 | +} |
|
146 | +?>, |
|
147 | + minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) { |
|
148 | + print $globalMapCustomLayer[$customid]['minZoom']; |
|
149 | +} else { |
|
150 | + print '0'; |
|
151 | +} |
|
152 | +?>, |
|
134 | 153 | credit: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>' |
135 | 154 | }); |
136 | 155 | <?php |
@@ -414,8 +433,11 @@ discard block |
||
414 | 433 | if (isset($_COOKIE['lastcentercoord']) || (isset($globalCenterLatitude) && isset($globalCenterLongitude) && $globalCenterLatitude != '' && $globalCenterLongitude != '')) { |
415 | 434 | if (isset($_COOKIE['lastcentercoord'])) { |
416 | 435 | $lastcentercoord = explode(',',$_COOKIE['lastcentercoord']); |
417 | - if (!isset($lastcentercoord[3])) $zoom = $lastcentercoord[2]*1000000.0; |
|
418 | - else $zoom = $lastcentercoord[3]; |
|
436 | + if (!isset($lastcentercoord[3])) { |
|
437 | + $zoom = $lastcentercoord[2]*1000000.0; |
|
438 | + } else { |
|
439 | + $zoom = $lastcentercoord[3]; |
|
440 | + } |
|
419 | 441 | $viewcenterlatitude = $lastcentercoord[0]; |
420 | 442 | $viewcenterlongitude = $lastcentercoord[1]; |
421 | 443 | } else { |
@@ -517,7 +539,12 @@ discard block |
||
517 | 539 | } |
518 | 540 | |
519 | 541 | update_locationsLayer(); |
520 | -setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
542 | +setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) { |
|
543 | + print $globalMapRefresh*1000*2; |
|
544 | +} else { |
|
545 | + print '60000'; |
|
546 | +} |
|
547 | +?>); |
|
521 | 548 | /* |
522 | 549 | var handlera = new Cesium.ScreenSpaceEventHandler(viewer.canvas, false); |
523 | 550 | handlera.setInputAction( |