@@ -46,14 +46,20 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | public function handle() { |
| 48 | 48 | global $conf; |
| 49 | - if(!isset($_REQUEST['continue']) || !checkSecurityToken()) return; |
|
| 49 | + if(!isset($_REQUEST['continue']) || !checkSecurityToken()) { |
|
| 50 | + return; |
|
| 51 | + } |
|
| 50 | 52 | if(isset($_REQUEST['purgetiles'])) { |
| 51 | 53 | $path = $conf['cachedir'] . '/olmaptiles'; |
| 52 | - if($this->rrmdir($path)) msg($this->getLang('admin_purged_tiles'), 0); |
|
| 54 | + if($this->rrmdir($path)) { |
|
| 55 | + msg($this->getLang('admin_purged_tiles'), 0); |
|
| 56 | + } |
|
| 53 | 57 | } |
| 54 | 58 | if(isset($_REQUEST['purgemaps'])) { |
| 55 | 59 | $path = $conf['mediadir'] . '/olmapmaps'; |
| 56 | - if($this->rrmdir($path)) msg($this->getLang('admin_purged_maps'), 0); |
|
| 60 | + if($this->rrmdir($path)) { |
|
| 61 | + msg($this->getLang('admin_purged_maps'), 0); |
|
| 62 | + } |
|
| 57 | 63 | } |
| 58 | 64 | } |
| 59 | 65 | |
@@ -284,8 +284,9 @@ discard block |
||
| 284 | 284 | public function checkMapCache() { |
| 285 | 285 | $this->mapCacheID = md5($this->serializeParams()); |
| 286 | 286 | $filename = $this->mapCacheIDToFilename(); |
| 287 | - if(file_exists($filename)) |
|
| 288 | - return true; |
|
| 287 | + if(file_exists($filename)) { |
|
| 288 | + return true; |
|
| 289 | + } |
|
| 289 | 290 | } |
| 290 | 291 | |
| 291 | 292 | public function serializeParams() { |
@@ -320,14 +321,18 @@ discard block |
||
| 320 | 321 | public function makeMap() { |
| 321 | 322 | $this->initCoords(); |
| 322 | 323 | $this->createBaseMap(); |
| 323 | - if(!empty ($this->markers)) |
|
| 324 | - $this->placeMarkers(); |
|
| 325 | - if(file_exists($this->kmlFileName)) |
|
| 326 | - $this->drawKML(); |
|
| 327 | - if(file_exists($this->gpxFileName)) |
|
| 328 | - $this->drawGPX(); |
|
| 329 | - if(file_exists($this->geojsonFileName)) |
|
| 330 | - $this->drawGeojson(); |
|
| 324 | + if(!empty ($this->markers)) { |
|
| 325 | + $this->placeMarkers(); |
|
| 326 | + } |
|
| 327 | + if(file_exists($this->kmlFileName)) { |
|
| 328 | + $this->drawKML(); |
|
| 329 | + } |
|
| 330 | + if(file_exists($this->gpxFileName)) { |
|
| 331 | + $this->drawGPX(); |
|
| 332 | + } |
|
| 333 | + if(file_exists($this->geojsonFileName)) { |
|
| 334 | + $this->drawGeojson(); |
|
| 335 | + } |
|
| 331 | 336 | |
| 332 | 337 | $this->drawCopyright(); |
| 333 | 338 | } |
@@ -417,8 +422,9 @@ discard block |
||
| 417 | 422 | * @param string $url |
| 418 | 423 | */ |
| 419 | 424 | public function fetchTile($url) { |
| 420 | - if($this->useTileCache && ($cached = $this->checkTileCache($url))) |
|
| 421 | - return $cached; |
|
| 425 | + if($this->useTileCache && ($cached = $this->checkTileCache($url))) { |
|
| 426 | + return $cached; |
|
| 427 | + } |
|
| 422 | 428 | |
| 423 | 429 | $_UA = 'Mozilla/4.0 (compatible; DokuWikiSpatial HTTP Client; ' . PHP_OS . ')'; |
| 424 | 430 | if(function_exists("curl_init")) { |
@@ -581,7 +587,9 @@ discard block |
||
| 581 | 587 | * drawing colour |
| 582 | 588 | */ |
| 583 | 589 | private function drawGeometry($geom, $colour) { |
| 584 | - if(empty($geom)) return; |
|
| 590 | + if(empty($geom)) { |
|
| 591 | + return; |
|
| 592 | + } |
|
| 585 | 593 | |
| 586 | 594 | switch($geom->geometryType()) { |
| 587 | 595 | case 'GeometryCollection' : |
@@ -79,13 +79,19 @@ |
||
| 79 | 79 | |
| 80 | 80 | // normalize zoom |
| 81 | 81 | $zoom = $zoom ? intval($zoom) : 0; |
| 82 | - if($zoom > 18) $zoom = 18; |
|
| 82 | + if($zoom > 18) { |
|
| 83 | + $zoom = 18; |
|
| 84 | + } |
|
| 83 | 85 | // normalize WxH |
| 84 | 86 | list($width, $height) = explode('x', $size); |
| 85 | 87 | $width = intval($width); |
| 86 | - if($width > $this->maxWidth) $width = $this->maxWidth; |
|
| 88 | + if($width > $this->maxWidth) { |
|
| 89 | + $width = $this->maxWidth; |
|
| 90 | + } |
|
| 87 | 91 | $height = intval($height); |
| 88 | - if($height > $this->maxHeight) $height = $this->maxHeight; |
|
| 92 | + if($height > $this->maxHeight) { |
|
| 93 | + $height = $this->maxHeight; |
|
| 94 | + } |
|
| 89 | 95 | |
| 90 | 96 | // cleanup/validate gpx/kml |
| 91 | 97 | $kml = $this->mediaIdToPath($kml); |
@@ -602,8 +602,9 @@ |
||
| 602 | 602 | . "%2C" . $bbox ['maxlon']; |
| 603 | 603 | $imgUrl .= "&dcl=1"; |
| 604 | 604 | } |
| 605 | - if(strpos($imgUrl, "?") === false) |
|
| 606 | - $imgUrl .= "?"; |
|
| 605 | + if(strpos($imgUrl, "?") === false) { |
|
| 606 | + $imgUrl .= "?"; |
|
| 607 | + } |
|
| 607 | 608 | |
| 608 | 609 | //$imgUrl .= "&ms=" . str_replace ( "px", "", $gmap ['width'] ) . "," . str_replace ( "px", "", $gmap ['height'] ); |
| 609 | 610 | $imgUrl .= "&ms=" . str_replace("px", "", $gmap ['width']) . "%2C" |