@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | } |
98 | 98 | // normalize WxH |
99 | 99 | list($width, $height) = explode('x', $size); |
100 | - $width = (int)$width; |
|
100 | + $width = (int) $width; |
|
101 | 101 | if ($width > $this->maxWidth) { |
102 | 102 | $width = $this->maxWidth; |
103 | 103 | } |
104 | - $height = (int)$height; |
|
104 | + $height = (int) $height; |
|
105 | 105 | if ($height > $this->maxHeight) { |
106 | 106 | $height = $this->maxHeight; |
107 | 107 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $geojson = $this->mediaIdToPath($geojson); |
115 | 115 | |
116 | 116 | // create map |
117 | - require_once DOKU_PLUGIN . 'openlayersmap/StaticMap.php'; |
|
117 | + require_once DOKU_PLUGIN.'openlayersmap/StaticMap.php'; |
|
118 | 118 | $map = new StaticMap( |
119 | 119 | $lat, $lon, $zoom, $width, $height, $maptype, |
120 | 120 | $markers, $gpx, $kml, $geojson, $conf['mediadir'], $conf['cachedir'], |
@@ -146,6 +146,6 @@ discard block |
||
146 | 146 | $id = substr($id, 1); |
147 | 147 | } |
148 | 148 | $id = str_replace(":", "/", $id); |
149 | - return $conf['mediadir'] . '/' . $id; |
|
149 | + return $conf['mediadir'].'/'.$id; |
|
150 | 150 | } |
151 | 151 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | public function getMenuIcon(): string |
40 | 40 | { |
41 | 41 | $plugin = $this->getPluginName(); |
42 | - return DOKU_PLUGIN . $plugin . '/admin/purge.svg'; |
|
42 | + return DOKU_PLUGIN.$plugin.'/admin/purge.svg'; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | return; |
54 | 54 | } |
55 | 55 | if (isset($_REQUEST['purgetiles'])) { |
56 | - $path = $conf['cachedir'] . '/olmaptiles'; |
|
56 | + $path = $conf['cachedir'].'/olmaptiles'; |
|
57 | 57 | if ($this->rrmdir($path)) { |
58 | 58 | msg($this->getLang('admin_purged_tiles')); |
59 | 59 | } |
60 | 60 | } |
61 | 61 | if (isset($_REQUEST['purgemaps'])) { |
62 | - $path = $conf['mediadir'] . '/olmapmaps'; |
|
62 | + $path = $conf['mediadir'].'/olmapmaps'; |
|
63 | 63 | if ($this->rrmdir($path)) { |
64 | 64 | msg($this->getLang('admin_purged_maps')); |
65 | 65 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | '<input id="purgetiles" name="purgetiles" type="checkbox" value="1" class="checkbox" />' |
107 | 107 | ); |
108 | 108 | $form->addElement( |
109 | - '<label for="purgetiles" class="label">' . $this->getLang('admin_purge_tiles') |
|
109 | + '<label for="purgetiles" class="label">'.$this->getLang('admin_purge_tiles') |
|
110 | 110 | . '</label>' |
111 | 111 | ); |
112 | 112 | $form->addElement('</p>'); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $form->addElement('<p>'); |
117 | 117 | $form->addElement('<input id="purgemaps" name="purgemaps" type="checkbox" value="1" class="checkbox" />'); |
118 | 118 | $form->addElement( |
119 | - '<label for="purgemaps" class="label">' . $this->getLang('admin_purge_maps') . '</label>' |
|
119 | + '<label for="purgemaps" class="label">'.$this->getLang('admin_purge_maps').'</label>' |
|
120 | 120 | ); |
121 | 121 | $form->addElement('</p>'); |
122 | 122 | $form->endFieldset(); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function insertButton(Doku_Event $event, $param) |
44 | 44 | { |
45 | - $strOpen = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" '; |
|
45 | + $strOpen = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" '; |
|
46 | 46 | $strOpen .= 'lon="5.1" zoom="12" statusbar="1" controls="1" poihoverstyle="0" '; |
47 | 47 | $strOpen .= 'baselyr="OpenStreetMap" gpxfile="" kmlfile="" geojsonfile="" summary="" >\n'; |
48 | 48 | $strOpen .= '~~ Plugin olmap help.\n'; |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | final public function test_plugininfo(): void |
34 | 34 | { |
35 | - $file = __DIR__ . '/../plugin.info.txt'; |
|
35 | + $file = __DIR__.'/../plugin.info.txt'; |
|
36 | 36 | self::assertFileExists($file); |
37 | 37 | |
38 | 38 | $info = confToHash($file); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | // phpcs:disable PSR1.Files.SideEffects |
25 | 25 | // TODO resolve side effect |
26 | -include_once(realpath(__DIR__) . '/../geophp/geoPHP/geoPHP.inc'); |
|
26 | +include_once(realpath(__DIR__).'/../geophp/geoPHP/geoPHP.inc'); |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | $this->gpxFileName = $gpx; |
217 | 217 | $this->geojsonFileName = $geojson; |
218 | 218 | $this->mediaBaseDir = $mediaDir; |
219 | - $this->tileCacheBaseDir = $tileCacheBaseDir . '/olmaptiles'; |
|
219 | + $this->tileCacheBaseDir = $tileCacheBaseDir.'/olmaptiles'; |
|
220 | 220 | $this->useTileCache = $this->tileCacheBaseDir !== ''; |
221 | - $this->mapCacheBaseDir = $mediaDir . '/olmapmaps'; |
|
221 | + $this->mapCacheBaseDir = $mediaDir.'/olmapmaps'; |
|
222 | 222 | $this->autoZoomExtent = $autoZoomExtent; |
223 | 223 | $this->apikey = $apikey; |
224 | 224 | } |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | private function autoZoom(float $paddingFactor = 1.0): void |
264 | 264 | { |
265 | 265 | $geoms = array(); |
266 | - $geoms [] = new Point ($this->lon, $this->lat); |
|
266 | + $geoms [] = new Point($this->lon, $this->lat); |
|
267 | 267 | if (!empty ($this->markers)) { |
268 | 268 | foreach ($this->markers as $marker) { |
269 | - $geoms [] = new Point ($marker ['lon'], $marker ['lat']); |
|
269 | + $geoms [] = new Point($marker ['lon'], $marker ['lat']); |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | if (file_exists($this->kmlFileName)) { |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | return; |
294 | 294 | } |
295 | 295 | |
296 | - $geom = new GeometryCollection ($geoms); |
|
296 | + $geom = new GeometryCollection($geoms); |
|
297 | 297 | $centroid = $geom->centroid(); |
298 | 298 | $bbox = $geom->getBBox(); |
299 | 299 | |
@@ -347,11 +347,11 @@ discard block |
||
347 | 347 | public function mapCacheIDToFilename(): string |
348 | 348 | { |
349 | 349 | if (!$this->mapCacheFile) { |
350 | - $this->mapCacheFile = $this->mapCacheBaseDir . "/" . $this->maptype . "/" . $this->zoom . "/cache_" |
|
351 | - . substr($this->mapCacheID, 0, 2) . "/" . substr($this->mapCacheID, 2, 2) |
|
352 | - . "/" . substr($this->mapCacheID, 4); |
|
350 | + $this->mapCacheFile = $this->mapCacheBaseDir."/".$this->maptype."/".$this->zoom."/cache_" |
|
351 | + . substr($this->mapCacheID, 0, 2)."/".substr($this->mapCacheID, 2, 2) |
|
352 | + . "/".substr($this->mapCacheID, 4); |
|
353 | 353 | } |
354 | - return $this->mapCacheFile . "." . $this->mapCacheExtension; |
|
354 | + return $this->mapCacheFile.".".$this->mapCacheExtension; |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
@@ -492,14 +492,14 @@ discard block |
||
492 | 492 | return $cached; |
493 | 493 | } |
494 | 494 | |
495 | - $_UA = 'Mozilla/4.0 (compatible; DokuWikiSpatial HTTP Client; ' . PHP_OS . ')'; |
|
495 | + $_UA = 'Mozilla/4.0 (compatible; DokuWikiSpatial HTTP Client; '.PHP_OS.')'; |
|
496 | 496 | if (function_exists("curl_init")) { |
497 | 497 | // use cUrl |
498 | 498 | $ch = curl_init(); |
499 | 499 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
500 | 500 | curl_setopt($ch, CURLOPT_USERAGENT, $_UA); |
501 | 501 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); |
502 | - curl_setopt($ch, CURLOPT_URL, $url . $this->apikey); |
|
502 | + curl_setopt($ch, CURLOPT_URL, $url.$this->apikey); |
|
503 | 503 | Logger::debug("StaticMap::fetchTile: getting: $url using curl_exec"); |
504 | 504 | $tile = curl_exec($ch); |
505 | 505 | curl_close($ch); |
@@ -509,21 +509,21 @@ discard block |
||
509 | 509 | $opts = array( |
510 | 510 | 'http' => array( |
511 | 511 | 'method' => "GET", |
512 | - 'header' => "Accept-language: en\r\n" . "User-Agent: $_UA\r\n" . "accept: image/png\r\n", |
|
512 | + 'header' => "Accept-language: en\r\n"."User-Agent: $_UA\r\n"."accept: image/png\r\n", |
|
513 | 513 | 'request_fulluri' => true |
514 | 514 | ) |
515 | 515 | ); |
516 | 516 | if (isset($conf['proxy']['host'], $conf['proxy']['port']) |
517 | 517 | && $conf['proxy']['host'] !== '' |
518 | 518 | && $conf['proxy']['port'] !== '') { |
519 | - $opts['http'] += ['proxy' => "tcp://" . $conf['proxy']['host'] . ":" . $conf['proxy']['port']]; |
|
519 | + $opts['http'] += ['proxy' => "tcp://".$conf['proxy']['host'].":".$conf['proxy']['port']]; |
|
520 | 520 | } |
521 | 521 | |
522 | 522 | $context = stream_context_create($opts); |
523 | 523 | Logger::debug( |
524 | 524 | "StaticMap::fetchTile: getting: $url . $this->apikey using file_get_contents and options $opts" |
525 | 525 | ); |
526 | - $tile = file_get_contents($url . $this->apikey, false, $context); |
|
526 | + $tile = file_get_contents($url.$this->apikey, false, $context); |
|
527 | 527 | } |
528 | 528 | if ($tile && $this->useTileCache) { |
529 | 529 | $this->writeTileToCache($url, $tile); |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | */ |
553 | 553 | public function tileUrlToFilename(string $url): string |
554 | 554 | { |
555 | - return $this->tileCacheBaseDir . "/" . substr($url, strpos($url, '/') + 1); |
|
555 | + return $this->tileCacheBaseDir."/".substr($url, strpos($url, '/') + 1); |
|
556 | 556 | } |
557 | 557 | |
558 | 558 | /** |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | $count = 0; |
591 | 591 | $color = imagecolorallocate($this->image, 0, 0, 0); |
592 | 592 | $bgcolor = imagecolorallocate($this->image, 200, 200, 200); |
593 | - $markerBaseDir = __DIR__ . '/icons'; |
|
593 | + $markerBaseDir = __DIR__.'/icons'; |
|
594 | 594 | $markerImageOffsetX = 0; |
595 | 595 | $markerImageOffsetY = 0; |
596 | 596 | $markerShadowOffsetX = 0; |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | if ($markerType) { |
611 | 611 | foreach ($this->markerPrototypes as $markerPrototype) { |
612 | 612 | if (preg_match($markerPrototype ['regex'], $markerType, $matches)) { |
613 | - $markerFilename = $matches [0] . $markerPrototype ['extension']; |
|
613 | + $markerFilename = $matches [0].$markerPrototype ['extension']; |
|
614 | 614 | if ($markerPrototype ['offsetImage']) { |
615 | 615 | list ($markerImageOffsetX, $markerImageOffsetY) = explode( |
616 | 616 | ",", |
@@ -628,14 +628,14 @@ discard block |
||
628 | 628 | } |
629 | 629 | } |
630 | 630 | // create img resource |
631 | - if (file_exists($markerBaseDir . '/' . $markerFilename)) { |
|
632 | - $markerImg = imagecreatefrompng($markerBaseDir . '/' . $markerFilename); |
|
631 | + if (file_exists($markerBaseDir.'/'.$markerFilename)) { |
|
632 | + $markerImg = imagecreatefrompng($markerBaseDir.'/'.$markerFilename); |
|
633 | 633 | } else { |
634 | - $markerImg = imagecreatefrompng($markerBaseDir . '/marker.png'); |
|
634 | + $markerImg = imagecreatefrompng($markerBaseDir.'/marker.png'); |
|
635 | 635 | } |
636 | 636 | // check for shadow + create shadow recource |
637 | - if ($markerShadow && file_exists($markerBaseDir . '/' . $markerShadow)) { |
|
638 | - $markerShadowImg = imagecreatefrompng($markerBaseDir . '/' . $markerShadow); |
|
637 | + if ($markerShadow && file_exists($markerBaseDir.'/'.$markerShadow)) { |
|
638 | + $markerShadowImg = imagecreatefrompng($markerBaseDir.'/'.$markerShadow); |
|
639 | 639 | } |
640 | 640 | // calc position |
641 | 641 | $destX = floor( |
@@ -651,8 +651,8 @@ discard block |
||
651 | 651 | imagecopy( |
652 | 652 | $this->image, |
653 | 653 | $markerShadowImg, |
654 | - $destX + (int)$markerShadowOffsetX, |
|
655 | - $destY + (int)$markerShadowOffsetY, |
|
654 | + $destX + (int) $markerShadowOffsetX, |
|
655 | + $destY + (int) $markerShadowOffsetY, |
|
656 | 656 | 0, |
657 | 657 | 0, |
658 | 658 | imagesx($markerShadowImg), |
@@ -663,8 +663,8 @@ discard block |
||
663 | 663 | imagecopy( |
664 | 664 | $this->image, |
665 | 665 | $markerImg, |
666 | - $destX + (int)$markerImageOffsetX, |
|
667 | - $destY + (int)$markerImageOffsetY, |
|
666 | + $destX + (int) $markerImageOffsetX, |
|
667 | + $destY + (int) $markerImageOffsetY, |
|
668 | 668 | 0, |
669 | 669 | 0, |
670 | 670 | imagesx($markerImg), |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | $this->image, |
676 | 676 | 3, |
677 | 677 | $destX - imagesx($markerImg) + 1, |
678 | - $destY + (int)$markerImageOffsetY + 1, |
|
678 | + $destY + (int) $markerImageOffsetY + 1, |
|
679 | 679 | ++$count, |
680 | 680 | $bgcolor |
681 | 681 | ); |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | $this->image, |
684 | 684 | 3, |
685 | 685 | $destX - imagesx($markerImg), |
686 | - $destY + (int)$markerImageOffsetY, |
|
686 | + $destY + (int) $markerImageOffsetY, |
|
687 | 687 | $count, |
688 | 688 | $color |
689 | 689 | ); |
@@ -865,8 +865,8 @@ discard block |
||
865 | 865 | */ |
866 | 866 | public function drawCopyright() |
867 | 867 | { |
868 | - $logoBaseDir = dirname(__FILE__) . '/' . 'logo/'; |
|
869 | - $logoImg = imagecreatefrompng($logoBaseDir . $this->tileInfo ['openstreetmap'] ['logo']); |
|
868 | + $logoBaseDir = dirname(__FILE__).'/'.'logo/'; |
|
869 | + $logoImg = imagecreatefrompng($logoBaseDir.$this->tileInfo ['openstreetmap'] ['logo']); |
|
870 | 870 | $textcolor = imagecolorallocate($this->image, 0, 0, 0); |
871 | 871 | $bgcolor = imagecolorallocate($this->image, 200, 200, 200); |
872 | 872 | |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | $mapAuthor = "(c) OpenStreetMap maps/CC BY-SA"; |
904 | 904 | } else { |
905 | 905 | $mapAuthor = $this->tileInfo [$this->maptype] ['txt']; |
906 | - $iconImg = imagecreatefrompng($logoBaseDir . $this->tileInfo [$this->maptype] ['logo']); |
|
906 | + $iconImg = imagecreatefrompng($logoBaseDir.$this->tileInfo [$this->maptype] ['logo']); |
|
907 | 907 | $xIconOffset = imagesx($iconImg); |
908 | 908 | imagecopy( |
909 | 909 | $this->image, |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | if (!$this->getConf('bingAPIKey')) { |
127 | 127 | // in case there is no Bing api key we'll use OSM |
128 | 128 | $_firstimageID = $this->getStaticOSM($gmap, $overlay); |
129 | - $imgUrl .= $_firstimageID; |
|
129 | + $imgUrl .= $_firstimageID; |
|
130 | 130 | if ($this->getConf('optionStaticMapGenerator') == 'remote') { |
131 | 131 | $imgUrl .= "&.png"; |
132 | 132 | } |
133 | 133 | } else { |
134 | 134 | // seems that Bing doesn't like the DW client, turn off caching |
135 | 135 | $_nocache = true; |
136 | - $imgUrl .= $this->getBing($gmap, $overlay) . "&.png"; |
|
136 | + $imgUrl .= $this->getBing($gmap, $overlay)."&.png"; |
|
137 | 137 | } |
138 | 138 | } /* elseif (stripos ( $gmap ['baselyr'], 'mapquest' ) !== false) { |
139 | 139 | // MapQuest |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | } */ else { |
152 | 152 | // default OSM |
153 | 153 | $_firstimageID = $this->getStaticOSM($gmap, $overlay); |
154 | - $imgUrl .= $_firstimageID; |
|
154 | + $imgUrl .= $_firstimageID; |
|
155 | 155 | if ($this->getConf('optionStaticMapGenerator') == 'remote') { |
156 | 156 | $imgUrl .= "&.png"; |
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
160 | 160 | // append dw p_render specific params and render |
161 | - $imgUrl .= "?" . str_replace("px", "", $gmap ['width']) . "x" |
|
161 | + $imgUrl .= "?".str_replace("px", "", $gmap ['width'])."x" |
|
162 | 162 | . str_replace("px", "", $gmap ['height']); |
163 | 163 | $imgUrl .= "&nolink"; |
164 | 164 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $imgUrl .= "&nocache"; |
168 | 168 | } |
169 | 169 | |
170 | - $imgUrl .= " |" . $gmap ['summary'] . " }}"; |
|
170 | + $imgUrl .= " |".$gmap ['summary']." }}"; |
|
171 | 171 | |
172 | 172 | // Logger::debug("complete image tags is:",$imgUrl); |
173 | 173 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | // create a javascript parameter string for the map |
176 | 176 | $param = ''; |
177 | 177 | foreach ($gmap as $key => $val) { |
178 | - $param .= is_numeric($val) ? "$key: $val, " : "$key: '" . hsc($val) . "', "; |
|
178 | + $param .= is_numeric($val) ? "$key: $val, " : "$key: '".hsc($val)."', "; |
|
179 | 179 | } |
180 | 180 | if (!empty ($param)) { |
181 | 181 | $param = substr($param, 0, -2); |
@@ -202,12 +202,12 @@ discard block |
||
202 | 202 | |
203 | 203 | $poitable .= ' |
204 | 204 | <tr> |
205 | - <td class="rowId">' . $rowId . '</td> |
|
206 | - <td class="icon"><img src="' . DOKU_BASE . 'lib/plugins/openlayersmap/icons/' . $img . '" alt="' |
|
207 | - . substr($img, 0, -4) . $this->getlang('alt_legend_poi') . '" /></td> |
|
208 | - <td class="lat" title="' . $this->getLang('olmapPOIlatTitle') . '">' . $lat . '</td> |
|
209 | - <td class="lon" title="' . $this->getLang('olmapPOIlonTitle') . '">' . $lon . '</td> |
|
210 | - <td class="txt">' . $text . '</td> |
|
205 | + <td class="rowId">' . $rowId.'</td> |
|
206 | + <td class="icon"><img src="' . DOKU_BASE.'lib/plugins/openlayersmap/icons/'.$img.'" alt="' |
|
207 | + . substr($img, 0, -4).$this->getlang('alt_legend_poi').'" /></td> |
|
208 | + <td class="lat" title="' . $this->getLang('olmapPOIlatTitle').'">'.$lat.'</td> |
|
209 | + <td class="lon" title="' . $this->getLang('olmapPOIlonTitle').'">'.$lon.'</td> |
|
210 | + <td class="txt">' . $text.'</td> |
|
211 | 211 | </tr>'; |
212 | 212 | } |
213 | 213 | $poi = substr($poi, 2); |
@@ -217,9 +217,9 @@ discard block |
||
217 | 217 | <tr> |
218 | 218 | <td class="rowId"><img src="' . DOKU_BASE |
219 | 219 | . 'lib/plugins/openlayersmap/toolbar/kml_file.png" alt="KML file" /></td> |
220 | - <td class="icon"><img src="' . DOKU_BASE . 'lib/plugins/openlayersmap/toolbar/kml_line.png" alt="' |
|
221 | - . $this->getlang('alt_legend_kml') . '" /></td> |
|
222 | - <td class="txt" colspan="3">KML track: ' . $this->getFileName($gmap ['kmlfile']) . '</td> |
|
220 | + <td class="icon"><img src="' . DOKU_BASE.'lib/plugins/openlayersmap/toolbar/kml_line.png" alt="' |
|
221 | + . $this->getlang('alt_legend_kml').'" /></td> |
|
222 | + <td class="txt" colspan="3">KML track: ' . $this->getFileName($gmap ['kmlfile']).'</td> |
|
223 | 223 | </tr>'; |
224 | 224 | } |
225 | 225 | if (!empty ($gmap ['gpxfile'])) { |
@@ -229,8 +229,8 @@ discard block |
||
229 | 229 | . 'lib/plugins/openlayersmap/toolbar/gpx_file.png" alt="GPX file" /></td> |
230 | 230 | <td class="icon"><img src="' . DOKU_BASE |
231 | 231 | . 'lib/plugins/openlayersmap/toolbar/gpx_line.png" alt="' |
232 | - . $this->getlang('alt_legend_gpx') . '" /></td> |
|
233 | - <td class="txt" colspan="3">GPX track: ' . $this->getFileName($gmap ['gpxfile']) . '</td> |
|
232 | + . $this->getlang('alt_legend_gpx').'" /></td> |
|
233 | + <td class="txt" colspan="3">GPX track: ' . $this->getFileName($gmap ['gpxfile']).'</td> |
|
234 | 234 | </tr>'; |
235 | 235 | } |
236 | 236 | if (!empty ($gmap ['geojsonfile'])) { |
@@ -240,14 +240,14 @@ discard block |
||
240 | 240 | . 'lib/plugins/openlayersmap/toolbar/geojson_file.png" alt="GeoJSON file" /></td> |
241 | 241 | <td class="icon"><img src="' . DOKU_BASE |
242 | 242 | . 'lib/plugins/openlayersmap/toolbar/geojson_line.png" alt="' |
243 | - . $this->getlang('alt_legend_geojson') . '" /></td> |
|
244 | - <td class="txt" colspan="3">GeoJSON track: ' . $this->getFileName($gmap ['geojsonfile']) . '</td> |
|
243 | + . $this->getlang('alt_legend_geojson').'" /></td> |
|
244 | + <td class="txt" colspan="3">GeoJSON track: ' . $this->getFileName($gmap ['geojsonfile']).'</td> |
|
245 | 245 | </tr>'; |
246 | 246 | } |
247 | 247 | |
248 | 248 | $autozoom = empty ($gmap ['autozoom']) ? $this->getConf('autoZoomMap') : $gmap ['autozoom']; |
249 | - $js = "{mapOpts: {" . $param . ", displayformat: '" . $this->getConf('displayformat') |
|
250 | - . "', autozoom: " . $autozoom . "}, poi: [$poi]};"; |
|
249 | + $js = "{mapOpts: {".$param.", displayformat: '".$this->getConf('displayformat') |
|
250 | + . "', autozoom: ".$autozoom."}, poi: [$poi]};"; |
|
251 | 251 | // unescape the json |
252 | 252 | $poitable = stripslashes($poitable); |
253 | 253 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | // parse match for instructions, break into key value pairs |
278 | 278 | $gmap = $this->dflt; |
279 | 279 | foreach ($gmap as $key => &$value) { |
280 | - $defval = $this->getConf('default_' . $key); |
|
280 | + $defval = $this->getConf('default_'.$key); |
|
281 | 281 | if ($defval !== '') { |
282 | 282 | $value = $defval; |
283 | 283 | } |
@@ -387,29 +387,29 @@ discard block |
||
387 | 387 | // see: https://developers.google.com/maps/documentation/staticmaps/index#Viewports |
388 | 388 | // 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 |
389 | 389 | $imgUrl = "https://maps.googleapis.com/maps/api/staticmap?"; |
390 | - $imgUrl .= "&size=" . str_replace("px", "", $gmap ['width']) . "x" |
|
390 | + $imgUrl .= "&size=".str_replace("px", "", $gmap ['width'])."x" |
|
391 | 391 | . str_replace("px", "", $gmap ['height']); |
392 | 392 | //if (!$this->getConf( 'autoZoomMap')) { // no need for center & zoom params } |
393 | - $imgUrl .= "¢er=" . $gmap ['lat'] . "," . $gmap ['lon']; |
|
393 | + $imgUrl .= "¢er=".$gmap ['lat'].",".$gmap ['lon']; |
|
394 | 394 | // max is 21 (== building scale), but that's overkill.. |
395 | 395 | if ($gmap ['zoom'] > 17) { |
396 | 396 | $imgUrl .= "&zoom=17"; |
397 | 397 | } else { |
398 | - $imgUrl .= "&zoom=" . $gmap ['zoom']; |
|
398 | + $imgUrl .= "&zoom=".$gmap ['zoom']; |
|
399 | 399 | } |
400 | 400 | if (!empty ($overlay)) { |
401 | 401 | $rowId = 0; |
402 | 402 | foreach ($overlay as $data) { |
403 | 403 | list ($lat, $lon, $text, $angle, $opacity, $img) = $data; |
404 | - $imgUrl .= "&markers=icon%3a" . $sUrl . "lib/plugins/openlayersmap/icons/" . $img . "%7c" |
|
405 | - . $lat . "," . $lon . "%7clabel%3a" . ++$rowId; |
|
404 | + $imgUrl .= "&markers=icon%3a".$sUrl."lib/plugins/openlayersmap/icons/".$img."%7c" |
|
405 | + . $lat.",".$lon."%7clabel%3a".++$rowId; |
|
406 | 406 | } |
407 | 407 | } |
408 | - $imgUrl .= "&format=png&maptype=" . $maptype; |
|
408 | + $imgUrl .= "&format=png&maptype=".$maptype; |
|
409 | 409 | global $conf; |
410 | - $imgUrl .= "&language=" . $conf ['lang']; |
|
410 | + $imgUrl .= "&language=".$conf ['lang']; |
|
411 | 411 | if ($this->getConf('googleAPIkey')) { |
412 | - $imgUrl .= "&key=" . $this->getConf('googleAPIkey'); |
|
412 | + $imgUrl .= "&key=".$this->getConf('googleAPIkey'); |
|
413 | 413 | } |
414 | 414 | // Logger::debug('syntax_plugin_openlayersmap_olmap::getGoogle: Google image url is:',$imgUrl); |
415 | 415 | return $imgUrl; |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | if (!$geophp = plugin_load('helper', 'geophp')) { |
503 | 503 | Logger::debug('geophp plugin is not available for use.', $geophp); |
504 | 504 | } |
505 | - $size = str_replace("px", "", $gmap ['width']) . "x" |
|
505 | + $size = str_replace("px", "", $gmap ['width'])."x" |
|
506 | 506 | . str_replace("px", "", $gmap ['height']); |
507 | 507 | |
508 | 508 | $markers = array(); |
@@ -526,19 +526,19 @@ discard block |
||
526 | 526 | break; |
527 | 527 | case 'transport' : |
528 | 528 | $maptype = 'transport'; |
529 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
529 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
530 | 530 | break; |
531 | 531 | case 'landscape' : |
532 | 532 | $maptype = 'landscape'; |
533 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
533 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
534 | 534 | break; |
535 | 535 | case 'outdoors' : |
536 | 536 | $maptype = 'outdoors'; |
537 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
537 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
538 | 538 | break; |
539 | 539 | case 'cycle map' : |
540 | 540 | $maptype = 'cycle'; |
541 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
541 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
542 | 542 | break; |
543 | 543 | case 'hike and bike map' : |
544 | 544 | $maptype = 'hikeandbike'; |
@@ -575,25 +575,25 @@ discard block |
||
575 | 575 | // ol-marker|47.921629720114,18.027343747285,ol-marker-gold|47.951071133739,19.257812497236, |
576 | 576 | // ol-marker-blue|47.180141361692,19.257812497236,ol-marker-green |
577 | 577 | $imgUrl = "https://staticmap.openstreetmap.de/staticmap.php"; |
578 | - $imgUrl .= "?center=" . $gmap ['lat'] . "," . $gmap ['lon']; |
|
579 | - $imgUrl .= "&size=" . str_replace("px", "", $gmap ['width']) . "x" |
|
578 | + $imgUrl .= "?center=".$gmap ['lat'].",".$gmap ['lon']; |
|
579 | + $imgUrl .= "&size=".str_replace("px", "", $gmap ['width'])."x" |
|
580 | 580 | . str_replace("px", "", $gmap ['height']); |
581 | 581 | |
582 | 582 | if ($gmap ['zoom'] > 16) { |
583 | 583 | // actually this could even be 18, but that seems overkill |
584 | 584 | $imgUrl .= "&zoom=16"; |
585 | 585 | } else { |
586 | - $imgUrl .= "&zoom=" . $gmap ['zoom']; |
|
586 | + $imgUrl .= "&zoom=".$gmap ['zoom']; |
|
587 | 587 | } |
588 | 588 | |
589 | 589 | if (!empty ($overlay)) { |
590 | - $rowId = 0; |
|
590 | + $rowId = 0; |
|
591 | 591 | $imgUrl .= "&markers="; |
592 | 592 | foreach ($overlay as $data) { |
593 | 593 | list ($lat, $lon, $text, $angle, $opacity, $img) = $data; |
594 | 594 | $rowId++; |
595 | 595 | $iconStyle = "lightblue$rowId"; |
596 | - $imgUrl .= "$lat,$lon,$iconStyle%7c"; |
|
596 | + $imgUrl .= "$lat,$lon,$iconStyle%7c"; |
|
597 | 597 | } |
598 | 598 | $imgUrl = substr($imgUrl, 0, -3); |
599 | 599 | } |
@@ -630,13 +630,13 @@ discard block |
||
630 | 630 | $maptype = 'Road'; |
631 | 631 | break; |
632 | 632 | } |
633 | - $imgUrl = "https://dev.virtualearth.net/REST/v1/Imagery/Map/" . $maptype;// . "/"; |
|
633 | + $imgUrl = "https://dev.virtualearth.net/REST/v1/Imagery/Map/".$maptype; // . "/"; |
|
634 | 634 | if ($this->getConf('autoZoomMap')) { |
635 | 635 | $bbox = $this->calcBBOX($overlay, $gmap ['lat'], $gmap ['lon']); |
636 | 636 | //$imgUrl .= "?ma=" . $bbox ['minlat'] . "," . $bbox ['minlon'] . "," |
637 | 637 | // . $bbox ['maxlat'] . "," . $bbox ['maxlon']; |
638 | - $imgUrl .= "?ma=" . $bbox ['minlat'] . "%2C" . $bbox ['minlon'] . "%2C" . $bbox ['maxlat'] |
|
639 | - . "%2C" . $bbox ['maxlon']; |
|
638 | + $imgUrl .= "?ma=".$bbox ['minlat']."%2C".$bbox ['minlon']."%2C".$bbox ['maxlat'] |
|
639 | + . "%2C".$bbox ['maxlon']; |
|
640 | 640 | $imgUrl .= "&dcl=1"; |
641 | 641 | } |
642 | 642 | if (strpos($imgUrl, "?") === false) { |
@@ -645,9 +645,9 @@ discard block |
||
645 | 645 | |
646 | 646 | //$imgUrl .= "&ms=" . str_replace ( "px", "", $gmap ['width'] ) . "," |
647 | 647 | // . str_replace ( "px", "", $gmap ['height'] ); |
648 | - $imgUrl .= "&ms=" . str_replace("px", "", $gmap ['width']) . "%2C" |
|
648 | + $imgUrl .= "&ms=".str_replace("px", "", $gmap ['width'])."%2C" |
|
649 | 649 | . str_replace("px", "", $gmap ['height']); |
650 | - $imgUrl .= "&key=" . $this->getConf('bingAPIKey'); |
|
650 | + $imgUrl .= "&key=".$this->getConf('bingAPIKey'); |
|
651 | 651 | if (!empty ($overlay)) { |
652 | 652 | $rowId = 0; |
653 | 653 | foreach ($overlay as $data) { |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | } |
667 | 667 | global $conf; |
668 | 668 | $imgUrl .= "&fmt=png"; |
669 | - $imgUrl .= "&c=" . $conf ['lang']; |
|
669 | + $imgUrl .= "&c=".$conf ['lang']; |
|
670 | 670 | // Logger::debug('syntax_plugin_openlayersmap_olmap::getBing: bing image url is:',$imgUrl); |
671 | 671 | return $imgUrl; |
672 | 672 | } |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | $latPos = "N"; |
722 | 722 | } |
723 | 723 | $dms = $this->convertDDtoDMS(abs($decimaldegrees)); |
724 | - return hsc($dms . $latPos); |
|
724 | + return hsc($dms.$latPos); |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | /** |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | $secs = ($decimaldegrees - $dms) * 3600; |
738 | 738 | $min = floor($secs / 60); |
739 | 739 | $sec = round($secs - ($min * 60), 3); |
740 | - $dms .= 'º' . $min . '\'' . $sec . '"'; |
|
740 | + $dms .= 'º'.$min.'\''.$sec.'"'; |
|
741 | 741 | return $dms; |
742 | 742 | } |
743 | 743 | |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | $lonPos = "E"; |
757 | 757 | } |
758 | 758 | $dms = $this->convertDDtoDMS(abs($decimaldegrees)); |
759 | - return hsc($dms . $lonPos); |
|
759 | + return hsc($dms.$lonPos); |
|
760 | 760 | } |
761 | 761 | |
762 | 762 | /** |
@@ -804,51 +804,51 @@ discard block |
||
804 | 804 | // render necessary script tags |
805 | 805 | if ($gEnable) { |
806 | 806 | $gscript = '<script defer="defer" src="//maps.google.com/maps/api/js?v=3.29&key=' |
807 | - . $this->getConf('googleAPIkey') . '"></script>'; |
|
807 | + . $this->getConf('googleAPIkey').'"></script>'; |
|
808 | 808 | } |
809 | - $olscript = '<script defer="defer" src="' . DOKU_BASE |
|
809 | + $olscript = '<script defer="defer" src="'.DOKU_BASE |
|
810 | 810 | . 'lib/plugins/openlayersmap/lib/OpenLayers.js"></script>'; |
811 | 811 | |
812 | 812 | $scriptEnable = '<script defer="defer" src="data:text/javascript;base64,'; |
813 | 813 | $scriptSrc = $olscript ? 'olEnable = true;' : 'olEnable = false;'; |
814 | - $scriptSrc .= 'gEnable = ' . ($gEnable ? 'true' : 'false') . ';'; |
|
815 | - $scriptSrc .= 'osmEnable = ' . ($osmEnable ? 'true' : 'false') . ';'; |
|
816 | - $scriptSrc .= 'stamenEnable = ' . ($stamenEnable ? 'true' : 'false') . ';'; |
|
817 | - $scriptSrc .= 'bEnable = ' . ($enableBing ? 'true' : 'false') . ';'; |
|
818 | - $scriptSrc .= 'bApiKey="' . $this->getConf('bingAPIKey') . '";'; |
|
819 | - $scriptSrc .= 'tfApiKey="' . $this->getConf('tfApiKey') . '";'; |
|
820 | - $scriptSrc .= 'gApiKey="' . $this->getConf('googleAPIkey') . '";'; |
|
814 | + $scriptSrc .= 'gEnable = '.($gEnable ? 'true' : 'false').';'; |
|
815 | + $scriptSrc .= 'osmEnable = '.($osmEnable ? 'true' : 'false').';'; |
|
816 | + $scriptSrc .= 'stamenEnable = '.($stamenEnable ? 'true' : 'false').';'; |
|
817 | + $scriptSrc .= 'bEnable = '.($enableBing ? 'true' : 'false').';'; |
|
818 | + $scriptSrc .= 'bApiKey="'.$this->getConf('bingAPIKey').'";'; |
|
819 | + $scriptSrc .= 'tfApiKey="'.$this->getConf('tfApiKey').'";'; |
|
820 | + $scriptSrc .= 'gApiKey="'.$this->getConf('googleAPIkey').'";'; |
|
821 | 821 | $scriptEnable .= base64_encode($scriptSrc); |
822 | 822 | $scriptEnable .= '"></script>'; |
823 | 823 | } |
824 | 824 | $renderer->doc .= "$gscript\n$olscript\n$scriptEnable"; |
825 | - $renderer->doc .= '<div class="olMapHelp">' . $this->locale_xhtml("help") . '</div>'; |
|
825 | + $renderer->doc .= '<div class="olMapHelp">'.$this->locale_xhtml("help").'</div>'; |
|
826 | 826 | if ($this->getConf('enableA11y')) { |
827 | - $renderer->doc .= '<div id="' . $mapid . '-static" class="olStaticMap">' |
|
828 | - . p_render($format, p_get_instructions($staticImgUrl), $info) . '</div>'; |
|
827 | + $renderer->doc .= '<div id="'.$mapid.'-static" class="olStaticMap">' |
|
828 | + . p_render($format, p_get_instructions($staticImgUrl), $info).'</div>'; |
|
829 | 829 | } |
830 | - $renderer->doc .= '<div id="' . $mapid . '-clearer" class="clearer"><p> </p></div>'; |
|
830 | + $renderer->doc .= '<div id="'.$mapid.'-clearer" class="clearer"><p> </p></div>'; |
|
831 | 831 | if ($this->getConf('enableA11y')) { |
832 | 832 | // render a table of the POI for the print and a11y presentation, it is hidden using javascript |
833 | - $renderer->doc .= '<div class="olPOItableSpan" id="' . $mapid . '-table-span"> |
|
834 | - <table class="olPOItable" id="' . $mapid . '-table"> |
|
835 | - <caption class="olPOITblCaption">' . $this->getLang('olmapPOItitle') . '</caption> |
|
833 | + $renderer->doc .= '<div class="olPOItableSpan" id="'.$mapid.'-table-span"> |
|
834 | + <table class="olPOItable" id="' . $mapid.'-table"> |
|
835 | + <caption class="olPOITblCaption">' . $this->getLang('olmapPOItitle').'</caption> |
|
836 | 836 | <thead class="olPOITblHeader"> |
837 | 837 | <tr> |
838 | 838 | <th class="rowId" scope="col">id</th> |
839 | - <th class="icon" scope="col">' . $this->getLang('olmapPOIicon') . '</th> |
|
840 | - <th class="lat" scope="col" title="' . $this->getLang('olmapPOIlatTitle') . '">' |
|
841 | - . $this->getLang('olmapPOIlat') . '</th> |
|
842 | - <th class="lon" scope="col" title="' . $this->getLang('olmapPOIlonTitle') . '">' |
|
843 | - . $this->getLang('olmapPOIlon') . '</th> |
|
844 | - <th class="txt" scope="col">' . $this->getLang('olmapPOItxt') . '</th> |
|
839 | + <th class="icon" scope="col">' . $this->getLang('olmapPOIicon').'</th> |
|
840 | + <th class="lat" scope="col" title="' . $this->getLang('olmapPOIlatTitle').'">' |
|
841 | + . $this->getLang('olmapPOIlat').'</th> |
|
842 | + <th class="lon" scope="col" title="' . $this->getLang('olmapPOIlonTitle').'">' |
|
843 | + . $this->getLang('olmapPOIlon').'</th> |
|
844 | + <th class="txt" scope="col">' . $this->getLang('olmapPOItxt').'</th> |
|
845 | 845 | </tr> |
846 | 846 | </thead>'; |
847 | 847 | if ($poitabledesc != '') { |
848 | - $renderer->doc .= '<tfoot class="olPOITblFooter"><tr><td colspan="5">' . $poitabledesc |
|
848 | + $renderer->doc .= '<tfoot class="olPOITblFooter"><tr><td colspan="5">'.$poitabledesc |
|
849 | 849 | . '</td></tr></tfoot>'; |
850 | 850 | } |
851 | - $renderer->doc .= '<tbody class="olPOITblBody">' . $poitable . '</tbody> |
|
851 | + $renderer->doc .= '<tbody class="olPOITblBody">'.$poitable.'</tbody> |
|
852 | 852 | </table></div>'; |
853 | 853 | } |
854 | 854 | // render inline mapscript parts |