@@ -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' : |
@@ -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" |