Completed
Push — master ( 11bd0c...7bafef )
by Yannick
32:18
created
js/map.3d.js.php 1 patch
Braces   +46 added lines, -14 removed lines patch added patch discarded remove patch
@@ -5,21 +5,30 @@  discard block
 block discarded – undo
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' && $MapType != 'offline' && $MapType != 'ArcGIS-Streetmap' && $MapType != 'ArcGIS-Satellite' && $MapType != 'NatGeo-Street') {
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, ' +
@@ -147,13 +156,23 @@  discard block
 block discarded – undo
147 156
 */
148 157
 ?>
149 158
 <?php
150
-	}  elseif (isset($globalMapCustomLayer[$MapType])) {
159
+	} elseif (isset($globalMapCustomLayer[$MapType])) {
151 160
 		$customid = $MapType;
152 161
 ?>
153 162
 	var imProv = Cesium.createOpenStreetMapImageryProvider({
154 163
 		url : '<?php print $globalMapCustomLayer[$customid]['url']; ?>',
155
-		maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) print $globalMapCustomLayer[$customid]['maxZoom']; else print '99'; ?>,
156
-		minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) print $globalMapCustomLayer[$customid]['minZoom']; else print '0'; ?>,
164
+		maximumLevel: <?php if (isset($globalMapCustomLayer[$customid]['maxZoom'])) {
165
+	print $globalMapCustomLayer[$customid]['maxZoom'];
166
+} else {
167
+	print '99';
168
+}
169
+?>,
170
+		minimumLevel: <?php if (isset($globalMapCustomLayer[$customid]['minZoom'])) {
171
+	print $globalMapCustomLayer[$customid]['minZoom'];
172
+} else {
173
+	print '0';
174
+}
175
+?>,
157 176
 		credit: '<?php print $globalMapCustomLayer[$customid]['attribution']; ?>'
158 177
 	});
159 178
 <?php
@@ -458,7 +477,12 @@  discard block
 block discarded – undo
458 477
 //    }),
459 478
     timeline : archive,
460 479
     animation : false,
461
-    shadows : <?php if ((isset($globalMap3DShadows) && $globalMap3DShadows === FALSE) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'true')) print 'false'; else print 'true'; ?>,
480
+    shadows : <?php if ((isset($globalMap3DShadows) && $globalMap3DShadows === FALSE) || (isset($_COOKIE['map3dnoshadows']) && $_COOKIE['map3dnoshadows'] == 'true')) {
481
+	print 'false';
482
+} else {
483
+	print 'true';
484
+}
485
+?>,
462 486
 //    selectionIndicator : false,
463 487
     infoBox : false,
464 488
     navigationHelpButton : false,
@@ -481,8 +505,11 @@  discard block
 block discarded – undo
481 505
 	if (isset($_COOKIE['lastcentercoord']) || (isset($globalCenterLatitude) && isset($globalCenterLongitude) && $globalCenterLatitude != '' && $globalCenterLongitude != '')) {
482 506
 		if (isset($_COOKIE['lastcentercoord'])) {
483 507
 			$lastcentercoord = explode(',',$_COOKIE['lastcentercoord']);
484
-			if (!isset($lastcentercoord[3])) $zoom = $lastcentercoord[2]*1000000.0;
485
-			else $zoom = $lastcentercoord[3];
508
+			if (!isset($lastcentercoord[3])) {
509
+				$zoom = $lastcentercoord[2]*1000000.0;
510
+			} else {
511
+				$zoom = $lastcentercoord[3];
512
+			}
486 513
 			$viewcenterlatitude = $lastcentercoord[0];
487 514
 			$viewcenterlongitude = $lastcentercoord[1];
488 515
 		} else {
@@ -604,7 +631,12 @@  discard block
 block discarded – undo
604 631
 ?>
605 632
 
606 633
 update_locationsLayer();
607
-setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>);
634
+setInterval(function(){update_locationsLayer()},<?php if (isset($globalMapRefresh)) {
635
+	print $globalMapRefresh*1000*2;
636
+} else {
637
+	print '60000';
638
+}
639
+?>);
608 640
 /*
609 641
 var handlera = new Cesium.ScreenSpaceEventHandler(viewer.canvas, false);
610 642
 handlera.setInputAction(
Please login to merge, or discard this patch.