-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from mschwemer/v11_compat
Provide V11 Compatibility Ok. Thank you @mschwemer for your contribution. I'll merge this and will make the release asap.
- Loading branch information
Showing
19 changed files
with
117 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
.vscode | ||
Documentation-GENERATED-temp | ||
|
||
.Build | ||
.idea | ||
nbproject | ||
.DS_Store | ||
.DS_Store? | ||
|
||
composer.lock | ||
package-lock.json | ||
|
||
/.php_cs | ||
/.php_cs.cache | ||
|
||
.ddev/** | ||
.project/** | ||
|
||
/var | ||
/config | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
namespace Bobosch\OdsOsm\Provider; | ||
|
||
use Bobosch\OdsOsm\Div; | ||
use TYPO3\CMS\Core\Core\Environment; | ||
use TYPO3\CMS\Core\Page\PageRenderer; | ||
use TYPO3\CMS\Core\Resource\FileRepository; | ||
|
@@ -22,7 +23,11 @@ class Leaflet extends BaseProvider | |
|
||
public function getMapCore($backpath = '') | ||
{ | ||
$this->path_res = ($backpath ? $backpath : $GLOBALS['TSFE']->absRefPrefix) . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath('ods_osm')) . 'Resources/Public/JavaScript/Leaflet/'; | ||
$this->path_res = ($backpath ? $backpath : | ||
PathUtility::getAbsoluteWebPath( | ||
GeneralUtility::getFileAbsFileName(Div::RESOURCE_BASE_PATH . 'JavaScript/Leaflet/') | ||
) | ||
); | ||
$this->path_leaflet = ($this->config['local_js'] ? $this->path_res . 'Core/' : 'https://unpkg.com/[email protected]/dist/'); | ||
$pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(PageRenderer::class); | ||
$pageRenderer->addCssFile($this->path_leaflet . 'leaflet.css'); | ||
|
@@ -165,7 +170,9 @@ protected function getMarker($item, $table) | |
break; | ||
} | ||
|
||
$path = $GLOBALS['TSFE']->absRefPrefix . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath('ods_osm')) . 'Resources/Public/JavaScript/Leaflet/'; | ||
$path = PathUtility::getAbsoluteWebPath( | ||
GeneralUtility::getFileAbsFileName(Div::RESOURCE_BASE_PATH . 'JavaScript/Leaflet/') | ||
); | ||
// Add tracks to layerswitcher | ||
$this->layers[1][$item['title']] = $jsElementVar; | ||
|
||
|
@@ -175,7 +182,7 @@ protected function getMarker($item, $table) | |
$this->scripts['leaflet-plugins'] = ['src' => $path . 'leaflet-plugins/layer/vector/KML.js']; | ||
|
||
$jsMarker .= 'var ' . $jsElementVar . ' = new L.KML('; | ||
$jsMarker .= '"/' . $file->getPublicUrl() . '"'; | ||
$jsMarker .= '"' . $file->getPublicUrl() . '"'; | ||
$jsMarker .= ");\n"; | ||
break; | ||
case 'gpx': | ||
|
@@ -192,7 +199,8 @@ protected function getMarker($item, $table) | |
'shadowUrl' => $path . 'leaflet-gpx/pin-shadow.png', | ||
), | ||
); | ||
$jsMarker .= 'var ' . $jsElementVar . ' = new L.GPX("/' . $file->getPublicUrl() . '",'; | ||
$jsMarker .= 'var ' . $jsElementVar . ' = new L.GPX("' . $file->getPublicUrl() . '",'; | ||
|
||
$jsMarker .= json_encode($options) . ");\n"; | ||
$jsMarker .= $this->config['id'] . '.addLayer(' . $jsElementVar . ');' . "\n"; | ||
break; | ||
|
@@ -258,7 +266,7 @@ protected function getMarker($item, $table) | |
$markerOptions['icon'] = 'icon: new L.Icon(' . json_encode($iconOptions) . ')'; | ||
} | ||
} else { | ||
$icon = $GLOBALS['TSFE']->absRefPrefix . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath('ods_osm')) . 'Resources/Public/JavaScript/Leaflet/Core/images/marker-icon.png'; | ||
$icon = $this->path_leaflet . 'Core/images/marker-icon.png'; | ||
} | ||
$jsMarker .= 'var ' . $jsElementVar . ' = new L.Marker([' . $item['latitude'] . ', ' . $item['longitude'] . '], {' . implode(',', $markerOptions) . "});\n"; | ||
// Add group to layer switch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider; | ||
|
||
$iconPath = 'EXT:ods_osm/Resources/Public/Icons/'; | ||
return [ | ||
'coordinate-picker-wizard' => [ | ||
'provider' => BitmapIconProvider::class, | ||
'source' => $iconPath . 'ce_wiz.png', | ||
], | ||
'vectordraw-wizard' => [ | ||
'provider' => BitmapIconProvider::class, | ||
'source' => $iconPath . 'vector.png', | ||
], | ||
'ods_osm' => [ | ||
'provider' => BitmapIconProvider::class, | ||
'source' => $iconPath . 'osm.png', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ EXT: OpenStreetMap | |
Editors/Index | ||
Administrators/Index | ||
Tutorial/Index | ||
Conribution/Index |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters