@@ -151,9 +151,9 @@ discard block |
||
| 151 | 151 | $this->gpxFileName = $gpx; |
| 152 | 152 | $this->geojsonFileName = $geojson; |
| 153 | 153 | $this->mediaBaseDir = $mediaDir; |
| 154 | - $this->tileCacheBaseDir = $tileCacheBaseDir . '/olmaptiles'; |
|
| 154 | + $this->tileCacheBaseDir = $tileCacheBaseDir.'/olmaptiles'; |
|
| 155 | 155 | $this->useTileCache = $this->tileCacheBaseDir !== ''; |
| 156 | - $this->mapCacheBaseDir = $mediaDir . '/olmapmaps'; |
|
| 156 | + $this->mapCacheBaseDir = $mediaDir.'/olmapmaps'; |
|
| 157 | 157 | $this->autoZoomExtent = $autoZoomExtent; |
| 158 | 158 | $this->apikey = $apikey; |
| 159 | 159 | } |
@@ -277,11 +277,11 @@ discard block |
||
| 277 | 277 | public function mapCacheIDToFilename(): string |
| 278 | 278 | { |
| 279 | 279 | if (!$this->mapCacheFile) { |
| 280 | - $this->mapCacheFile = $this->mapCacheBaseDir . "/" . $this->maptype . "/" . $this->zoom . "/cache_" |
|
| 281 | - . substr($this->mapCacheID, 0, 2) . "/" . substr($this->mapCacheID, 2, 2) |
|
| 282 | - . "/" . substr($this->mapCacheID, 4); |
|
| 280 | + $this->mapCacheFile = $this->mapCacheBaseDir."/".$this->maptype."/".$this->zoom."/cache_" |
|
| 281 | + . substr($this->mapCacheID, 0, 2)."/".substr($this->mapCacheID, 2, 2) |
|
| 282 | + . "/".substr($this->mapCacheID, 4); |
|
| 283 | 283 | } |
| 284 | - return $this->mapCacheFile . "." . $this->mapCacheExtension; |
|
| 284 | + return $this->mapCacheFile.".".$this->mapCacheExtension; |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | /** |
@@ -413,34 +413,34 @@ discard block |
||
| 413 | 413 | if ($this->useTileCache && ($cached = $this->checkTileCache($url))) |
| 414 | 414 | return $cached; |
| 415 | 415 | |
| 416 | - $_UA = 'Mozilla/4.0 (compatible; DokuWikiSpatial HTTP Client; ' . PHP_OS . ')'; |
|
| 416 | + $_UA = 'Mozilla/4.0 (compatible; DokuWikiSpatial HTTP Client; '.PHP_OS.')'; |
|
| 417 | 417 | if (function_exists("curl_init")) { |
| 418 | 418 | // use cUrl |
| 419 | 419 | $ch = curl_init(); |
| 420 | 420 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 421 | 421 | curl_setopt($ch, CURLOPT_USERAGENT, $_UA); |
| 422 | 422 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); |
| 423 | - curl_setopt($ch, CURLOPT_URL, $url . $this->apikey); |
|
| 423 | + curl_setopt($ch, CURLOPT_URL, $url.$this->apikey); |
|
| 424 | 424 | Logger::debug("StaticMap::fetchTile: getting: $url using curl_exec"); |
| 425 | 425 | $tile = curl_exec($ch); |
| 426 | 426 | curl_close($ch); |
| 427 | 427 | } else { |
| 428 | 428 | // use file_get_contents |
| 429 | 429 | global $conf; |
| 430 | - $opts = ['http' => ['method' => "GET", 'header' => "Accept-language: en\r\n" . "User-Agent: $_UA\r\n" . "accept: image/png\r\n", 'request_fulluri' => true]]; |
|
| 430 | + $opts = ['http' => ['method' => "GET", 'header' => "Accept-language: en\r\n"."User-Agent: $_UA\r\n"."accept: image/png\r\n", 'request_fulluri' => true]]; |
|
| 431 | 431 | if ( |
| 432 | 432 | isset($conf['proxy']['host'], $conf['proxy']['port']) |
| 433 | 433 | && $conf['proxy']['host'] !== '' |
| 434 | 434 | && $conf['proxy']['port'] !== '' |
| 435 | 435 | ) { |
| 436 | - $opts['http'] += ['proxy' => "tcp://" . $conf['proxy']['host'] . ":" . $conf['proxy']['port']]; |
|
| 436 | + $opts['http'] += ['proxy' => "tcp://".$conf['proxy']['host'].":".$conf['proxy']['port']]; |
|
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | $context = stream_context_create($opts); |
| 440 | 440 | Logger::debug( |
| 441 | 441 | "StaticMap::fetchTile: getting: $url . $this->apikey using file_get_contents and options $opts" |
| 442 | 442 | ); |
| 443 | - $tile = file_get_contents($url . $this->apikey, false, $context); |
|
| 443 | + $tile = file_get_contents($url.$this->apikey, false, $context); |
|
| 444 | 444 | } |
| 445 | 445 | if ($tile && $this->useTileCache) { |
| 446 | 446 | $this->writeTileToCache($url, $tile); |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | */ |
| 469 | 469 | public function tileUrlToFilename(string $url): string |
| 470 | 470 | { |
| 471 | - return $this->tileCacheBaseDir . "/" . substr($url, strpos($url, '/') + 1); |
|
| 471 | + return $this->tileCacheBaseDir."/".substr($url, strpos($url, '/') + 1); |
|
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | /** |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | $count = 0; |
| 509 | 509 | $color = imagecolorallocate($this->image, 0, 0, 0); |
| 510 | 510 | $bgcolor = imagecolorallocate($this->image, 200, 200, 200); |
| 511 | - $markerBaseDir = __DIR__ . '/icons'; |
|
| 511 | + $markerBaseDir = __DIR__.'/icons'; |
|
| 512 | 512 | $markerImageOffsetX = 0; |
| 513 | 513 | $markerImageOffsetY = 0; |
| 514 | 514 | $markerShadowOffsetX = 0; |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | if ($markerType) { |
| 529 | 529 | foreach ($this->markerPrototypes as $markerPrototype) { |
| 530 | 530 | if (preg_match($markerPrototype ['regex'], $markerType, $matches)) { |
| 531 | - $markerFilename = $matches [0] . $markerPrototype ['extension']; |
|
| 531 | + $markerFilename = $matches [0].$markerPrototype ['extension']; |
|
| 532 | 532 | if ($markerPrototype ['offsetImage']) { |
| 533 | 533 | [$markerImageOffsetX, $markerImageOffsetY] = explode( |
| 534 | 534 | ",", |
@@ -546,14 +546,14 @@ discard block |
||
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | // create img resource |
| 549 | - if (file_exists($markerBaseDir . '/' . $markerFilename)) { |
|
| 550 | - $markerImg = imagecreatefrompng($markerBaseDir . '/' . $markerFilename); |
|
| 549 | + if (file_exists($markerBaseDir.'/'.$markerFilename)) { |
|
| 550 | + $markerImg = imagecreatefrompng($markerBaseDir.'/'.$markerFilename); |
|
| 551 | 551 | } else { |
| 552 | - $markerImg = imagecreatefrompng($markerBaseDir . '/marker.png'); |
|
| 552 | + $markerImg = imagecreatefrompng($markerBaseDir.'/marker.png'); |
|
| 553 | 553 | } |
| 554 | 554 | // check for shadow + create shadow recource |
| 555 | - if ($markerShadow && file_exists($markerBaseDir . '/' . $markerShadow)) { |
|
| 556 | - $markerShadowImg = imagecreatefrompng($markerBaseDir . '/' . $markerShadow); |
|
| 555 | + if ($markerShadow && file_exists($markerBaseDir.'/'.$markerShadow)) { |
|
| 556 | + $markerShadowImg = imagecreatefrompng($markerBaseDir.'/'.$markerShadow); |
|
| 557 | 557 | } |
| 558 | 558 | // calc position |
| 559 | 559 | $destX = floor( |
@@ -782,8 +782,8 @@ discard block |
||
| 782 | 782 | */ |
| 783 | 783 | public function drawCopyright() |
| 784 | 784 | { |
| 785 | - $logoBaseDir = __DIR__ . '/' . 'logo/'; |
|
| 786 | - $logoImg = imagecreatefrompng($logoBaseDir . $this->tileInfo ['openstreetmap'] ['logo']); |
|
| 785 | + $logoBaseDir = __DIR__.'/'.'logo/'; |
|
| 786 | + $logoImg = imagecreatefrompng($logoBaseDir.$this->tileInfo ['openstreetmap'] ['logo']); |
|
| 787 | 787 | $textcolor = imagecolorallocate($this->image, 0, 0, 0); |
| 788 | 788 | $bgcolor = imagecolorallocate($this->image, 200, 200, 200); |
| 789 | 789 | |
@@ -820,7 +820,7 @@ discard block |
||
| 820 | 820 | $mapAuthor = "(c) OpenStreetMap maps/CC BY-SA"; |
| 821 | 821 | } else { |
| 822 | 822 | $mapAuthor = $this->tileInfo [$this->maptype] ['txt']; |
| 823 | - $iconImg = imagecreatefrompng($logoBaseDir . $this->tileInfo [$this->maptype] ['logo']); |
|
| 823 | + $iconImg = imagecreatefrompng($logoBaseDir.$this->tileInfo [$this->maptype] ['logo']); |
|
| 824 | 824 | $xIconOffset = imagesx($iconImg); |
| 825 | 825 | imagecopy( |
| 826 | 826 | $this->image, |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | $_nocache = true; |
| 125 | 125 | $imgUrl .= $this->getBing($gmap, $overlay) . "&.png"; |
| 126 | 126 | } |
| 127 | - /* elseif (stripos ( $gmap ['baselyr'], 'mapquest' ) !== false) { |
|
| 127 | + /* elseif (stripos ( $gmap ['baselyr'], 'mapquest' ) !== false) { |
|
| 128 | 128 | // MapQuest |
| 129 | 129 | if (! $this->getConf ( 'mapquestAPIKey' )) { |
| 130 | 130 | // no API key for MapQuest, use OSM |
@@ -115,14 +115,14 @@ discard block |
||
| 115 | 115 | if (!$this->getConf('bingAPIKey')) { |
| 116 | 116 | // in case there is no Bing api key we'll use OSM |
| 117 | 117 | $_firstimageID = $this->getStaticOSM($gmap, $overlay); |
| 118 | - $imgUrl .= $_firstimageID; |
|
| 118 | + $imgUrl .= $_firstimageID; |
|
| 119 | 119 | if ($this->getConf('optionStaticMapGenerator') == 'remote') { |
| 120 | 120 | $imgUrl .= "&.png"; |
| 121 | 121 | } |
| 122 | 122 | } else { |
| 123 | 123 | // seems that Bing doesn't like the DW client, turn off caching |
| 124 | 124 | $_nocache = true; |
| 125 | - $imgUrl .= $this->getBing($gmap, $overlay) . "&.png"; |
|
| 125 | + $imgUrl .= $this->getBing($gmap, $overlay)."&.png"; |
|
| 126 | 126 | } |
| 127 | 127 | /* elseif (stripos ( $gmap ['baselyr'], 'mapquest' ) !== false) { |
| 128 | 128 | // MapQuest |
@@ -141,14 +141,14 @@ discard block |
||
| 141 | 141 | } else { |
| 142 | 142 | // default OSM |
| 143 | 143 | $_firstimageID = $this->getStaticOSM($gmap, $overlay); |
| 144 | - $imgUrl .= $_firstimageID; |
|
| 144 | + $imgUrl .= $_firstimageID; |
|
| 145 | 145 | if ($this->getConf('optionStaticMapGenerator') == 'remote') { |
| 146 | 146 | $imgUrl .= "&.png"; |
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // append dw p_render specific params and render |
| 151 | - $imgUrl .= "?" . str_replace("px", "", $gmap ['width']) . "x" |
|
| 151 | + $imgUrl .= "?".str_replace("px", "", $gmap ['width'])."x" |
|
| 152 | 152 | . str_replace("px", "", $gmap ['height']); |
| 153 | 153 | $imgUrl .= "&nolink"; |
| 154 | 154 | |
@@ -157,13 +157,13 @@ discard block |
||
| 157 | 157 | $imgUrl .= "&nocache"; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - $imgUrl .= " |" . $gmap ['summary'] . " }}"; |
|
| 160 | + $imgUrl .= " |".$gmap ['summary']." }}"; |
|
| 161 | 161 | |
| 162 | 162 | $mapid = $gmap ['id']; |
| 163 | 163 | // create a javascript parameter string for the map |
| 164 | 164 | $param = ''; |
| 165 | 165 | foreach ($gmap as $key => $val) { |
| 166 | - $param .= is_numeric($val) ? "$key: $val, " : "$key: '" . hsc($val) . "', "; |
|
| 166 | + $param .= is_numeric($val) ? "$key: $val, " : "$key: '".hsc($val)."', "; |
|
| 167 | 167 | } |
| 168 | 168 | if (!empty($param)) { |
| 169 | 169 | $param = substr($param, 0, -2); |
@@ -190,12 +190,12 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | $poitable .= ' |
| 192 | 192 | <tr> |
| 193 | - <td class="rowId">' . $rowId . '</td> |
|
| 194 | - <td class="icon"><img src="' . DOKU_BASE . 'lib/plugins/openlayersmap/icons/' . $img . '" alt="' |
|
| 195 | - . substr($img, 0, -4) . $this->getlang('alt_legend_poi') . '" /></td> |
|
| 196 | - <td class="lat" title="' . $this->getLang('olmapPOIlatTitle') . '">' . $lat . '</td> |
|
| 197 | - <td class="lon" title="' . $this->getLang('olmapPOIlonTitle') . '">' . $lon . '</td> |
|
| 198 | - <td class="txt">' . $text . '</td> |
|
| 193 | + <td class="rowId">' . $rowId.'</td> |
|
| 194 | + <td class="icon"><img src="' . DOKU_BASE.'lib/plugins/openlayersmap/icons/'.$img.'" alt="' |
|
| 195 | + . substr($img, 0, -4).$this->getlang('alt_legend_poi').'" /></td> |
|
| 196 | + <td class="lat" title="' . $this->getLang('olmapPOIlatTitle').'">'.$lat.'</td> |
|
| 197 | + <td class="lon" title="' . $this->getLang('olmapPOIlonTitle').'">'.$lon.'</td> |
|
| 198 | + <td class="txt">' . $text.'</td> |
|
| 199 | 199 | </tr>'; |
| 200 | 200 | } |
| 201 | 201 | $poi = substr($poi, 2); |
@@ -205,9 +205,9 @@ discard block |
||
| 205 | 205 | <tr> |
| 206 | 206 | <td class="rowId"><img src="' . DOKU_BASE |
| 207 | 207 | . 'lib/plugins/openlayersmap/toolbar/kml_file.png" alt="KML file" /></td> |
| 208 | - <td class="icon"><img src="' . DOKU_BASE . 'lib/plugins/openlayersmap/toolbar/kml_line.png" alt="' |
|
| 209 | - . $this->getlang('alt_legend_kml') . '" /></td> |
|
| 210 | - <td class="txt" colspan="3">KML track: ' . $this->getFileName($gmap ['kmlfile']) . '</td> |
|
| 208 | + <td class="icon"><img src="' . DOKU_BASE.'lib/plugins/openlayersmap/toolbar/kml_line.png" alt="' |
|
| 209 | + . $this->getlang('alt_legend_kml').'" /></td> |
|
| 210 | + <td class="txt" colspan="3">KML track: ' . $this->getFileName($gmap ['kmlfile']).'</td> |
|
| 211 | 211 | </tr>'; |
| 212 | 212 | } |
| 213 | 213 | if (!empty($gmap ['gpxfile'])) { |
@@ -217,8 +217,8 @@ discard block |
||
| 217 | 217 | . 'lib/plugins/openlayersmap/toolbar/gpx_file.png" alt="GPX file" /></td> |
| 218 | 218 | <td class="icon"><img src="' . DOKU_BASE |
| 219 | 219 | . 'lib/plugins/openlayersmap/toolbar/gpx_line.png" alt="' |
| 220 | - . $this->getlang('alt_legend_gpx') . '" /></td> |
|
| 221 | - <td class="txt" colspan="3">GPX track: ' . $this->getFileName($gmap ['gpxfile']) . '</td> |
|
| 220 | + . $this->getlang('alt_legend_gpx').'" /></td> |
|
| 221 | + <td class="txt" colspan="3">GPX track: ' . $this->getFileName($gmap ['gpxfile']).'</td> |
|
| 222 | 222 | </tr>'; |
| 223 | 223 | } |
| 224 | 224 | if (!empty($gmap ['geojsonfile'])) { |
@@ -228,14 +228,14 @@ discard block |
||
| 228 | 228 | . 'lib/plugins/openlayersmap/toolbar/geojson_file.png" alt="GeoJSON file" /></td> |
| 229 | 229 | <td class="icon"><img src="' . DOKU_BASE |
| 230 | 230 | . 'lib/plugins/openlayersmap/toolbar/geojson_line.png" alt="' |
| 231 | - . $this->getlang('alt_legend_geojson') . '" /></td> |
|
| 232 | - <td class="txt" colspan="3">GeoJSON track: ' . $this->getFileName($gmap ['geojsonfile']) . '</td> |
|
| 231 | + . $this->getlang('alt_legend_geojson').'" /></td> |
|
| 232 | + <td class="txt" colspan="3">GeoJSON track: ' . $this->getFileName($gmap ['geojsonfile']).'</td> |
|
| 233 | 233 | </tr>'; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | $autozoom = empty($gmap ['autozoom']) ? $this->getConf('autoZoomMap') : $gmap ['autozoom']; |
| 237 | - $js = "{mapOpts: {" . $param . ", displayformat: '" . $this->getConf('displayformat') |
|
| 238 | - . "', autozoom: " . $autozoom . "}, poi: [$poi]};"; |
|
| 237 | + $js = "{mapOpts: {".$param.", displayformat: '".$this->getConf('displayformat') |
|
| 238 | + . "', autozoom: ".$autozoom."}, poi: [$poi]};"; |
|
| 239 | 239 | // unescape the json |
| 240 | 240 | $poitable = stripslashes($poitable); |
| 241 | 241 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | // parse match for instructions, break into key value pairs |
| 257 | 257 | $gmap = $this->dflt; |
| 258 | 258 | foreach ($gmap as $key => &$value) { |
| 259 | - $defval = $this->getConf('default_' . $key); |
|
| 259 | + $defval = $this->getConf('default_'.$key); |
|
| 260 | 260 | if ($defval !== '') { |
| 261 | 261 | $value = $defval; |
| 262 | 262 | } |
@@ -358,29 +358,29 @@ discard block |
||
| 358 | 358 | // see: https://developers.google.com/maps/documentation/staticmaps/index#Viewports |
| 359 | 359 | // http://maps.google.com/maps/api/staticmap?center=51.565690,5.456756&zoom=16&size=600x400&markers=icon:http://wild-water.nl/dokuwiki/lib/plugins/openlayersmap/icons/marker.png|label:1|51.565690,5.456756&markers=icon:http://wild-water.nl/dokuwiki/lib/plugins/openlayersmap/icons/marker-blue.png|51.566197,5.458966|label:2&markers=icon:http://wild-water.nl/dokuwiki/lib/plugins/openlayersmap/icons/parking.png|51.567177,5.457909|label:3&markers=icon:http://wild-water.nl/dokuwiki/lib/plugins/openlayersmap/icons/parking.png|51.566283,5.457330|label:4&markers=icon:http://wild-water.nl/dokuwiki/lib/plugins/openlayersmap/icons/parking.png|51.565630,5.457695|label:5&sensor=false&format=png&maptype=roadmap |
| 360 | 360 | $imgUrl = "https://maps.googleapis.com/maps/api/staticmap?"; |
| 361 | - $imgUrl .= "&size=" . str_replace("px", "", $gmap ['width']) . "x" |
|
| 361 | + $imgUrl .= "&size=".str_replace("px", "", $gmap ['width'])."x" |
|
| 362 | 362 | . str_replace("px", "", $gmap ['height']); |
| 363 | 363 | //if (!$this->getConf( 'autoZoomMap')) { // no need for center & zoom params } |
| 364 | - $imgUrl .= "¢er=" . $gmap ['lat'] . "," . $gmap ['lon']; |
|
| 364 | + $imgUrl .= "¢er=".$gmap ['lat'].",".$gmap ['lon']; |
|
| 365 | 365 | // max is 21 (== building scale), but that's overkill.. |
| 366 | 366 | if ($gmap ['zoom'] > 17) { |
| 367 | 367 | $imgUrl .= "&zoom=17"; |
| 368 | 368 | } else { |
| 369 | - $imgUrl .= "&zoom=" . $gmap ['zoom']; |
|
| 369 | + $imgUrl .= "&zoom=".$gmap ['zoom']; |
|
| 370 | 370 | } |
| 371 | 371 | if ($overlay !== []) { |
| 372 | 372 | $rowId = 0; |
| 373 | 373 | foreach ($overlay as $data) { |
| 374 | 374 | [$lat, $lon, $text, $angle, $opacity, $img] = $data; |
| 375 | - $imgUrl .= "&markers=icon%3a" . $sUrl . "lib/plugins/openlayersmap/icons/" . $img . "%7c" |
|
| 376 | - . $lat . "," . $lon . "%7clabel%3a" . ++$rowId; |
|
| 375 | + $imgUrl .= "&markers=icon%3a".$sUrl."lib/plugins/openlayersmap/icons/".$img."%7c" |
|
| 376 | + . $lat.",".$lon."%7clabel%3a".++$rowId; |
|
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | - $imgUrl .= "&format=png&maptype=" . $maptype; |
|
| 379 | + $imgUrl .= "&format=png&maptype=".$maptype; |
|
| 380 | 380 | global $conf; |
| 381 | - $imgUrl .= "&language=" . $conf ['lang']; |
|
| 381 | + $imgUrl .= "&language=".$conf ['lang']; |
|
| 382 | 382 | if ($this->getConf('googleAPIkey')) { |
| 383 | - $imgUrl .= "&key=" . $this->getConf('googleAPIkey'); |
|
| 383 | + $imgUrl .= "&key=".$this->getConf('googleAPIkey'); |
|
| 384 | 384 | } |
| 385 | 385 | return $imgUrl; |
| 386 | 386 | } |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | if (($geophp = plugin_load('helper', 'geophp')) === null) { |
| 474 | 474 | Logger::debug('geophp plugin is not available for use.', $geophp); |
| 475 | 475 | } |
| 476 | - $size = str_replace("px", "", $gmap ['width']) . "x" |
|
| 476 | + $size = str_replace("px", "", $gmap ['width'])."x" |
|
| 477 | 477 | . str_replace("px", "", $gmap ['height']); |
| 478 | 478 | |
| 479 | 479 | $markers = []; |
@@ -493,19 +493,19 @@ discard block |
||
| 493 | 493 | break; |
| 494 | 494 | case 'transport': |
| 495 | 495 | $maptype = 'transport'; |
| 496 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
| 496 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
| 497 | 497 | break; |
| 498 | 498 | case 'landscape': |
| 499 | 499 | $maptype = 'landscape'; |
| 500 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
| 500 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
| 501 | 501 | break; |
| 502 | 502 | case 'outdoors': |
| 503 | 503 | $maptype = 'outdoors'; |
| 504 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
| 504 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
| 505 | 505 | break; |
| 506 | 506 | case 'cycle map': |
| 507 | 507 | $maptype = 'cycle'; |
| 508 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
| 508 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
| 509 | 509 | break; |
| 510 | 510 | case 'hike and bike map': |
| 511 | 511 | $maptype = 'hikeandbike'; |
@@ -542,25 +542,25 @@ discard block |
||
| 542 | 542 | // ol-marker|47.921629720114,18.027343747285,ol-marker-gold|47.951071133739,19.257812497236, |
| 543 | 543 | // ol-marker-blue|47.180141361692,19.257812497236,ol-marker-green |
| 544 | 544 | $imgUrl = "https://staticmap.openstreetmap.de/staticmap.php"; |
| 545 | - $imgUrl .= "?center=" . $gmap ['lat'] . "," . $gmap ['lon']; |
|
| 546 | - $imgUrl .= "&size=" . str_replace("px", "", $gmap ['width']) . "x" |
|
| 545 | + $imgUrl .= "?center=".$gmap ['lat'].",".$gmap ['lon']; |
|
| 546 | + $imgUrl .= "&size=".str_replace("px", "", $gmap ['width'])."x" |
|
| 547 | 547 | . str_replace("px", "", $gmap ['height']); |
| 548 | 548 | |
| 549 | 549 | if ($gmap ['zoom'] > 16) { |
| 550 | 550 | // actually this could even be 18, but that seems overkill |
| 551 | 551 | $imgUrl .= "&zoom=16"; |
| 552 | 552 | } else { |
| 553 | - $imgUrl .= "&zoom=" . $gmap ['zoom']; |
|
| 553 | + $imgUrl .= "&zoom=".$gmap ['zoom']; |
|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | if ($overlay !== []) { |
| 557 | - $rowId = 0; |
|
| 557 | + $rowId = 0; |
|
| 558 | 558 | $imgUrl .= "&markers="; |
| 559 | 559 | foreach ($overlay as $data) { |
| 560 | 560 | [$lat, $lon, $text, $angle, $opacity, $img] = $data; |
| 561 | 561 | $rowId++; |
| 562 | 562 | $iconStyle = "lightblue$rowId"; |
| 563 | - $imgUrl .= "$lat,$lon,$iconStyle%7c"; |
|
| 563 | + $imgUrl .= "$lat,$lon,$iconStyle%7c"; |
|
| 564 | 564 | } |
| 565 | 565 | $imgUrl = substr($imgUrl, 0, -3); |
| 566 | 566 | } |
@@ -595,13 +595,13 @@ discard block |
||
| 595 | 595 | $maptype = 'Road'; |
| 596 | 596 | break; |
| 597 | 597 | } |
| 598 | - $imgUrl = "https://dev.virtualearth.net/REST/v1/Imagery/Map/" . $maptype;// . "/"; |
|
| 598 | + $imgUrl = "https://dev.virtualearth.net/REST/v1/Imagery/Map/".$maptype; // . "/"; |
|
| 599 | 599 | if ($this->getConf('autoZoomMap')) { |
| 600 | 600 | $bbox = $this->calcBBOX($overlay, $gmap ['lat'], $gmap ['lon']); |
| 601 | 601 | //$imgUrl .= "?ma=" . $bbox ['minlat'] . "," . $bbox ['minlon'] . "," |
| 602 | 602 | // . $bbox ['maxlat'] . "," . $bbox ['maxlon']; |
| 603 | - $imgUrl .= "?ma=" . $bbox ['minlat'] . "%2C" . $bbox ['minlon'] . "%2C" . $bbox ['maxlat'] |
|
| 604 | - . "%2C" . $bbox ['maxlon']; |
|
| 603 | + $imgUrl .= "?ma=".$bbox ['minlat']."%2C".$bbox ['minlon']."%2C".$bbox ['maxlat'] |
|
| 604 | + . "%2C".$bbox ['maxlon']; |
|
| 605 | 605 | $imgUrl .= "&dcl=1"; |
| 606 | 606 | } |
| 607 | 607 | if (strpos($imgUrl, "?") === false) |
@@ -609,9 +609,9 @@ discard block |
||
| 609 | 609 | |
| 610 | 610 | //$imgUrl .= "&ms=" . str_replace ( "px", "", $gmap ['width'] ) . "," |
| 611 | 611 | // . str_replace ( "px", "", $gmap ['height'] ); |
| 612 | - $imgUrl .= "&ms=" . str_replace("px", "", $gmap ['width']) . "%2C" |
|
| 612 | + $imgUrl .= "&ms=".str_replace("px", "", $gmap ['width'])."%2C" |
|
| 613 | 613 | . str_replace("px", "", $gmap ['height']); |
| 614 | - $imgUrl .= "&key=" . $this->getConf('bingAPIKey'); |
|
| 614 | + $imgUrl .= "&key=".$this->getConf('bingAPIKey'); |
|
| 615 | 615 | if ($overlay !== []) { |
| 616 | 616 | $rowId = 0; |
| 617 | 617 | foreach ($overlay as $data) { |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | } |
| 631 | 631 | global $conf; |
| 632 | 632 | $imgUrl .= "&fmt=png"; |
| 633 | - $imgUrl .= "&c=" . $conf ['lang']; |
|
| 633 | + $imgUrl .= "&c=".$conf ['lang']; |
|
| 634 | 634 | return $imgUrl; |
| 635 | 635 | } |
| 636 | 636 | |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | $latPos = "N"; |
| 677 | 677 | } |
| 678 | 678 | $dms = $this->convertDDtoDMS(abs($decimaldegrees)); |
| 679 | - return hsc($dms . $latPos); |
|
| 679 | + return hsc($dms.$latPos); |
|
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | /** |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | $secs = ($decimaldegrees - $dms) * 3600; |
| 693 | 693 | $min = floor($secs / 60); |
| 694 | 694 | $sec = round($secs - ($min * 60), 3); |
| 695 | - $dms .= 'º' . $min . '\'' . $sec . '"'; |
|
| 695 | + $dms .= 'º'.$min.'\''.$sec.'"'; |
|
| 696 | 696 | return $dms; |
| 697 | 697 | } |
| 698 | 698 | |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | $lonPos = "E"; |
| 711 | 711 | } |
| 712 | 712 | $dms = $this->convertDDtoDMS(abs($decimaldegrees)); |
| 713 | - return hsc($dms . $lonPos); |
|
| 713 | + return hsc($dms.$lonPos); |
|
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | /** |
@@ -752,50 +752,50 @@ discard block |
||
| 752 | 752 | if (!$initialised) { |
| 753 | 753 | $initialised = true; |
| 754 | 754 | // render necessary script tags only once |
| 755 | - $olscript = '<script defer="defer" src="' . DOKU_BASE . 'lib/plugins/openlayersmap/ol/ol.js"></script> |
|
| 756 | -<script defer="defer" src="' . DOKU_BASE . 'lib/plugins/openlayersmap/ol/ol-layerswitcher.js"></script>'; |
|
| 755 | + $olscript = '<script defer="defer" src="'.DOKU_BASE.'lib/plugins/openlayersmap/ol/ol.js"></script> |
|
| 756 | +<script defer="defer" src="' . DOKU_BASE.'lib/plugins/openlayersmap/ol/ol-layerswitcher.js"></script>'; |
|
| 757 | 757 | |
| 758 | 758 | $scriptEnable = '<script defer="defer" src="data:text/javascript;base64,'; |
| 759 | 759 | $scriptSrc = $olscript ? 'const olEnable=true;' : 'const olEnable=false;'; |
| 760 | - $scriptSrc .= 'const osmEnable=' . ($osmEnable ? 'true' : 'false') . ';'; |
|
| 761 | - $scriptSrc .= 'const stadiaEnable=' . ($stadiaEnable ? 'true' : 'false') . ';'; |
|
| 762 | - $scriptSrc .= 'const bEnable=' . ($enableBing ? 'true' : 'false') . ';'; |
|
| 763 | - $scriptSrc .= 'const bApiKey="' . $this->getConf('bingAPIKey') . '";'; |
|
| 764 | - $scriptSrc .= 'const tfApiKey="' . $this->getConf('tfApiKey') . '";'; |
|
| 765 | - $scriptSrc .= 'const gApiKey="' . $this->getConf('googleAPIkey') . '";'; |
|
| 760 | + $scriptSrc .= 'const osmEnable='.($osmEnable ? 'true' : 'false').';'; |
|
| 761 | + $scriptSrc .= 'const stadiaEnable='.($stadiaEnable ? 'true' : 'false').';'; |
|
| 762 | + $scriptSrc .= 'const bEnable='.($enableBing ? 'true' : 'false').';'; |
|
| 763 | + $scriptSrc .= 'const bApiKey="'.$this->getConf('bingAPIKey').'";'; |
|
| 764 | + $scriptSrc .= 'const tfApiKey="'.$this->getConf('tfApiKey').'";'; |
|
| 765 | + $scriptSrc .= 'const gApiKey="'.$this->getConf('googleAPIkey').'";'; |
|
| 766 | 766 | $scriptSrc .= 'olMapData = []; let olMaps = {}; let olMapOverlays = {};'; |
| 767 | 767 | $scriptEnable .= base64_encode($scriptSrc); |
| 768 | 768 | $scriptEnable .= '"></script>'; |
| 769 | 769 | } |
| 770 | 770 | $renderer->doc .= "$olscript\n$scriptEnable"; |
| 771 | - $renderer->doc .= '<div class="olMapHelp">' . $this->locale_xhtml("help") . '</div>'; |
|
| 771 | + $renderer->doc .= '<div class="olMapHelp">'.$this->locale_xhtml("help").'</div>'; |
|
| 772 | 772 | if ($this->getConf('enableA11y')) { |
| 773 | - $renderer->doc .= '<div id="' . $mapid . '-static" class="olStaticMap">' |
|
| 774 | - . p_render($format, p_get_instructions($staticImgUrl), $info) . '</div>'; |
|
| 773 | + $renderer->doc .= '<div id="'.$mapid.'-static" class="olStaticMap">' |
|
| 774 | + . p_render($format, p_get_instructions($staticImgUrl), $info).'</div>'; |
|
| 775 | 775 | } |
| 776 | - $renderer->doc .= '<div id="' . $mapid . '-clearer" class="clearer"><p> </p></div>'; |
|
| 776 | + $renderer->doc .= '<div id="'.$mapid.'-clearer" class="clearer"><p> </p></div>'; |
|
| 777 | 777 | if ($this->getConf('enableA11y')) { |
| 778 | 778 | // render a table of the POI for the print and a11y presentation, it is hidden using javascript |
| 779 | 779 | $renderer->doc .= ' |
| 780 | - <div id="' . $mapid . '-table-span" class="olPOItableSpan"> |
|
| 781 | - <table id="' . $mapid . '-table" class="olPOItable"> |
|
| 782 | - <caption class="olPOITblCaption">' . $this->getLang('olmapPOItitle') . '</caption> |
|
| 780 | + <div id="' . $mapid.'-table-span" class="olPOItableSpan"> |
|
| 781 | + <table id="' . $mapid.'-table" class="olPOItable"> |
|
| 782 | + <caption class="olPOITblCaption">' . $this->getLang('olmapPOItitle').'</caption> |
|
| 783 | 783 | <thead class="olPOITblHeader"> |
| 784 | 784 | <tr> |
| 785 | 785 | <th class="rowId" scope="col">id</th> |
| 786 | - <th class="icon" scope="col">' . $this->getLang('olmapPOIicon') . '</th> |
|
| 787 | - <th class="lat" scope="col" title="' . $this->getLang('olmapPOIlatTitle') . '">' |
|
| 788 | - . $this->getLang('olmapPOIlat') . '</th> |
|
| 789 | - <th class="lon" scope="col" title="' . $this->getLang('olmapPOIlonTitle') . '">' |
|
| 790 | - . $this->getLang('olmapPOIlon') . '</th> |
|
| 791 | - <th class="txt" scope="col">' . $this->getLang('olmapPOItxt') . '</th> |
|
| 786 | + <th class="icon" scope="col">' . $this->getLang('olmapPOIicon').'</th> |
|
| 787 | + <th class="lat" scope="col" title="' . $this->getLang('olmapPOIlatTitle').'">' |
|
| 788 | + . $this->getLang('olmapPOIlat').'</th> |
|
| 789 | + <th class="lon" scope="col" title="' . $this->getLang('olmapPOIlonTitle').'">' |
|
| 790 | + . $this->getLang('olmapPOIlon').'</th> |
|
| 791 | + <th class="txt" scope="col">' . $this->getLang('olmapPOItxt').'</th> |
|
| 792 | 792 | </tr> |
| 793 | 793 | </thead>'; |
| 794 | 794 | if ($poitabledesc != '') { |
| 795 | - $renderer->doc .= '<tfoot class="olPOITblFooter"><tr><td colspan="5">' . $poitabledesc |
|
| 795 | + $renderer->doc .= '<tfoot class="olPOITblFooter"><tr><td colspan="5">'.$poitabledesc |
|
| 796 | 796 | . '</td></tr></tfoot>'; |
| 797 | 797 | } |
| 798 | - $renderer->doc .= '<tbody class="olPOITblBody">' . $poitable . '</tbody> |
|
| 798 | + $renderer->doc .= '<tbody class="olPOITblBody">'.$poitable.'</tbody> |
|
| 799 | 799 | </table> |
| 800 | 800 | </div>'; |
| 801 | 801 | $renderer->doc .= "\n"; |