@@ -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'), 0); |
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'), 0); |
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(); |
@@ -607,8 +607,9 @@ |
||
607 | 607 | . "%2C" . $bbox ['maxlon']; |
608 | 608 | $imgUrl .= "&dcl=1"; |
609 | 609 | } |
610 | - if (strpos($imgUrl, "?") === false) |
|
611 | - $imgUrl .= "?"; |
|
610 | + if (strpos($imgUrl, "?") === false) { |
|
611 | + $imgUrl .= "?"; |
|
612 | + } |
|
612 | 613 | |
613 | 614 | //$imgUrl .= "&ms=" . str_replace ( "px", "", $gmap ['width'] ) . "," |
614 | 615 | // . str_replace ( "px", "", $gmap ['height'] ); |
@@ -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 |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | } */ else { |
141 | 141 | // default OSM |
142 | 142 | $_firstimageID = $this->getStaticOSM($gmap, $overlay); |
143 | - $imgUrl .= $_firstimageID; |
|
143 | + $imgUrl .= $_firstimageID; |
|
144 | 144 | if ($this->getConf('optionStaticMapGenerator') == 'remote') { |
145 | 145 | $imgUrl .= "&.png"; |
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
149 | 149 | // append dw p_render specific params and render |
150 | - $imgUrl .= "?" . str_replace("px", "", $gmap ['width']) . "x" |
|
150 | + $imgUrl .= "?".str_replace("px", "", $gmap ['width'])."x" |
|
151 | 151 | . str_replace("px", "", $gmap ['height']); |
152 | 152 | $imgUrl .= "&nolink"; |
153 | 153 | |
@@ -156,13 +156,13 @@ discard block |
||
156 | 156 | $imgUrl .= "&nocache"; |
157 | 157 | } |
158 | 158 | |
159 | - $imgUrl .= " |" . $gmap ['summary'] . " }}"; |
|
159 | + $imgUrl .= " |".$gmap ['summary']." }}"; |
|
160 | 160 | |
161 | 161 | $mapid = $gmap ['id']; |
162 | 162 | // create a javascript parameter string for the map |
163 | 163 | $param = ''; |
164 | 164 | foreach ($gmap as $key => $val) { |
165 | - $param .= is_numeric($val) ? "$key: $val, " : "$key: '" . hsc($val) . "', "; |
|
165 | + $param .= is_numeric($val) ? "$key: $val, " : "$key: '".hsc($val)."', "; |
|
166 | 166 | } |
167 | 167 | if (!empty($param)) { |
168 | 168 | $param = substr($param, 0, -2); |
@@ -189,12 +189,12 @@ discard block |
||
189 | 189 | |
190 | 190 | $poitable .= ' |
191 | 191 | <tr> |
192 | - <td class="rowId">' . $rowId . '</td> |
|
193 | - <td class="icon"><img src="' . DOKU_BASE . 'lib/plugins/openlayersmap/icons/' . $img . '" alt="' |
|
194 | - . substr($img, 0, -4) . $this->getlang('alt_legend_poi') . '" /></td> |
|
195 | - <td class="lat" title="' . $this->getLang('olmapPOIlatTitle') . '">' . $lat . '</td> |
|
196 | - <td class="lon" title="' . $this->getLang('olmapPOIlonTitle') . '">' . $lon . '</td> |
|
197 | - <td class="txt">' . $text . '</td> |
|
192 | + <td class="rowId">' . $rowId.'</td> |
|
193 | + <td class="icon"><img src="' . DOKU_BASE.'lib/plugins/openlayersmap/icons/'.$img.'" alt="' |
|
194 | + . substr($img, 0, -4).$this->getlang('alt_legend_poi').'" /></td> |
|
195 | + <td class="lat" title="' . $this->getLang('olmapPOIlatTitle').'">'.$lat.'</td> |
|
196 | + <td class="lon" title="' . $this->getLang('olmapPOIlonTitle').'">'.$lon.'</td> |
|
197 | + <td class="txt">' . $text.'</td> |
|
198 | 198 | </tr>'; |
199 | 199 | } |
200 | 200 | $poi = substr($poi, 2); |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | <tr> |
205 | 205 | <td class="rowId"><img src="' . DOKU_BASE |
206 | 206 | . 'lib/plugins/openlayersmap/toolbar/kml_file.png" alt="KML file" /></td> |
207 | - <td class="icon"><img src="' . DOKU_BASE . 'lib/plugins/openlayersmap/toolbar/kml_line.png" alt="' |
|
208 | - . $this->getlang('alt_legend_kml') . '" /></td> |
|
209 | - <td class="txt" colspan="3">KML track: ' . $this->getFileName($gmap ['kmlfile']) . '</td> |
|
207 | + <td class="icon"><img src="' . DOKU_BASE.'lib/plugins/openlayersmap/toolbar/kml_line.png" alt="' |
|
208 | + . $this->getlang('alt_legend_kml').'" /></td> |
|
209 | + <td class="txt" colspan="3">KML track: ' . $this->getFileName($gmap ['kmlfile']).'</td> |
|
210 | 210 | </tr>'; |
211 | 211 | } |
212 | 212 | if (!empty($gmap ['gpxfile'])) { |
@@ -216,8 +216,8 @@ discard block |
||
216 | 216 | . 'lib/plugins/openlayersmap/toolbar/gpx_file.png" alt="GPX file" /></td> |
217 | 217 | <td class="icon"><img src="' . DOKU_BASE |
218 | 218 | . 'lib/plugins/openlayersmap/toolbar/gpx_line.png" alt="' |
219 | - . $this->getlang('alt_legend_gpx') . '" /></td> |
|
220 | - <td class="txt" colspan="3">GPX track: ' . $this->getFileName($gmap ['gpxfile']) . '</td> |
|
219 | + . $this->getlang('alt_legend_gpx').'" /></td> |
|
220 | + <td class="txt" colspan="3">GPX track: ' . $this->getFileName($gmap ['gpxfile']).'</td> |
|
221 | 221 | </tr>'; |
222 | 222 | } |
223 | 223 | if (!empty($gmap ['geojsonfile'])) { |
@@ -227,14 +227,14 @@ discard block |
||
227 | 227 | . 'lib/plugins/openlayersmap/toolbar/geojson_file.png" alt="GeoJSON file" /></td> |
228 | 228 | <td class="icon"><img src="' . DOKU_BASE |
229 | 229 | . 'lib/plugins/openlayersmap/toolbar/geojson_line.png" alt="' |
230 | - . $this->getlang('alt_legend_geojson') . '" /></td> |
|
231 | - <td class="txt" colspan="3">GeoJSON track: ' . $this->getFileName($gmap ['geojsonfile']) . '</td> |
|
230 | + . $this->getlang('alt_legend_geojson').'" /></td> |
|
231 | + <td class="txt" colspan="3">GeoJSON track: ' . $this->getFileName($gmap ['geojsonfile']).'</td> |
|
232 | 232 | </tr>'; |
233 | 233 | } |
234 | 234 | |
235 | 235 | $autozoom = empty($gmap ['autozoom']) ? $this->getConf('autoZoomMap') : $gmap ['autozoom']; |
236 | - $js = "{mapOpts: {" . $param . ", displayformat: '" . $this->getConf('displayformat') |
|
237 | - . "', autozoom: " . $autozoom . "}, poi: [$poi]};"; |
|
236 | + $js = "{mapOpts: {".$param.", displayformat: '".$this->getConf('displayformat') |
|
237 | + . "', autozoom: ".$autozoom."}, poi: [$poi]};"; |
|
238 | 238 | // unescape the json |
239 | 239 | $poitable = stripslashes($poitable); |
240 | 240 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | // parse match for instructions, break into key value pairs |
256 | 256 | $gmap = $this->dflt; |
257 | 257 | foreach ($gmap as $key => &$value) { |
258 | - $defval = $this->getConf('default_' . $key); |
|
258 | + $defval = $this->getConf('default_'.$key); |
|
259 | 259 | if ($defval !== '') { |
260 | 260 | $value = $defval; |
261 | 261 | } |
@@ -357,29 +357,29 @@ discard block |
||
357 | 357 | // see: https://developers.google.com/maps/documentation/staticmaps/index#Viewports |
358 | 358 | // 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 |
359 | 359 | $imgUrl = "https://maps.googleapis.com/maps/api/staticmap?"; |
360 | - $imgUrl .= "&size=" . str_replace("px", "", $gmap ['width']) . "x" |
|
360 | + $imgUrl .= "&size=".str_replace("px", "", $gmap ['width'])."x" |
|
361 | 361 | . str_replace("px", "", $gmap ['height']); |
362 | 362 | //if (!$this->getConf( 'autoZoomMap')) { // no need for center & zoom params } |
363 | - $imgUrl .= "¢er=" . $gmap ['lat'] . "," . $gmap ['lon']; |
|
363 | + $imgUrl .= "¢er=".$gmap ['lat'].",".$gmap ['lon']; |
|
364 | 364 | // max is 21 (== building scale), but that's overkill.. |
365 | 365 | if ($gmap ['zoom'] > 17) { |
366 | 366 | $imgUrl .= "&zoom=17"; |
367 | 367 | } else { |
368 | - $imgUrl .= "&zoom=" . $gmap ['zoom']; |
|
368 | + $imgUrl .= "&zoom=".$gmap ['zoom']; |
|
369 | 369 | } |
370 | 370 | if ($overlay !== []) { |
371 | 371 | $rowId = 0; |
372 | 372 | foreach ($overlay as $data) { |
373 | 373 | [$lat, $lon, $text, $angle, $opacity, $img] = $data; |
374 | - $imgUrl .= "&markers=icon%3a" . $sUrl . "lib/plugins/openlayersmap/icons/" . $img . "%7c" |
|
375 | - . $lat . "," . $lon . "%7clabel%3a" . ++$rowId; |
|
374 | + $imgUrl .= "&markers=icon%3a".$sUrl."lib/plugins/openlayersmap/icons/".$img."%7c" |
|
375 | + . $lat.",".$lon."%7clabel%3a".++$rowId; |
|
376 | 376 | } |
377 | 377 | } |
378 | - $imgUrl .= "&format=png&maptype=" . $maptype; |
|
378 | + $imgUrl .= "&format=png&maptype=".$maptype; |
|
379 | 379 | global $conf; |
380 | - $imgUrl .= "&language=" . $conf ['lang']; |
|
380 | + $imgUrl .= "&language=".$conf ['lang']; |
|
381 | 381 | if ($this->getConf('googleAPIkey')) { |
382 | - $imgUrl .= "&key=" . $this->getConf('googleAPIkey'); |
|
382 | + $imgUrl .= "&key=".$this->getConf('googleAPIkey'); |
|
383 | 383 | } |
384 | 384 | return $imgUrl; |
385 | 385 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | if (($geophp = plugin_load('helper', 'geophp')) === null) { |
473 | 473 | Logger::debug('geophp plugin is not available for use.', $geophp); |
474 | 474 | } |
475 | - $size = str_replace("px", "", $gmap ['width']) . "x" |
|
475 | + $size = str_replace("px", "", $gmap ['width'])."x" |
|
476 | 476 | . str_replace("px", "", $gmap ['height']); |
477 | 477 | |
478 | 478 | $markers = []; |
@@ -492,19 +492,19 @@ discard block |
||
492 | 492 | break; |
493 | 493 | case 'transport': |
494 | 494 | $maptype = 'transport'; |
495 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
495 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
496 | 496 | break; |
497 | 497 | case 'landscape': |
498 | 498 | $maptype = 'landscape'; |
499 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
499 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
500 | 500 | break; |
501 | 501 | case 'outdoors': |
502 | 502 | $maptype = 'outdoors'; |
503 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
503 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
504 | 504 | break; |
505 | 505 | case 'cycle map': |
506 | 506 | $maptype = 'cycle'; |
507 | - $apikey = '?apikey=' . $this->getConf('tfApiKey'); |
|
507 | + $apikey = '?apikey='.$this->getConf('tfApiKey'); |
|
508 | 508 | break; |
509 | 509 | case 'hike and bike map': |
510 | 510 | $maptype = 'hikeandbike'; |
@@ -541,25 +541,25 @@ discard block |
||
541 | 541 | // ol-marker|47.921629720114,18.027343747285,ol-marker-gold|47.951071133739,19.257812497236, |
542 | 542 | // ol-marker-blue|47.180141361692,19.257812497236,ol-marker-green |
543 | 543 | $imgUrl = "https://staticmap.openstreetmap.de/staticmap.php"; |
544 | - $imgUrl .= "?center=" . $gmap ['lat'] . "," . $gmap ['lon']; |
|
545 | - $imgUrl .= "&size=" . str_replace("px", "", $gmap ['width']) . "x" |
|
544 | + $imgUrl .= "?center=".$gmap ['lat'].",".$gmap ['lon']; |
|
545 | + $imgUrl .= "&size=".str_replace("px", "", $gmap ['width'])."x" |
|
546 | 546 | . str_replace("px", "", $gmap ['height']); |
547 | 547 | |
548 | 548 | if ($gmap ['zoom'] > 16) { |
549 | 549 | // actually this could even be 18, but that seems overkill |
550 | 550 | $imgUrl .= "&zoom=16"; |
551 | 551 | } else { |
552 | - $imgUrl .= "&zoom=" . $gmap ['zoom']; |
|
552 | + $imgUrl .= "&zoom=".$gmap ['zoom']; |
|
553 | 553 | } |
554 | 554 | |
555 | 555 | if ($overlay !== []) { |
556 | - $rowId = 0; |
|
556 | + $rowId = 0; |
|
557 | 557 | $imgUrl .= "&markers="; |
558 | 558 | foreach ($overlay as $data) { |
559 | 559 | [$lat, $lon, $text, $angle, $opacity, $img] = $data; |
560 | 560 | $rowId++; |
561 | 561 | $iconStyle = "lightblue$rowId"; |
562 | - $imgUrl .= "$lat,$lon,$iconStyle%7c"; |
|
562 | + $imgUrl .= "$lat,$lon,$iconStyle%7c"; |
|
563 | 563 | } |
564 | 564 | $imgUrl = substr($imgUrl, 0, -3); |
565 | 565 | } |
@@ -594,13 +594,13 @@ discard block |
||
594 | 594 | $maptype = 'Road'; |
595 | 595 | break; |
596 | 596 | } |
597 | - $imgUrl = "https://dev.virtualearth.net/REST/v1/Imagery/Map/" . $maptype;// . "/"; |
|
597 | + $imgUrl = "https://dev.virtualearth.net/REST/v1/Imagery/Map/".$maptype; // . "/"; |
|
598 | 598 | if ($this->getConf('autoZoomMap')) { |
599 | 599 | $bbox = $this->calcBBOX($overlay, $gmap ['lat'], $gmap ['lon']); |
600 | 600 | //$imgUrl .= "?ma=" . $bbox ['minlat'] . "," . $bbox ['minlon'] . "," |
601 | 601 | // . $bbox ['maxlat'] . "," . $bbox ['maxlon']; |
602 | - $imgUrl .= "?ma=" . $bbox ['minlat'] . "%2C" . $bbox ['minlon'] . "%2C" . $bbox ['maxlat'] |
|
603 | - . "%2C" . $bbox ['maxlon']; |
|
602 | + $imgUrl .= "?ma=".$bbox ['minlat']."%2C".$bbox ['minlon']."%2C".$bbox ['maxlat'] |
|
603 | + . "%2C".$bbox ['maxlon']; |
|
604 | 604 | $imgUrl .= "&dcl=1"; |
605 | 605 | } |
606 | 606 | if (strpos($imgUrl, "?") === false) |
@@ -608,9 +608,9 @@ discard block |
||
608 | 608 | |
609 | 609 | //$imgUrl .= "&ms=" . str_replace ( "px", "", $gmap ['width'] ) . "," |
610 | 610 | // . str_replace ( "px", "", $gmap ['height'] ); |
611 | - $imgUrl .= "&ms=" . str_replace("px", "", $gmap ['width']) . "%2C" |
|
611 | + $imgUrl .= "&ms=".str_replace("px", "", $gmap ['width'])."%2C" |
|
612 | 612 | . str_replace("px", "", $gmap ['height']); |
613 | - $imgUrl .= "&key=" . $this->getConf('bingAPIKey'); |
|
613 | + $imgUrl .= "&key=".$this->getConf('bingAPIKey'); |
|
614 | 614 | if ($overlay !== []) { |
615 | 615 | $rowId = 0; |
616 | 616 | foreach ($overlay as $data) { |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | } |
630 | 630 | global $conf; |
631 | 631 | $imgUrl .= "&fmt=png"; |
632 | - $imgUrl .= "&c=" . $conf ['lang']; |
|
632 | + $imgUrl .= "&c=".$conf ['lang']; |
|
633 | 633 | return $imgUrl; |
634 | 634 | } |
635 | 635 | |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | $latPos = "N"; |
676 | 676 | } |
677 | 677 | $dms = $this->convertDDtoDMS(abs($decimaldegrees)); |
678 | - return hsc($dms . $latPos); |
|
678 | + return hsc($dms.$latPos); |
|
679 | 679 | } |
680 | 680 | |
681 | 681 | /** |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | $secs = ($decimaldegrees - $dms) * 3600; |
692 | 692 | $min = floor($secs / 60); |
693 | 693 | $sec = round($secs - ($min * 60), 3); |
694 | - $dms .= 'º' . $min . '\'' . $sec . '"'; |
|
694 | + $dms .= 'º'.$min.'\''.$sec.'"'; |
|
695 | 695 | return $dms; |
696 | 696 | } |
697 | 697 | |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | $lonPos = "E"; |
710 | 710 | } |
711 | 711 | $dms = $this->convertDDtoDMS(abs($decimaldegrees)); |
712 | - return hsc($dms . $lonPos); |
|
712 | + return hsc($dms.$lonPos); |
|
713 | 713 | } |
714 | 714 | |
715 | 715 | /** |
@@ -751,50 +751,50 @@ discard block |
||
751 | 751 | if (!$initialised) { |
752 | 752 | $initialised = true; |
753 | 753 | // render necessary script tags only once |
754 | - $olscript = '<script defer="defer" src="' . DOKU_BASE . 'lib/plugins/openlayersmap/ol/ol.js"></script> |
|
755 | -<script defer="defer" src="' . DOKU_BASE . 'lib/plugins/openlayersmap/ol/ol-layerswitcher.js"></script>'; |
|
754 | + $olscript = '<script defer="defer" src="'.DOKU_BASE.'lib/plugins/openlayersmap/ol/ol.js"></script> |
|
755 | +<script defer="defer" src="' . DOKU_BASE.'lib/plugins/openlayersmap/ol/ol-layerswitcher.js"></script>'; |
|
756 | 756 | |
757 | 757 | $scriptEnable = '<script defer="defer" src="data:text/javascript;base64,'; |
758 | 758 | $scriptSrc = $olscript ? 'const olEnable=true;' : 'const olEnable=false;'; |
759 | - $scriptSrc .= 'const osmEnable=' . ($osmEnable ? 'true' : 'false') . ';'; |
|
760 | - $scriptSrc .= 'const stadiaEnable=' . ($stadiaEnable ? 'true' : 'false') . ';'; |
|
761 | - $scriptSrc .= 'const bEnable=' . ($enableBing ? 'true' : 'false') . ';'; |
|
762 | - $scriptSrc .= 'const bApiKey="' . $this->getConf('bingAPIKey') . '";'; |
|
763 | - $scriptSrc .= 'const tfApiKey="' . $this->getConf('tfApiKey') . '";'; |
|
764 | - $scriptSrc .= 'const gApiKey="' . $this->getConf('googleAPIkey') . '";'; |
|
759 | + $scriptSrc .= 'const osmEnable='.($osmEnable ? 'true' : 'false').';'; |
|
760 | + $scriptSrc .= 'const stadiaEnable='.($stadiaEnable ? 'true' : 'false').';'; |
|
761 | + $scriptSrc .= 'const bEnable='.($enableBing ? 'true' : 'false').';'; |
|
762 | + $scriptSrc .= 'const bApiKey="'.$this->getConf('bingAPIKey').'";'; |
|
763 | + $scriptSrc .= 'const tfApiKey="'.$this->getConf('tfApiKey').'";'; |
|
764 | + $scriptSrc .= 'const gApiKey="'.$this->getConf('googleAPIkey').'";'; |
|
765 | 765 | $scriptSrc .= 'olMapData = []; let olMaps = {}; let olMapOverlays = {};'; |
766 | 766 | $scriptEnable .= base64_encode($scriptSrc); |
767 | 767 | $scriptEnable .= '"></script>'; |
768 | 768 | } |
769 | 769 | $renderer->doc .= "$olscript\n$scriptEnable"; |
770 | - $renderer->doc .= '<div class="olMapHelp">' . $this->locale_xhtml("help") . '</div>'; |
|
770 | + $renderer->doc .= '<div class="olMapHelp">'.$this->locale_xhtml("help").'</div>'; |
|
771 | 771 | if ($this->getConf('enableA11y')) { |
772 | - $renderer->doc .= '<div id="' . $mapid . '-static" class="olStaticMap">' |
|
773 | - . p_render($format, p_get_instructions($staticImgUrl), $info) . '</div>'; |
|
772 | + $renderer->doc .= '<div id="'.$mapid.'-static" class="olStaticMap">' |
|
773 | + . p_render($format, p_get_instructions($staticImgUrl), $info).'</div>'; |
|
774 | 774 | } |
775 | - $renderer->doc .= '<div id="' . $mapid . '-clearer" class="clearer"><p> </p></div>'; |
|
775 | + $renderer->doc .= '<div id="'.$mapid.'-clearer" class="clearer"><p> </p></div>'; |
|
776 | 776 | if ($this->getConf('enableA11y')) { |
777 | 777 | // render a table of the POI for the print and a11y presentation, it is hidden using javascript |
778 | 778 | $renderer->doc .= ' |
779 | - <div id="' . $mapid . '-table-span" class="olPOItableSpan"> |
|
780 | - <table id="' . $mapid . '-table" class="olPOItable"> |
|
781 | - <caption class="olPOITblCaption">' . $this->getLang('olmapPOItitle') . '</caption> |
|
779 | + <div id="' . $mapid.'-table-span" class="olPOItableSpan"> |
|
780 | + <table id="' . $mapid.'-table" class="olPOItable"> |
|
781 | + <caption class="olPOITblCaption">' . $this->getLang('olmapPOItitle').'</caption> |
|
782 | 782 | <thead class="olPOITblHeader"> |
783 | 783 | <tr> |
784 | 784 | <th class="rowId" scope="col">id</th> |
785 | - <th class="icon" scope="col">' . $this->getLang('olmapPOIicon') . '</th> |
|
786 | - <th class="lat" scope="col" title="' . $this->getLang('olmapPOIlatTitle') . '">' |
|
787 | - . $this->getLang('olmapPOIlat') . '</th> |
|
788 | - <th class="lon" scope="col" title="' . $this->getLang('olmapPOIlonTitle') . '">' |
|
789 | - . $this->getLang('olmapPOIlon') . '</th> |
|
790 | - <th class="txt" scope="col">' . $this->getLang('olmapPOItxt') . '</th> |
|
785 | + <th class="icon" scope="col">' . $this->getLang('olmapPOIicon').'</th> |
|
786 | + <th class="lat" scope="col" title="' . $this->getLang('olmapPOIlatTitle').'">' |
|
787 | + . $this->getLang('olmapPOIlat').'</th> |
|
788 | + <th class="lon" scope="col" title="' . $this->getLang('olmapPOIlonTitle').'">' |
|
789 | + . $this->getLang('olmapPOIlon').'</th> |
|
790 | + <th class="txt" scope="col">' . $this->getLang('olmapPOItxt').'</th> |
|
791 | 791 | </tr> |
792 | 792 | </thead>'; |
793 | 793 | if ($poitabledesc != '') { |
794 | - $renderer->doc .= '<tfoot class="olPOITblFooter"><tr><td colspan="5">' . $poitabledesc |
|
794 | + $renderer->doc .= '<tfoot class="olPOITblFooter"><tr><td colspan="5">'.$poitabledesc |
|
795 | 795 | . '</td></tr></tfoot>'; |
796 | 796 | } |
797 | - $renderer->doc .= '<tbody class="olPOITblBody">' . $poitable . '</tbody> |
|
797 | + $renderer->doc .= '<tbody class="olPOITblBody">'.$poitable.'</tbody> |
|
798 | 798 | </table> |
799 | 799 | </div>'; |
800 | 800 | $renderer->doc .= "\n"; |
@@ -812,7 +812,7 @@ discard block |
||
812 | 812 | $renderer->meta ['geo'] ['lon'] = $mainLon; |
813 | 813 | if (($geophp = plugin_load('helper', 'geophp')) !== null) { |
814 | 814 | // if we have the geoPHP helper, add the geohash |
815 | - try{ |
|
815 | + try { |
|
816 | 816 | $renderer->meta['geo']['geohash'] = (new Point($mainLon, $mainLat))->out('geohash'); |
817 | 817 | } catch (Exception $e) { |
818 | 818 | Logger::error("Failed to create geohash for: $mainLat, $mainLon"); |