commit e5dd88a27c7f03b021fbbe3618dde406249d1eaa Author: origin Date: Mon Dec 4 16:36:56 2023 +0100 initial commit diff --git a/Classes/Controller/MapController.php b/Classes/Controller/MapController.php new file mode 100755 index 0000000..7b06968 --- /dev/null +++ b/Classes/Controller/MapController.php @@ -0,0 +1,281 @@ +, none + */ + +/** + * MapController + */ +class MapController extends ActionController { + + use InjectMapEntryRepositoryTrait; + use InjectMarkerRepositoryTrait; + use InjectImageServiceTrait; + use InjectSysFileReferenceRepositoryTrait; + + private static $mapIcons = null; + + /** + * + * @param UriBuilder $uriBuilder + * @param TemplateView $sourceView + * @param type $arguments + * @param type $actionName + * @param type $controllerName + * @return StandaloneView + */ + static private function generateContent(UriBuilder $uriBuilder, TemplateView &$sourceView, $arguments = [], $actionName = 'popup', $controllerName = 'Map'): StandaloneView { + $templatePath = $controllerName . '/' . ucfirst($actionName); + $objectManager = GeneralUtility::makeInstance(ObjectManager::class); + $templateRootPaths = $sourceView->getTemplateRootPaths(); + $context = $objectManager->get(ControllerContext::class); + $request =$objectManager->get(\TYPO3\CMS\Extbase\Mvc\Request::class); + $context->setRequest($request); + $context->setUriBuilder($uriBuilder); + /** + * @var StandaloneView $view + */ + $view = GeneralUtility::makeInstance(StandaloneView::class); + $view->setControllerContext($context); + $view->setLayoutRootPaths($sourceView->getLayoutRootPaths()); + $view->setTemplateRootPaths($templateRootPaths); + $view->setPartialRootPaths($sourceView->getPartialRootPaths()); + $view->setTemplate($templatePath); + $arguments['today'] = (new \DateTime())->format('d.m.Y'); + + $view->assignMultiple($arguments); +// \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($arguments); +// die(); + return $view; + } + + private function setMapMarkerIcons(){ + if (self::$mapIcons === null) { + self::$mapIcons = []; + $markers = $this->markerRepository->findAll(); + foreach ($markers as $marker) { + if ($marker->getMapIcon() !== null) { + self::$mapIcons[] = [ + 'uid' => 'i-' . $marker->getUid(), + 'icon' => $this->imageService->getImageUri($this->imageService->applyProcessingInstructions($this->imageService->getImage('', $marker->getMapIcon(), false), []), true) + ]; + } + } + } + } + + + /** + * action map + * + * @return string|object|null|void + */ + public function mapAction() { + if ((int) $this->settings['gpxData'] > 0) { + $tmp = $this->sysFileReferenceRepository->findByTablename('tt_content', (int) $this->configurationManager->getContentObject()->data['uid']); + $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class); + $file = $resourceFactory->getFileReferenceObject($tmp[0]->getUid()); + $showGpxData=true; + } else { + $showGpxData=false; + } + + $this->setMapMarkerIcons(); + if(array_key_exists('markers',$this->settings) && $this->settings['markers'] !== null){ + + $markers = explode(',', $this->settings['markers']); + if(count($markers)>0){ + $showMarkers = true; + $this->uriBuilder->setTargetPageType(1652369510); + $markerUri = $this->uriBuilder->uriFor('mapMarkers', ['ttContentUid'=>(int) $this->configurationManager->getContentObject()->data['uid']]); + if((bool)$this->settings['showMarkerList'] === true && !empty($markers)){ + if(array_key_exists('markerListOrderBy', $markers)){ + $mapEntries=$this->mapEntryRepository->getFromUids($markers, $this->settings['markerListOrderBy']); + } else { + $mapEntries=$this->mapEntryRepository->getFromUids($markers); + } + + $mapEntriesSort = []; + foreach($mapEntries as $mapEntrie){ + if(array_key_exists($mapEntrie->getRegion(),$mapEntriesSort)){ + + $mapEntriesSort[$mapEntrie->getRegion()][]=$mapEntrie; + } else { + + $mapEntriesSort[$mapEntrie->getRegion()]=[]; + + $mapEntriesSort[$mapEntrie->getRegion()][]=$mapEntrie; + } + } + $this->view->assign('mapEntries', $mapEntriesSort); + } + } else { + $showMarkers = false; + } + + }else { + $showMarkers = false; + } + + if(array_key_exists('layers',$this->settings) && $this->settings['layers'] !== null){ + $layerIds = explode(',', $this->settings['layers']); + } else { + $layerIds = []; + } + + $this->view->assignMultiple([ + 'mapId' => 'a2g-map-' . uniqid(), + 'countMapLayers' => count($layerIds), + 'mapIcons' => \GuzzleHttp\json_encode(self::$mapIcons), + 'mapConfig' => \GuzzleHttp\json_encode(MapConfigUtility::getMapConfig( + $layerIds, + $showGpxData === true ? $file->getOriginalFile()->getPublicUrl() : null, + $showMarkers === true ? $markerUri : null, + $this->settings['defaultMapMarker'], + (int)$this->settings['zoom'], + (int)$this->settings['maxZoom'], (float)$this->settings['centerLon'], (float)$this->settings['centerLat'], + (bool)$this->settings['useZoomSlider'], (bool)$this->settings['useFullscreenButton'], (bool)$this->settings['useLayerSwitcher'])) + ]); + } + + /** + * action mapMarkers + * + * @return string|object|null|void + */ + public function mapMarkersAction() { + + if($this->mapEntryRepository->findAll()->count() > 0){ + $markersUids = $this->mapEntryRepository->getEntriesFromMap((int)GeneralUtility::_GET('tx_a2gmaps_map')['ttContentUid']); + $markers = $this->mapEntryRepository->getFromUids($markersUids); + if($markers===null){ + $markers = []; + } + } else { + $markers=[]; + } + $out = [ + "type" => "FeatureCollection", + "totalFeatures" => count($markers), + "csr" => MapConfigUtility::getMarkerCsr(), + "features" => [] + ]; + foreach ($markers as $marker) { + if ($marker->getRelMarker() !== null) { + $tmpIcon = "i-" . $marker->getRelMarker()->getUid(); + } else { + $tmpIcon = null; + } + $out["features"][] = MapConfigUtility::getMarker($marker, $tmpIcon, self::generateContent( $this->uriBuilder, $this->view, ['mapEntry' => $marker ])->render()); + } + return \GuzzleHttp\json_encode($out); + } + + /** + * action popup + * + * @return string|object|null|void + */ + public function MapEntry() { + + } + + /** + * action list + * + * @return string|object|null|void + */ + public function listAction() { + + } + + /** + * action ajaxListAction + * + * @return string|object|null|void + */ + public function ajaxListAction() { + + } + +// /** +// * action show +// * +// * @param Ingredients $ingredient +// * @return string|object|null|void +// */ +// public function showAction(Ingredients $ingredient) { +// $titleProvider = GeneralUtility::makeInstance(A2gPageTitleProvider::class); +// +// if($this->settings['pageTitleSuffix'] !== null && $this->settings['pageTitleSuffix'] !== '' && (strlen($ingredient->getTitle()) + strlen($this->settings['pageTitleSuffix'])) < 66 ){ +// $pageTitle = $ingredient->getTitle(). ' ' . $this->settings['pageTitleSuffix']; +// } else { +// $pageTitle = $ingredient->getTitle(); +// } +// $titleProvider->setTitle($pageTitle); +// $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class); +// $description = $contentObject->crop($ingredient->getDescription(), 125 . '|...|' . true); +// +// $uri = $this->uriBuilder->reset()->setCreateAbsoluteUri(true)->setTargetPageUid( +// $GLOBALS['TSFE']->id)->uriFor('show', ['ingredient' => $ingredient], 'Ingredients', 'a2gProducts', 'ingredientsdetail'); +// +// $metaTagManager = GeneralUtility::makeInstance(MetaTagManagerRegistry::class); +// +// $metaTagManager->getManagerForProperty('robots')->addProperty('robots', 'index, folow'); +// $metaTagManager->getManagerForProperty('og:type')->addProperty('og:type', 'website'); +// $metaTagManager->getManagerForProperty('twitter:card')->addProperty('twitter:card', 'summary_large_image'); +// +// if ($ingredient->getTitle() !== '') { +// $metaTagManager->getManagerForProperty('title')->addProperty('title', $pageTitle); +// $metaTagManager->getManagerForProperty('og:title')->addProperty('og:title', $pageTitle); +// $metaTagManager->getManagerForProperty('twitter:title')->addProperty('twitter:title', $pageTitle); +// } +// if ($ingredient->getDescription() !== '') { +// $metaTagManager->getManagerForProperty('description')->addProperty('description', $description); +// $metaTagManager->getManagerForProperty('og:description')->addProperty('og:description', $description); +// $metaTagManager->getManagerForProperty('twitter:description')->addProperty('twitter:description', $description); +// } +// $metaTagManager->getManagerForProperty('og:url')->addProperty('og:url', $uri); +// $metaTagManager->getManagerForProperty('twitter:url')->addProperty('twitter:url', $uri); +// +// if ($ingredient->getImage() !== null) { +// $processedImage = $this->imageService->applyProcessingInstructions( +// $this->imageService->getImage('', $ingredient->getImage(), false), +// ['width' => ' +// 1200', 'height' => '630c'] +// ); +// $metaTagManager->getManagerForProperty('twitter:image')->addProperty('twitter:image', $this->imageService->getImageUri($processedImage, true)); +// $metaTagManager->getManagerForProperty('og:image')->addProperty('og:image', $this->imageService->getImageUri($processedImage, true)); +// } +// $this->view->assign('ingredient', $ingredient); +// } +} diff --git a/Classes/Domain/Model/MapEntry.php b/Classes/Domain/Model/MapEntry.php new file mode 100755 index 0000000..bcd4dc1 --- /dev/null +++ b/Classes/Domain/Model/MapEntry.php @@ -0,0 +1,281 @@ +, none + */ + +/** + * MapEntry + */ +class MapEntry extends AbstractEntity { + + /** + * + * @var string + */ +protected $addressline = ''; + + /** + * + * @var string + */ +protected $zip = ''; + + /** + * + * @var string + */ +protected $city = ''; + + /** + * + * @var string + */ + protected $region = ''; + + + /** + * latitude + * + * @var float + */ + protected $latitude = 0.0; + + /** + * longitude + * + * @var float + */ + protected $longitude = 0.0; + + /** + * title + * + * @var string + */ + protected $title = ''; + + /** + * pathSegment + * + * @var string + */ + protected $pathSegment = ''; + + /** + * popupContent + * + * @var string + */ + protected $popupContent = ''; + + /** + * + * @var string + */ + protected $navToUrl = ''; + + + /** + * image + * + * @var FileReference + * @Cascade("remove") + * @Lazy + */ + protected $image = null; + + + /** + * relMarker + * + * @var Marker + * @Lazy + */ + protected $relMarker = null; + + /** + * + * @return float + */ + public function getLatitude(): float { + return $this->latitude; + } + + /** + * + * @return float + */ + public function getLongitude(): float { + return $this->longitude; + } + + /** + * + * @return string + */ + public function getTitle(): string { + return $this->title; + } + + /** + * + * @return string + */ + public function getPathSegment(): string { + return $this->pathSegment; + } + + + /** + * + * @return null|Marker + */ + public function getRelMarker(): ?Marker { + if ($this->relMarker instanceof LazyLoadingProxy) { + $this->relMarker = $this->relMarker->_loadRealInstance(); + } + return $this->relMarker; + } + + /** + * + * @param Marker $relMarker + * @return void + */ + public function setRelMarker(?Marker $relMarker): void { + $this->relMarker = $relMarker; + } + + /** + * + * @return null|FileReference + */ + public function getImage(): ?FileReference { + if ($this->image instanceof LazyLoadingProxy) { + $this->image = $this->image->_loadRealInstance(); + } + return $this->image; + } + + /** + * + * @param float $latitude + * @return void + */ + public function setLatitude(float $latitude): void { + $this->latitude = $latitude; + } + + /** + * + * @param float $longitude + * @return void + */ + public function setLongitude(float $longitude): void { + $this->longitude = $longitude; + } + + /** + * + * @param string $title + * @return void + */ + public function setTitle(string $title): void { + $this->title = $title; + } + + /** + * + * @param string $pathSegment + * @return void + */ + public function setPathSegment(string $pathSegment): void { + $this->pathSegment = $pathSegment; + } + + /** + * + * @param null|FileReference $image + * @return void + */ + public function setImage(?FileReference $image): void { + $this->image = $image; + } + + /** + * + * @return string + */ + public function getPopupContent(): string { + return $this->popupContent; + } + + /** + * + * @param string $popupContent + * @return void + */ + public function setPopupContent(string $popupContent): void { + $this->popupContent = $popupContent; + } + public function getAddressline(): string { + return $this->addressline; + } + + public function getZip(): string { + return $this->zip; + } + + public function getCity(): string { + return $this->city; + } + + public function getRegion(): string { + return $this->region; + } + + public function setAddressline(string $addressline): void { + $this->addressline = $addressline; + } + + public function setZip(string $zip): void { + $this->zip = $zip; + } + + public function setCity(string $city): void { + $this->city = $city; + } + + public function setRegion(string $region): void { + $this->region = $region; + } + + public function getNavToUrl(): string { + return $this->navToUrl; + } + + public function setNavToUrl(string $navToUrl): void { + $this->navToUrl = $navToUrl; + } + + + +} \ No newline at end of file diff --git a/Classes/Domain/Model/Marker.php b/Classes/Domain/Model/Marker.php new file mode 100755 index 0000000..45cc151 --- /dev/null +++ b/Classes/Domain/Model/Marker.php @@ -0,0 +1,56 @@ +, none + */ + +/** + * Marker + */ +class Marker extends AbstractEntity { + + /** + * mapIcon + * + * @var FileReference + * @Cascade("remove") + * @Lazy + */ + protected $mapIcon = null; + + /** + * + * @return null|FileReference + */ + public function getMapIcon(): ?FileReference { + if ($this->mapIcon instanceof LazyLoadingProxy) { + $this->mapIcon = $this->mapIcon->_loadRealInstance(); + } + return $this->mapIcon; + } + + /** + * + * @return string + */ + public function getMapConfig(): string { + return $this->mapConfig; + } +} \ No newline at end of file diff --git a/Classes/Domain/Model/SysFileReference.php b/Classes/Domain/Model/SysFileReference.php new file mode 100755 index 0000000..124d667 --- /dev/null +++ b/Classes/Domain/Model/SysFileReference.php @@ -0,0 +1,18 @@ +, none + */ + +/** + * The repository for MapEntry + */ +class MapEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { + + /** + * @var array + */ +// protected $defaultOrderings = [ +// 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING +// ]; + + public function initializeObject() { + $querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class); + $querySettings->setRespectStoragePage(false); + $this->setDefaultQuerySettings($querySettings); + } + + static private function mapInt($value){ + if(MathUtility::canBeInterpretedAsInteger($value)){ + return (int)$value; + } else { + return null; + } + } + + + public function getFromUids(array $uids, ?string $orderBy = null){ + $arguments = []; + $uidsFiltered = array_filter(array_map('self::mapInt', $uids)); + if(count($uidsFiltered) === 0){ + return null; + } + + $query = $this->createQuery(); + $sql = 'SELECT meT.* FROM tx_a2gmaps_domain_model_mapentry AS meT '; + $sqlWhere = 'WHERE meT.hidden=0 AND meT.deleted=0 AND meT.uid IN ('.implode(',', $uidsFiltered).')'; + + $query->statement($sql . $sqlWhere, $arguments); + + + return $query->execute(); + + } + + public function getEntriesFromMap(int $ttContentUid){ + $query = $this->createQuery(); + $sql = 'SELECT tcT.* FROM tt_content AS tcT '; + $sqlWhere = 'WHERE tcT.hidden=0 AND tcT.deleted=0 AND tcT.uid = :dcUid '; + + $arguments = [ + ':dcUid' => $ttContentUid + ]; + $query->statement($sql . $sqlWhere, $arguments); + + + return explode(',',GeneralUtility::xml2array($query->execute(1)[0]['pi_flexform'])['data']['sDEF']['lDEF']['settings.markers']['vDEF']); + } + +} diff --git a/Classes/Domain/Repository/MarkerRepository.php b/Classes/Domain/Repository/MarkerRepository.php new file mode 100755 index 0000000..8faab59 --- /dev/null +++ b/Classes/Domain/Repository/MarkerRepository.php @@ -0,0 +1,37 @@ +, none + */ + +/** + * The repository for Marker + */ +class MarkerRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { + + /** + * @var array + */ +// protected $defaultOrderings = [ +// 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING +// ]; + + public function initializeObject() { + $querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class); + $querySettings->setRespectStoragePage(false); + $this->setDefaultQuerySettings($querySettings); + } + +} diff --git a/Classes/Domain/Repository/SysFileReferenceRepository.php b/Classes/Domain/Repository/SysFileReferenceRepository.php new file mode 100755 index 0000000..6388aa4 --- /dev/null +++ b/Classes/Domain/Repository/SysFileReferenceRepository.php @@ -0,0 +1,46 @@ +, none + */ + +/** + * The repository for SysFileReference + */ +class SysFileReferenceRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { + + /** + * @var array + */ +// protected $defaultOrderings = [ +// 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING +// ]; + + public function initializeObject() { + $querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class); + $querySettings->setRespectStoragePage(false); + $this->setDefaultQuerySettings($querySettings); + } + + public function findByTablename(string $tableName, int $uid){ + $query = $this->createQuery(); + $sql = 'SELECT sfrT.* FROM sys_file_reference AS sfrT '; + $sqlWhere = 'WHERE sfrT.hidden=0 AND sfrT.deleted=0 AND sfrT.tablenames = :dcTablename AND sfrT.uid_foreign = :dcUid '; + + $arguments = [ + ':dcTablename' => $tableName, + ':dcUid' => $uid + ]; + $query->statement($sql . $sqlWhere, $arguments); + return $query->execute(); +} +} diff --git a/Classes/Domain/Traits/InjectImageServiceTrait.php b/Classes/Domain/Traits/InjectImageServiceTrait.php new file mode 100755 index 0000000..ab81d2c --- /dev/null +++ b/Classes/Domain/Traits/InjectImageServiceTrait.php @@ -0,0 +1,35 @@ +imageService = $imageService; + } + +} diff --git a/Classes/Domain/Traits/InjectMapEntryRepositoryTrait.php b/Classes/Domain/Traits/InjectMapEntryRepositoryTrait.php new file mode 100755 index 0000000..739099e --- /dev/null +++ b/Classes/Domain/Traits/InjectMapEntryRepositoryTrait.php @@ -0,0 +1,27 @@ +mapEntryRepository = $mapEntryRepository; + } + +} diff --git a/Classes/Domain/Traits/InjectMarkerRepositoryTrait.php b/Classes/Domain/Traits/InjectMarkerRepositoryTrait.php new file mode 100755 index 0000000..9249d09 --- /dev/null +++ b/Classes/Domain/Traits/InjectMarkerRepositoryTrait.php @@ -0,0 +1,27 @@ +markerRepository = $markerRepository; + } + +} diff --git a/Classes/Domain/Traits/InjectObjectManagerTrait.php b/Classes/Domain/Traits/InjectObjectManagerTrait.php new file mode 100644 index 0000000..402fa6e --- /dev/null +++ b/Classes/Domain/Traits/InjectObjectManagerTrait.php @@ -0,0 +1,21 @@ +sysFileReferenceRepository = $sysFileReferenceRepository; + } + +} diff --git a/Classes/FormEngine/FieldControl/LocationMapWizard.php b/Classes/FormEngine/FieldControl/LocationMapWizard.php new file mode 100755 index 0000000..388828d --- /dev/null +++ b/Classes/FormEngine/FieldControl/LocationMapWizard.php @@ -0,0 +1,70 @@ +data['databaseRow']; + $paramArray = $this->data['parameterArray']; + $resultArray = $this->initializeResultArray(); + + $nameLongitude = $paramArray['itemFormElName']; + $nameLatitude = str_replace('longitude', 'latitude', $nameLongitude); + $nameLatitudeActive = str_replace('data', 'control[active]', $nameLatitude); + $geoCodeUrl = $geoCodeUrlShort = ''; + $gLat = '55.6760968'; + $gLon = '12.5683371'; + + $lat = $row['latitude'] != 0 ? (string)$row['latitude'] : '0.0'; + $lon = $row['longitude'] != 0 ? (string)$row['longitude'] : '0.0'; + + $resultArray['iconIdentifier'] = 'location-map-wizard'; + $resultArray['title'] = $this->getLanguageService()->sL('LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address.locationMapWizard'); + $resultArray['linkAttributes']['class'] = 'locationMapWizard '; + $resultArray['linkAttributes']['data-label-title'] = $this->getLanguageService()->sL('LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address.locationMapWizard'); + $resultArray['linkAttributes']['data-label-close'] = $this->getLanguageService()->sL('LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address.locationMapWizard.close'); + $resultArray['linkAttributes']['data-label-import'] = $this->getLanguageService()->sL('LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address.locationMapWizard.import'); + $resultArray['linkAttributes']['data-lat'] = $lat; + $resultArray['linkAttributes']['data-lon'] = $lon; + $resultArray['linkAttributes']['data-glat'] = $gLat; + $resultArray['linkAttributes']['data-glon'] = $gLon; + $resultArray['linkAttributes']['data-geocodeurl'] = $geoCodeUrl; + $resultArray['linkAttributes']['data-geocodeurlshort'] = $geoCodeUrlShort; + $resultArray['linkAttributes']['data-namelat'] = htmlspecialchars($nameLatitude); + $resultArray['linkAttributes']['data-namelon'] = htmlspecialchars($nameLongitude); + $resultArray['linkAttributes']['data-namelat-active'] = htmlspecialchars($nameLatitudeActive); + $resultArray['linkAttributes']['data-tiles'] = htmlspecialchars('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'); + $resultArray['linkAttributes']['data-copy'] = '© OpenStreetMap contributors'; + $resultArray['stylesheetFiles'][] = 'EXT:tt_address/Resources/Public/Contrib/leaflet-core-1.4.0.css'; + $resultArray['stylesheetFiles'][] = 'EXT:tt_address/Resources/Public/Backend/LocationMapWizard/leafletBackend.css'; + $resultArray['requireJsModules'][] = 'TYPO3/CMS/TtAddress/leaflet-core-1.4.0'; + $resultArray['requireJsModules'][] = 'TYPO3/CMS/TtAddress/LeafletBackend'; + + return $resultArray; + } + + /** + * @return LanguageService + */ + protected function getLanguageService(): LanguageService + { + return $GLOBALS['LANG']; + } +} \ No newline at end of file diff --git a/Classes/Hooks/MapEntryDataHandlerHooks.php b/Classes/Hooks/MapEntryDataHandlerHooks.php new file mode 100755 index 0000000..e3a43c3 --- /dev/null +++ b/Classes/Hooks/MapEntryDataHandlerHooks.php @@ -0,0 +1,39 @@ += 8) { + $decimalPart = substr($decimalPart, 0, 8); + } else { + $decimalPart = str_pad($decimalPart, 8, '0', STR_PAD_RIGHT); + } + + // concatenate the whole string to a well-formed longitude and return + $coordinate = $integerPart . '.' . $decimalPart; + + // test if value is in the possible range. longitude can be -180 to +180. + // latitude can be -90 to +90 + // At this point, our minus, if there, is stored to 'negative' + // therefore we just test if integerpart is bigger than 90 + if ($coordinate > $upperRange) { + $coordinate = $upperRange; + } + + // reapply signed/unsigned and return + return $negative . $coordinate; + } +} \ No newline at end of file diff --git a/Classes/Utility/MapConfigUtility.php b/Classes/Utility/MapConfigUtility.php new file mode 100755 index 0000000..304359a --- /dev/null +++ b/Classes/Utility/MapConfigUtility.php @@ -0,0 +1,386 @@ + [ + "layer" => "osm", + "config" => [ + ], + "label" => "osm_map_layer" + ], + 10 => [ + "layer" => "stamen", + "config" => [ + "layer" => "terrain" + ], + "label" => "stamen_map_terrain" + ], + 11 => [ + "layer" => "stamen", + "config" => [ + "layer" => "watercolor" + ], + "label" => "stamen_map_watercolor" + ], + 12 => [ + "layer" => "stamen", + "config" => [ + "layer" => "toner" + ], + "label" => "stamen_map_toner" + ], + 100 => [ + "layer" => "thunderforest", + "config" => [ + "layer" => "cycle" + ], + "label" => "thunderforest_map_cycle" + ], + 101 => [ + "layer" => "thunderforest", + "config" => [ + "layer" => "transport" + ], + "label" => "thunderforest_map_transport" + ], + 102 => [ + "layer" => "thunderforest", + "config" => [ + "layer" => "landscape" + ], + "label" => "thunderforest_map_landscape" + ], + 103 => [ + "layer" => "thunderforest", + "config" => [ + "layer" => "outdoors" + ], + "label" => "thunderforest_map_outdoors" + ], + 104 => [ + "layer" => "thunderforest", + "config" => [ + "layer" => "atlas" + ], + "label" => "thunderforest_map_atlas" + ], + 105 => [ + "layer" => "thunderforest", + "config" => [ + "layer" => "transport-dark" + ], + "label" => "thunderforest_map_transport-dark" + ], + 106 => [ + "layer" => "thunderforest", + "config" => [ + "layer" => "spinal-map" + ], + "label" => "thunderforest_map_spinal" + ], + 107 => [ + "layer" => "thunderforest", + "config" => [ + "layer" => "pioneer" + ], + "label" => "thunderforest_map_pioneer" + ], + 108 => [ + "layer" => "thunderforest", + "config" => [ + "layer" => "neighbourhood" + ], + "label" => "thunderforest_map_neighbourhood" + ], + 109 => [ + "layer" => "thunderforest", + "config" => [ + "layer" => "mobile-atlas" + ], + "label" => "thunderforest_map_mobile-atlas" + ], + 200 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "basic" + ], + "label" => "maptiler_map_basic" + ], + 201 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "basic-4326" + ], + "label" => "maptiler_map_basic-4326" + ], + 202 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "bright" + ], + "label" => "maptiler_map_bright" + ], + 203 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "openstreetmap" + ], + "label" => "maptiler_map_openstreetmap" + ], + 204 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "outdoor" + ], + "label" => "maptiler_map_outdoor" + ], + 205 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "pastel" + ], + "label" => "maptiler_map_pastel" + ], + 206 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "hybrid" + ], + "label" => "maptiler_map_hybrid" + ], + 207 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "streets" + ], + "label" => "maptiler_map_streets" + ], + 208 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "toner" + ], + "label" => "maptiler_map_toner" + ], + 209 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "topo" + ], + "label" => "maptiler_map_topo" + ], + 210 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "topographique" + ], + "label" => "maptiler_map_topographique" + ], + 211 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "voyager" + ], + "label" => "maptiler_map_voyager" + ], + 212 => [ + "layer" => "maptiler", + "config" => [ + "layer" => "winter" + ], + "label" => "maptiler_map_winter" + ], + ]; + + /** + * setCanonical + * + * @param type $href + */ + public static function getMapLayerConfig(array $mapLayerConfigIds) { + $out = []; + foreach ($mapLayerConfigIds as $id) { + $out[] = self::$mapLayerConfigs[$id]; + } + return $out; + } + + public static function getMapConfig(array $mapLayerConfigIds, ?string $gpxSource = null, ?string $markerSource = null, + ?string $defaultMarkerIcon = null, + int $zoom = 1, int $maxZoom = 18, float $centerLon = 0.0, float $centerLat = 0.0, + bool $zoomSlider = false, bool $fullScreen = false, bool $useLayerSwitcher = false): array { + $out = [ + 'zoom' => $zoom, + 'maxZoom' => $maxZoom, + 'centerLon' => $centerLon, + 'centerLat' => $centerLat + ]; + $out['mapLayers'] = self::getMapLayerConfig($mapLayerConfigIds); + if ($useLayerSwitcher) { + for ($i = 0; $i < count($out['mapLayers']); $i++) { + $out['mapLayers'][$i]['active'] = true; + } + } + if ($defaultMarkerIcon !== null) { + $out['defaultMarkerIcon'] = $defaultMarkerIcon; + } + if ($gpxSource !== null) { + $out['gpxSource'] = $gpxSource; + } + if ($markerSource !== null) { + $out['markerSource'] = $markerSource; + } + if ($zoomSlider) { + $out['zoomSlider'] = $zoomSlider; + } + if ($fullScreen) { + $out['fullScreen'] = $fullScreen; + } + return $out; + } + + static public function getMarkerCsr() { + return [ + "type" => "name", + "properties" => [ + "name" => "urn:ogc:def:crs:EPSG::4326" + ] + ]; + } + + static public function getMarker(MapEntry $marker, ?string $icon, ?string $popupContent) { + $out = [ + "type" => "Feature", + "id" => $marker->getUid(), + "geometry" => [ + "type" => "Point", + "coordinates" => [ + $marker->getLongitude(), + $marker->getLatitude() + ] + ], + "geometry_name" => "SHAPE", + "properties" => [ + 'icon' => $icon + ] + ]; + if ($popupContent !== null) { + $out['properties']['popup'] = $popupContent; + } + return $out; + } + + static private $countryCoordinates = null; + + private static function getCountryGeoJson(string $twoIsoCode = ''): ?array { + if (self::$countryCoordinates === null) { + self::$countryCoordinates = \GuzzleHttp\json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/typo3conf/ext/a2g_travel_blog/Resources/Public/sampleData/countries.json'), true); + } + if (self::$countryCoordinates[strtoupper($twoIsoCode)]) { + return self::$countryCoordinates[strtoupper($twoIsoCode)][0]; + } else { + return null; + } + } + + static protected $nominationBaseUrl = 'https://nominatim.openstreetmap.org'; + static protected $nominationSufixUrl = '&format=json&polygon=1&addressdetails=1'; + + static protected $client = null; + + static protected function initClient(){ + if(self::$client===null){ + self::$client = new Client([ + // Base URI is used with relative requests + 'base_uri' => self::$nominationBaseUrl, + // You can set any number of default request options. + 'timeout' => 2.0, + ]); + } + } + + static public function getLatLonFrom(string $addressline, string $countryline, string $state = ''): ?array { + self::initClient(); + if ($state === '') { + $url = urlencode($addressline . ',' . $countryline); + } else { + $url = urlencode($addressline . ',' . $countryline . ',' . $state); + } + $response = self::$client->request('GET', self::$nominationBaseUrl.'/search?q='.$url.self::$nominationSufixUrl); + + if($response->getStatusCode() === 200){ + return \GuzzleHttp\json_decode($response->getBody()->getContents(), true)[0]; + } + return null; + } + + + public static function getNavToLink(string $addressline, string $countryline, string $state = ''): string{ + if ($state === '') { + $url = str_replace(' ', '+', $addressline . ',' . $countryline); + } else { + $url = str_replace(' ', '+', $addressline . ',' . $countryline . ',' . $state); + } + return 'https://www.google.com/maps/dir//'. urlencode($url); + } + + + public static function getCountryFeatureCollectionsFromIsoCodeList(array $isoCodes = ['DE' => 'popupcontent de', 'AT' => 'popupcontent at']) { + $out = [ + 'type' => 'FeatureCollection', + 'crs' => [ + 'type' => 'name', + 'properties' => [ + 'name' => 'urn:ogc:def:crs:OGC:1.3:CRS84' + ] + ], + 'features' => [] + ]; + foreach ($isoCodes as $twoIsoCode => $isoCodePopupcontent) { + if ($isoCodePopupcontent === null) { + + $out['features'][] = [ + 'type' => 'Feature', + 'properties' => [ + ], + 'geometry' => self::getCountryGeoJson($twoIsoCode) + ]; + } else { + + $out['features'][] = [ + 'type' => 'Feature', + 'properties' => [ + 'popup' => $isoCodePopupcontent + ], + 'geometry' => self::getCountryGeoJson($twoIsoCode) + ]; + } + } + return $out; + } + +} diff --git a/Configuration/.htaccess b/Configuration/.htaccess new file mode 100755 index 0000000..896fbc5 --- /dev/null +++ b/Configuration/.htaccess @@ -0,0 +1,2 @@ +Order deny,allow +Deny from all \ No newline at end of file diff --git a/Configuration/Extbase/Persistence/Classes.php b/Configuration/Extbase/Persistence/Classes.php new file mode 100755 index 0000000..c1a0f45 --- /dev/null +++ b/Configuration/Extbase/Persistence/Classes.php @@ -0,0 +1,9 @@ + [ + 'tableName' => 'sys_file_reference', + ] +]; \ No newline at end of file diff --git a/Configuration/FlexForms/flexform_map.xml b/Configuration/FlexForms/flexform_map.xml new file mode 100755 index 0000000..54fbdc1 --- /dev/null +++ b/Configuration/FlexForms/flexform_map.xml @@ -0,0 +1,427 @@ + + + + + + Function + + array + + + + + group + tx_a2gmaps_domain_model_mapentry + + + false + + + false + + + false + + + + + + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.selectable_layers_description + + select + selectMultipleSideBySide + + + osm + 1 + + + stamen terrain + 10 + + + stamen watercolor + 11 + + + stamen toner + 12 + + + + 1 + + + + + + + select + selectSingle + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.hide + 0 + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.top + 1 + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.bottom + 2 + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.both + 3 + + + + + + + + + check + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.yes + 1 + + + + reload + + + + + select + selectMultipleSideBySide + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.none + + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.region_state + region + + + + FIELD:settings.showMarkerList:=:1 + + + + + + check + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.yes + 1 + + + + reload + + + + + input + trim,int + 3 + + FIELD:settings.useLayerSwitcher:=:1 + + + + + + input + trim,int + 2 + + 1 + 18 + + 2 + + 1 + 200 + + + + + + + input + trim,int + 2 + + 1 + 18 + + 18 + + 1 + 200 + + + + + + + + input + trim,float + 11 + 0 + + -90 + 90 + + + + + + + input + trim,float + 11 + 0 + + -90 + 90 + + + + + + + check + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.yes + 1 + + + + + + + + check + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.yes + 1 + + + + + + + + check + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.yes + 1 + + + + + + + + check + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.yes + 1 + + + + + + + + check + + + LLL:EXT:a2g_maps/Resources/Private/Language/backend.xlf:flexform_map.yes + 1 + + + + + + + + + inline + 1 + sys_file_reference + tablenames + uid_local + sorting_foreign + uid_foreign + uid_local + + + + file + gpx + + + + + + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette + + + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette + + + + image + + + 1 + + uid_local + 64 + 64 + + + 1 + 0 + 0 + 1 + 0 + 1 + 1 + + LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference + + + select + 1 + + + + + + + file + gpx + + + + + + + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette + + + + + + + + + + \ No newline at end of file diff --git a/Configuration/Services.yml b/Configuration/Services.yml new file mode 100755 index 0000000..c80168f --- /dev/null +++ b/Configuration/Services.yml @@ -0,0 +1,5 @@ +services: + _defaults: + autowire: true + autoconfigure: true + public: false \ No newline at end of file diff --git a/Configuration/TCA/Overrides/101_sys_template.php b/Configuration/TCA/Overrides/101_sys_template.php new file mode 100755 index 0000000..9ca4016 --- /dev/null +++ b/Configuration/TCA/Overrides/101_sys_template.php @@ -0,0 +1,21 @@ + [ + 'label' => 'title', + 'label_alt' => 'title,latitude,longitude', + 'label_alt_force' => false, +// 'label_userFunc' => \FriendsOfTYPO3\TtAddress\Hooks\Tca\Label::class . '->getAddressLabel', + 'languageField' => 'sys_language_uid', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'sortby' => 'sorting', + 'default_sortby' => 'ORDER BY crdate', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'cruser_id' => 'cruser_id', + 'prependAtCopy' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.prependAtCopy', + 'delete' => 'deleted', + 'title' => 'LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:a2g_maps', + 'versioningWS' => true, + 'origUid' => 't3_origuid', + 'thumbnail' => 'image', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + 'fe_group' => 'fe_group', + ], + 'iconfile' => 'EXT:a2g_maps/Resources/Public/Icons/map.png' + ], + 'columns' => [ + 'pid' => [ + 'label' => 'pid', + 'config' => [ + 'type' => 'passthrough' + ] + ], + 'crdate' => [ + 'label' => 'crdate', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime' + ] + ], + 'cruser_id' => [ + 'label' => 'cruser_id', + 'config' => [ + 'type' => 'passthrough' + ] + ], + 'tstamp' => [ + 'label' => 'tstamp', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime' + ] + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hidden', + 'config' => [ + 'type' => 'check' + ] + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:starttime_formlabel', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'size' => 16, + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:endtime_formlabel', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'size' => 16, + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'fe_group' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.fe_group', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'size' => 5, + 'maxitems' => 20, + 'items' => [ + [ + 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login', + -1, + ], + [ + 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login', + -2, + ], + [ + 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.usergroups', + '--div--', + ], + ], + 'exclusiveKeys' => '-1,-2', + 'foreign_table' => 'fe_groups', + 'foreign_table_where' => 'ORDER BY fe_groups.title', + ], + ], + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ] + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + 'default' => '' + ] + ], + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.title_person', + 'config' => [ + 'type' => 'input', + 'size' => 8, + 'eval' => 'trim', + 'max' => 255, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'path_segment' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:pages.slug', + 'displayCond' => 'VERSION:IS:false', + 'config' => [ + 'type' => 'slug', + 'size' => 50, + 'generatorOptions' => [ + 'fields' => ['title'], + 'fieldSeparator' => '-', + 'replacements' => [ + '/' => '-' + ], + ], + 'fallbackCharacter' => '-', + 'eval' => 'unique', + 'default' => '' + ] + ], + + 'city' => [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.city', + 'config' => [ + 'type' => 'input', + 'size' => 20, + 'eval' => 'trim', + 'max' => 255, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'addressline' => [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.address', + 'config' => [ + 'type' => 'input', + 'eval' => 'trim', + 'size' => 50, + 'max' => 80, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'zip' => [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.zip', + 'config' => [ + 'type' => 'input', + 'eval' => 'trim', + 'size' => 10, + 'max' => 20, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'region' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address.region', + 'config' => [ + 'type' => 'input', + 'size' => 10, + 'eval' => 'trim', + 'max' => 255, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'country' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.country', + 'config' => [ + 'type' => 'input', + 'size' => 20, + 'eval' => 'trim', + 'max' => 128, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + + 'latitude' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address.latitude', + 'config' => [ + 'type' => 'input', + 'eval' => \FriendsOfTYPO3\TtAddress\Evaluation\LatitudeEvaluation::class, + 'default' => null, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'longitude' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address.longitude', + 'config' => [ + 'type' => 'input', + 'eval' => \FriendsOfTYPO3\TtAddress\Evaluation\LongitudeEvaluation::class, + 'default' => null, + 'fieldControl' => [ + 'locationMap' => [ + 'renderType' => 'locationMapWizard' + ] + ], + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'image' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:image', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'popup_content' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:popup_content', + 'config' => [ + 'type' => 'text', + 'enableRichtext' => true, + 'fieldControl' => [ + 'fullScreenRichtext' => [ + 'disabled' => false, + ], + ], + ], + ], + 'nav_to_url' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:nav_to_url', + 'config' => [ + 'type' => 'input', + 'size' => 200, + 'eval' => 'trim', + 'max' => 1000, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'rel_marker' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:rel_marker', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'tx_a2gmaps_domain_model_marker', + 'foreign_field' => 'rel_map_entry', + 'size' => 5, + 'minitems' => 0, + 'maxitems' => 1, + 'autoSizeMax' => 20, + 'fieldControl' => [ + 'editPopup' => [ + 'disabled' => false, + 'options' => [ + 'windowOpenParameters' => 'height=300,width=500,status=0,menubar=0,scrollbars=1', + ], + ], + 'addRecord' => [ + 'disabled' => false, + ], + 'listModule' => [ + 'disabled' => false, + ], + ], + ], + ] + ], + 'types' => [ + '0' => [ + 'showitem' => ' + --palette--;LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:palette.general;general, + --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language, + --palette--;;language, + --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, + --palette--;;paletteHidden, + --palette--;;paletteAccess, + ' + ] + ], + 'palettes' => [ + 'general' => [ + 'showitem' => 'title, --linebreak--,addressline,zip,city,region, --linebreak--,latitude, longitude,--linebreak--, nav_to_url,--linebreak--, rel_marker, --linebreak--, popup_content, --linebreak--, image' + ], + 'paletteHidden' => [ + 'showitem' => 'hidden', + ], + 'paletteAccess' => [ + 'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.access', + 'showitem' => ' + starttime;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:starttime_formlabel, + endtime;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:endtime_formlabel, + --linebreak--, + fe_group;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:fe_group_formlabel + ', + ], + 'language' => ['showitem' => 'sys_language_uid'], + ], +]; diff --git a/Configuration/TCA/tx_a2gmaps_domain_model_marker.php b/Configuration/TCA/tx_a2gmaps_domain_model_marker.php new file mode 100755 index 0000000..f5e5259 --- /dev/null +++ b/Configuration/TCA/tx_a2gmaps_domain_model_marker.php @@ -0,0 +1,234 @@ + [ + 'label' => 'title', + 'label_alt' => 'map_icon', + 'label_alt_force' => true, + 'languageField' => 'sys_language_uid', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'default_sortby' => 'ORDER BY crdate', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'cruser_id' => 'cruser_id', + 'prependAtCopy' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.prependAtCopy', + 'delete' => 'deleted', + 'title' => 'LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:a2g_maps.marker', + 'versioningWS' => true, + 'origUid' => 't3_origuid', + 'thumbnail' => 'map_icon', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + 'fe_group' => 'fe_group', + ], + 'iconfile' => 'EXT:a2g_maps/Resources/Public/Icons/Marker/markerSolid.svg' + ], + 'columns' => [ + 'pid' => [ + 'label' => 'pid', + 'config' => [ + 'type' => 'passthrough' + ] + ], + 'crdate' => [ + 'label' => 'crdate', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime' + ] + ], + 'cruser_id' => [ + 'label' => 'cruser_id', + 'config' => [ + 'type' => 'passthrough' + ] + ], + 'tstamp' => [ + 'label' => 'tstamp', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime' + ] + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hidden', + 'config' => [ + 'type' => 'check' + ] + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:starttime_formlabel', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'size' => 16, + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:endtime_formlabel', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'size' => 16, + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'fe_group' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.fe_group', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'size' => 5, + 'maxitems' => 20, + 'items' => [ + [ + 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hide_at_login', + -1, + ], + [ + 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.any_login', + -2, + ], + [ + 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.usergroups', + '--div--', + ], + ], + 'exclusiveKeys' => '-1,-2', + 'foreign_table' => 'fe_groups', + 'foreign_table_where' => 'ORDER BY fe_groups.title', + ], + ], + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ] + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + 'default' => '' + ] + ], + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:title', + 'config' => [ + 'type' => 'input', + 'size' => 20, + 'eval' => 'trim', + 'max' => 255, + 'behaviour' => [ + 'allowLanguageSynchronization' => true, + ], + ] + ], + 'map_icon' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:map_icon', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'map_icon', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'rel_map_entry' => [ + 'label' => 'rel_travel_post', + 'config' => [ + 'type' => 'passthrough' + ] + ] + ], + 'types' => [ + '0' => [ + 'showitem' => ' + --palette--;LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:palette.general;general, + --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language, + --palette--;;language, + --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, + --palette--;;paletteHidden, + --palette--;;paletteAccess, + ' + ] + ], + 'palettes' => [ + 'general' => [ + 'showitem' => 'title, --linebreak--, map_icon' + ], + 'paletteHidden' => [ + 'showitem' => 'hidden', + ], + 'paletteAccess' => [ + 'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.access', + 'showitem' => ' + starttime;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:starttime_formlabel, + endtime;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:endtime_formlabel, + --linebreak--, + fe_group;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:fe_group_formlabel + ', + ], + 'language' => ['showitem' => 'sys_language_uid'], + ], +]; \ No newline at end of file diff --git a/Configuration/TsConfig/Page/All.tsconfig b/Configuration/TsConfig/Page/All.tsconfig new file mode 100755 index 0000000..983f3fe --- /dev/null +++ b/Configuration/TsConfig/Page/All.tsconfig @@ -0,0 +1,4 @@ +################## +#### TsConfig #### +################## + diff --git a/Configuration/TsConfig/Page/Wizards.tsconfig b/Configuration/TsConfig/Page/Wizards.tsconfig new file mode 100755 index 0000000..966eb47 --- /dev/null +++ b/Configuration/TsConfig/Page/Wizards.tsconfig @@ -0,0 +1,19 @@ +################################ +#### CONTENT ELEMENT WIZARD #### +################################ +mod.wizards.newContentElement.wizardItems.a2gMaps { + after = common, menu, special, forms, plugins, blog + header = LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:wizard.group.maps + elements { + a2gmaps_map { + iconIdentifier = a2g_maps-plugin-map + title = LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:plugin.map.title + description = LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:plugin.map.description + tt_content_defValues { + CType = list + list_type = a2gmaps_map + } + } + } + show = * +} diff --git a/Configuration/TypoScript/Base/constants.typoscript b/Configuration/TypoScript/Base/constants.typoscript new file mode 100755 index 0000000..40590f0 --- /dev/null +++ b/Configuration/TypoScript/Base/constants.typoscript @@ -0,0 +1,18 @@ +plugin.tx_a2gmaps { + view { + # cat=altogether maps/file; type=string; label=Path to template root (FE) + templateRootPath = EXT:a2g_maps/Resources/Private/Templates/ + # cat=altogether maps/file; type=string; label=Path to template partials (FE) + partialRootPath = EXT:a2g_maps/Resources/Private/Partials/ + # cat=altogether maps/file; type=string; label=Path to template layouts (FE) + layoutRootPath = EXT:a2g_maps/Resources/Private/Layouts/ + } + settings { + # cat=altogether maps//config; type=string; label=Path to default map marker + defaultMapMarker = /typo3conf/ext/a2g_openlayers/data/icons/markerSolid.svg + } + #persistence { + # cat=altogether maps//a; type=string; label=Default storage PID + # storagePid = + #} +} \ No newline at end of file diff --git a/Configuration/TypoScript/Base/setup.typoscript b/Configuration/TypoScript/Base/setup.typoscript new file mode 100755 index 0000000..df1e64e --- /dev/null +++ b/Configuration/TypoScript/Base/setup.typoscript @@ -0,0 +1,66 @@ +plugin.tx_a2gmaps_map { + view { + templateRootPaths.0 = EXT:a2g_maps/Resources/Private/Templates/ + templateRootPaths.1 = {$plugin.tx_a2gmaps.view.templateRootPath} + partialRootPaths.0 = EXT:a2g_maps/Resources/Private/Partials/ + partialRootPaths.1 = {$plugin.tx_a2gmaps.view.partialRootPath} + layoutRootPaths.0 = EXT:a2g_maps/Resources/Private/Layouts/ + layoutRootPaths.1 = {$plugin.tx_a2gmaps.view.layoutRootPath} + } + settings { + defaultMapMarker = {$plugin.tx_a2gmaps.settings.defaultMapMarker} + } + #persistence { + # storagePid = {$plugin.tx_a2gmaps.persistence.storagePid} + #recursive = 1 + #} +} + + +page.includeJSFooter.a2gMapsConfig = EXT:a2g_maps/Resources/Public/JavaScript/a2gMap.config.js +page.includeJSFooter.a2gMapsModule= EXT:a2g_maps/Resources/Public/JavaScript/a2gMap.min.js + +page.includeJSFooter.a2gMapsConfig { + disableCompression = 1 + excludeFromConcatenation = 1 +} +page.includeJSFooter.a2gMapsModule { + type = module + crossorigin = true + disableCompression = 1 + excludeFromConcatenation = 1 +} + +page.includeCSS { + a2gMaps = EXT:a2g_maps/Resources/Public/Scss/a2gMap.scss +} + +page.includeCSS.a2gMaps { + disableCompression = 1 + excludeFromConcatenation = 1 +} + + +a2gMapMarkers = PAGE +a2gMapMarkers { + typeNum = 1652369510 + config { + disableAllHeaderCode = 1 + admPanel = 0 + additionalHeaders.10.header = Content-type:application/json + xhtml_cleaning = 0 + debug = 0 + no_cache = 0 + } + 10 = USER + 10 { + userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run + extensionName = A2gMaps + pluginName = map + vendorName = Altogether + controller = Map + settings < plugin.tx_a2gmaps_map.settings + persistence < plugin.tx_a2gmaps_map.persistence + view < plugin.tx_a2gmaps_map.view + } +} diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript new file mode 100755 index 0000000..b31f1f5 --- /dev/null +++ b/Configuration/TypoScript/constants.typoscript @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript new file mode 100755 index 0000000..e7d35fd --- /dev/null +++ b/Configuration/TypoScript/setup.typoscript @@ -0,0 +1,3 @@ + + +# diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..2071b23 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100755 index 0000000..01f3681 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# a2g_maps + diff --git a/Resources/Private/.htaccess b/Resources/Private/.htaccess new file mode 100755 index 0000000..96d0729 --- /dev/null +++ b/Resources/Private/.htaccess @@ -0,0 +1,11 @@ +# Apache < 2.3 + + Order allow,deny + Deny from all + Satisfy All + + +# Apache >= 2.3 + + Require all denied + diff --git a/Resources/Private/Language/backend.xlf b/Resources/Private/Language/backend.xlf new file mode 100755 index 0000000..efbf80c --- /dev/null +++ b/Resources/Private/Language/backend.xlf @@ -0,0 +1,101 @@ + + + +
+ + + Position from map controll stuff + + + hide + + + top + + + bottom + + + both + + + + yes + + + + show marker list + + + + order marker list by + + + none + + + region / state + + + + use layer switcher + + + + layer switcher init value (%) + + + + map zoom + + + + map max zoom + + + + center latitude + + + + center longitude + + + + show layer select + + + + show my position button + + + + show remove marker button + + + + show fullscreen button + + + + show zoom slider + + + + selectable layers + + + one layer is requiered to show a map. use two if layer switcher is active and/or use more if layer select is active + + + + + markers + + + + gpx data + + + + diff --git a/Resources/Private/Language/de.backend.xlf b/Resources/Private/Language/de.backend.xlf new file mode 100755 index 0000000..e190243 --- /dev/null +++ b/Resources/Private/Language/de.backend.xlf @@ -0,0 +1,126 @@ + + + +
+ + + Position from map controll stuff + Position von Karten Bedien Elementen + + + hide + verbergen + + + top + darüber + + + bottom + darunter + + + both + beide + + + + yes + ja + + + + show marker list + Karten Eintragungen als Liste darstellen + + + + order marker list by + Karten Eintragungs Liste sortieren nach + + + none + ohne Sortierung + + + region/state + Region/Bundesland + + + + use layer switcher + Anzeigen von Karten Slider + + + + layer switcher init value (%) + Karten Slider initial Wert (%) + + + + map zoom + initial Zoom + + + + map max zoom + maximaler Zoom + + + + center latitude + initialer Breitengrad + + + + center longitude + initialer Längengrad + + + + show layer select + Karten Schichten selektierbar + + + + show my position button + meine Position anzeigen Knopf + + + + show remove marker button + Karten Markierung ein- ausblenden Knopf anzeigen + + + + show fullscreen button + Karte auf ganzen Bildschirm Knopf + + + + show zoom slider + Zoom Slider anzeigen + + + + selectable layers + Karten Schichten + + + + one layer is requiered to show a map. use two if layer switcher is active and/or use more if layer select is active + Eine Karten Schicht ist notwendig. Bei verwenudung vom Karten Slider sind zwei notwendig und/oder bei der verwendung von selektierbaren Karten Schichten sind min. zwei notwendig. + + + + markers + Karten Markierungen + + + + gpx data + gpx Daten + + + + diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf new file mode 100755 index 0000000..be6ff3a --- /dev/null +++ b/Resources/Private/Language/de.locallang.xlf @@ -0,0 +1,36 @@ + + + +
+ + + detail + mehr erfahren + + + article nr + Artikel Nr + + + search + suchen + + + advanced search + erweiterte Suche + + + search + suche + + + related products + Produkte mit dieser Zutat + + + used ingredients + Verwendete Zutaten + + + + diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf new file mode 100755 index 0000000..dfc4feb --- /dev/null +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -0,0 +1,78 @@ + + + +
+ + + additional popup content + Zusaetzlicher aufklappende Fenster Inhalt + + + + navigation url + Navigations Link + + + + marker icon ( optional ) + Marker Icon ( optional ) + + + + Map Entry + Karten Eintrag + + + + Coordinate + Koordinaten + + + + + Map + Karte + + + + altogether Map + altogether Karte + + + + Map + Karte + + + + General + General + + + + General + General + + + + Maps + Karten + + + + Map Marker + Karten Markierung + + + + map + Karte + + + + Altogether map + Altogether Karte + + + + \ No newline at end of file diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf new file mode 100755 index 0000000..6cf8b21 --- /dev/null +++ b/Resources/Private/Language/locallang.xlf @@ -0,0 +1,29 @@ + + + +
+ + + detail + + + article nr + + + search + + + advanced search + + + search + + + related products + + + used ingredients + + + + diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf new file mode 100755 index 0000000..f1d9dfd --- /dev/null +++ b/Resources/Private/Language/locallang_db.xlf @@ -0,0 +1,70 @@ + + + +
+ + + title + + + + map icon + + + + additional popup content + + + + navigation url + + + + marker icon ( optional ) + + + + Map Entry + + + + Coordinate + + + + Map + + + altogether Map + + + + Map + + + + General + + + + General + + + + Maps + + + + Map Marker + + + + Map + + + + Altogether map + + + + diff --git a/Resources/Private/Layouts/Default.html b/Resources/Private/Layouts/Default.html new file mode 100755 index 0000000..8c27505 --- /dev/null +++ b/Resources/Private/Layouts/Default.html @@ -0,0 +1,5 @@ + +
+ +
+ diff --git a/Resources/Private/Layouts/MapPopupContent.html b/Resources/Private/Layouts/MapPopupContent.html new file mode 100755 index 0000000..0e5f76a --- /dev/null +++ b/Resources/Private/Layouts/MapPopupContent.html @@ -0,0 +1,5 @@ + +
+ +
+ diff --git a/Resources/Private/Partials/Image.html b/Resources/Private/Partials/Image.html new file mode 100755 index 0000000..044695f --- /dev/null +++ b/Resources/Private/Partials/Image.html @@ -0,0 +1,80 @@ + + + + {variant.breakpoint as integer} + {variant.width as integer} + + + + {variant.aspectRatio as float} + {width / aspectRatio} + {height as integer} + + {f:if(condition: breakpoint, then: 'media="(min-width: {breakpoint}px)"')} + + + + {sizeConfig.multiplier as float} + {sizeWidth * width} + + + + {sizeConfig.multiplier as float} + {sizeHeight * height} + {f:uri.image(image: file, cropVariant: name, width: '{sizeWidth}c', height: '{sizeHeight}c',absolute:'true')} + + + + + {f:uri.image(image: file, cropVariant: 'default', width: maxWidth, absolute:'true')} + + + {f:uri.image(image: file, cropVariant: 'default', width: sizeWidth, absolute:'true')} + + + + + {srcset}{sizeUrl} {sizeKey}{f:if(condition: iteration.isLast, else: ',')} + + + f:format.raw()} srcset="{srcset}"> + + + + + + {defaultAspectRatio as float} + {defaultWidth / aspectRatio} + {defaultHeight as integer}c + + + + + + + + + + + + + + + + + + + + + + + + + {file.properties.alternative} + + + {file.properties.alternative} + + + + diff --git a/Resources/Private/Partials/Map/Controll.html b/Resources/Private/Partials/Map/Controll.html new file mode 100755 index 0000000..d8461b0 --- /dev/null +++ b/Resources/Private/Partials/Map/Controll.html @@ -0,0 +1,31 @@ + + + + + +
+ +
+ + +
+
+ +
+ + +
+
+ +
+ + +
+
+
+ + + + + diff --git a/Resources/Private/Partials/Map/List.html b/Resources/Private/Partials/Map/List.html new file mode 100755 index 0000000..9e9a8c0 --- /dev/null +++ b/Resources/Private/Partials/Map/List.html @@ -0,0 +1,72 @@ + + + +
+

+ +

+
+ +
+
+ + +
+
+
+
+ + +

+ {mapEntry.title} +

+
+
+
+ + + {mapEntry.addressline} + + + + +
{mapEntry.zip} +
+
+ + + {mapEntry.city} + + + + +
{mapEntry.region} +
+
+
+ + + + {mapEntry.popupContent} + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+ diff --git a/Resources/Private/Templates/Map/Map.html b/Resources/Private/Templates/Map/Map.html new file mode 100755 index 0000000..d82aa0f --- /dev/null +++ b/Resources/Private/Templates/Map/Map.html @@ -0,0 +1,31 @@ + + + + +
+
+
+ +
+
+ + + + + +
+ + + +
+ + +
+ +
+
+
+
+ diff --git a/Resources/Private/Templates/Map/Popup.html b/Resources/Private/Templates/Map/Popup.html new file mode 100755 index 0000000..1a57fc0 --- /dev/null +++ b/Resources/Private/Templates/Map/Popup.html @@ -0,0 +1,54 @@ + + + + + + + + + +
+ + +

+ {mapEntry.title} +

+
+
+
+ + + {mapEntry.addressline} + + + + +
{mapEntry.zip} +
+
+ + + {mapEntry.city} + + + + +
{mapEntry.region} +
+
+
+ + + + {mapEntry.popupContent} + + + + + + + + +
+
+ diff --git a/Resources/Public/Icons/Extension.png b/Resources/Public/Icons/Extension.png new file mode 100755 index 0000000..a190977 Binary files /dev/null and b/Resources/Public/Icons/Extension.png differ diff --git a/Resources/Public/Icons/Marker/frog.svg b/Resources/Public/Icons/Marker/frog.svg new file mode 100755 index 0000000..0d299c5 --- /dev/null +++ b/Resources/Public/Icons/Marker/frog.svg @@ -0,0 +1,172 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Resources/Public/Icons/Marker/logo-slim.svg b/Resources/Public/Icons/Marker/logo-slim.svg new file mode 100755 index 0000000..36f0cf9 --- /dev/null +++ b/Resources/Public/Icons/Marker/logo-slim.svg @@ -0,0 +1,177 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Resources/Public/Icons/Marker/markerSolid.svg b/Resources/Public/Icons/Marker/markerSolid.svg new file mode 100755 index 0000000..7baf0ea --- /dev/null +++ b/Resources/Public/Icons/Marker/markerSolid.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/Resources/Public/Icons/a2g.gif b/Resources/Public/Icons/a2g.gif new file mode 100755 index 0000000..c725214 Binary files /dev/null and b/Resources/Public/Icons/a2g.gif differ diff --git a/Resources/Public/Icons/map.png b/Resources/Public/Icons/map.png new file mode 100755 index 0000000..80726ea Binary files /dev/null and b/Resources/Public/Icons/map.png differ diff --git a/Resources/Public/JavaScript/a2gMap.config.js b/Resources/Public/JavaScript/a2gMap.config.js new file mode 100755 index 0000000..85cd77b --- /dev/null +++ b/Resources/Public/JavaScript/a2gMap.config.js @@ -0,0 +1,6 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Other/javascript.js to edit this template + */ + + diff --git a/Resources/Public/JavaScript/a2gMap.min.js b/Resources/Public/JavaScript/a2gMap.min.js new file mode 100755 index 0000000..fcf82fe --- /dev/null +++ b/Resources/Public/JavaScript/a2gMap.min.js @@ -0,0 +1,9 @@ +var Yl=Object.defineProperty,Ul=Object.defineProperties;var Wl=Object.getOwnPropertyDescriptors;var Vo=Object.getOwnPropertySymbols;var Bl=Object.prototype.hasOwnProperty,Zl=Object.prototype.propertyIsEnumerable;var Ho=(i,r,t)=>r in i?Yl(i,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[r]=t,$o=(i,r)=>{for(var t in r||(r={}))Bl.call(r,t)&&Ho(i,t,r[t]);if(Vo)for(var t of Vo(r))Zl.call(r,t)&&Ho(i,t,r[t]);return i},qo=(i,r)=>Ul(i,Wl(r));const zl=function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))e(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&e(a)}).observe(document,{childList:!0,subtree:!0});function t(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerpolicy&&(o.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?o.credentials="include":n.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function e(n){if(n.ep)return;n.ep=!0;const o=t(n);fetch(n.href,o)}};zl();function F(){return function(){throw new Error("Unimplemented abstract method.")}()}var Kl=0;function H(i){return i.ol_uid||(i.ol_uid=String(++Kl))}var Vl="6.14.1",Hl=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),$l=function(i){Hl(r,i);function r(t){var e=this,n="v"+Vl.split("-")[0],o="Assertion failed. See https://openlayers.org/en/"+n+"/doc/errors/#"+t+" for details.";return e=i.call(this,o)||this,e.code=t,e.name="AssertionError",e.message=o,e}return r}(Error),Ja=$l,ql=function(){function i(r){this.propagationStopped,this.defaultPrevented,this.type=r,this.target=null}return i.prototype.preventDefault=function(){this.defaultPrevented=!0},i.prototype.stopPropagation=function(){this.propagationStopped=!0},i}();function Jl(i){i.stopPropagation()}var Ht=ql,Er={PROPERTYCHANGE:"propertychange"},Ql=function(){function i(){this.disposed=!1}return i.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},i.prototype.disposeInternal=function(){},i}(),eo=Ql;function tu(i,r,t){for(var e,n,o=t||Ke,a=0,s=i.length,l=!1;a>1),n=+o(i[e],r),n<0?a=e+1:(s=e,l=!n);return l?a:~a}function Ke(i,r){return i>r?1:i=0}function ro(i,r,t){var e=i.length;if(i[0]<=r)return 0;if(r<=i[e-1])return e-1;var n=void 0;if(t>0){for(n=1;n0?n-1:n:i[n-1]-r0||t&&a===0)})}function _r(){return!0}function ei(){return!1}function Ve(){}function nu(i){var r=!1,t,e,n;return function(){var o=Array.prototype.slice.call(arguments);return(!r||this!==n||!qe(o,e))&&(r=!0,n=this,e=o,t=i.apply(this,arguments)),t}}var ut=typeof Object.assign=="function"?Object.assign:function(i,r){if(i==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(i),e=1,n=arguments.length;e0:!1},r.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var o=n.indexOf(e);o!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[o]=Ve,++this.pendingRemovals_[t]):(n.splice(o,1),n.length===0&&delete this.listeners_[t]))}},r}(eo),xr=ou,G={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function W(i,r,t,e,n){if(e&&e!==i&&(t=t.bind(e)),n){var o=t;t=function(){i.removeEventListener(r,t),o.apply(this,arguments)}}var a={target:i,type:r,listener:t};return i.addEventListener(r,t),a}function kn(i,r,t,e){return W(i,r,t,e,!0)}function J(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),tn(i))}var au=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ri=function(i){au(r,i);function r(){var t=i.call(this)||this;return t.on=t.onInternal,t.once=t.onceInternal,t.un=t.unInternal,t.revision_=0,t}return r.prototype.changed=function(){++this.revision_,this.dispatchEvent(G.CHANGE)},r.prototype.getRevision=function(){return this.revision_},r.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,o=new Array(n),a=0;a0;)this.pop()},r.prototype.extend=function(t){for(var e=0,n=t.length;e=0||Se.match(/cpu (os|iphone os) 15_4 like mac os x/));var vu=Se.indexOf("webkit")!==-1&&Se.indexOf("edge")==-1,ns=Se.indexOf("macintosh")!==-1,is=typeof devicePixelRatio!="undefined"?devicePixelRatio:1,ni=typeof WorkerGlobalScope!="undefined"&&typeof OffscreenCanvas!="undefined"&&self instanceof WorkerGlobalScope,gu=typeof Image!="undefined"&&Image.prototype.decode,os=function(){var i=!1;try{var r=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,r),window.removeEventListener("_",null,r)}catch{}return i}();new Array(6);function Kt(){return[1,0,0,1,0,0]}function _u(i,r,t,e,n,o,a){return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i[4]=o,i[5]=a,i}function yu(i,r){return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i}function st(i,r){var t=r[0],e=r[1];return r[0]=i[0]*t+i[2]*e+i[4],r[1]=i[1]*t+i[3]*e+i[5],r}function mu(i,r,t){return _u(i,r,0,0,t,0,0)}function se(i,r,t,e,n,o,a,s){var l=Math.sin(o),u=Math.cos(o);return i[0]=e*u,i[1]=n*l,i[2]=-e*l,i[3]=n*u,i[4]=a*e*u-s*e*l+r,i[5]=a*n*l+s*n*u+t,i}function no(i,r){var t=Eu(r);B(t!==0,32);var e=r[0],n=r[1],o=r[2],a=r[3],s=r[4],l=r[5];return i[0]=a/t,i[1]=-n/t,i[2]=-o/t,i[3]=e/t,i[4]=(o*l-a*s)/t,i[5]=-(e*l-n*s)/t,i}function Eu(i){return i[0]*i[3]-i[1]*i[2]}var ea;function as(i){var r="matrix("+i.join(", ")+")";if(ni)return r;var t=ea||(ea=document.createElement("div"));return t.style.transform=r,t.style.transform}var Xr={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},vt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function ra(i){for(var r=Pt(),t=0,e=i.length;tn&&(l=l|vt.RIGHT),so&&(l=l|vt.ABOVE),l===vt.UNKNOWN&&(l=vt.INTERSECTING),l}function Pt(){return[1/0,1/0,-1/0,-1/0]}function le(i,r,t,e,n){return n?(n[0]=i,n[1]=r,n[2]=t,n[3]=e,n):[i,r,t,e]}function rn(i){return le(1/0,1/0,-1/0,-1/0,i)}function ls(i,r){var t=i[0],e=i[1];return le(t,e,t,e,r)}function us(i,r,t,e,n){var o=rn(n);return hs(o,i,r,t,e)}function zr(i,r){return i[0]==r[0]&&i[2]==r[2]&&i[1]==r[1]&&i[3]==r[3]}function oo(i,r){return r[0]i[2]&&(i[2]=r[2]),r[1]i[3]&&(i[3]=r[3]),i}function Br(i,r){r[0]i[2]&&(i[2]=r[0]),r[1]i[3]&&(i[3]=r[1])}function hs(i,r,t,e,n){for(;tr[0]?e[0]=i[0]:e[0]=r[0],i[1]>r[1]?e[1]=i[1]:e[1]=r[1],i[2]=r[0]&&i[1]<=r[3]&&i[3]>=r[1]}function ao(i){return i[2]=a&&v<=l),!e&&!!(o&vt.RIGHT)&&!(n&vt.RIGHT)&&(g=p-(c-l)*d,e=g>=s&&g<=u),!e&&!!(o&vt.BELOW)&&!(n&vt.BELOW)&&(v=c-(p-s)/d,e=v>=a&&v<=l),!e&&!!(o&vt.LEFT)&&!(n&vt.LEFT)&&(g=p-(c-a)*d,e=g>=s&&g<=u)}return e}function wu(i,r){var t=r.getExtent(),e=Re(i);if(r.canWrapX()&&(e[0]=t[2])){var n=it(t),o=Math.floor((e[0]-t[0])/n),a=o*n;i[0]-=a,i[2]-=a}return i}var Su=function(){function i(r){this.code_=r.code,this.units_=r.units,this.extent_=r.extent!==void 0?r.extent:null,this.worldExtent_=r.worldExtent!==void 0?r.worldExtent:null,this.axisOrientation_=r.axisOrientation!==void 0?r.axisOrientation:"enu",this.global_=r.global!==void 0?r.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=r.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=r.metersPerUnit}return i.prototype.canWrapX=function(){return this.canWrapX_},i.prototype.getCode=function(){return this.code_},i.prototype.getExtent=function(){return this.extent_},i.prototype.getUnits=function(){return this.units_},i.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Vt[this.units_]},i.prototype.getWorldExtent=function(){return this.worldExtent_},i.prototype.getAxisOrientation=function(){return this.axisOrientation_},i.prototype.isGlobal=function(){return this.global_},i.prototype.setGlobal=function(r){this.global_=r,this.canWrapX_=!!(r&&this.extent_)},i.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},i.prototype.setDefaultTileGrid=function(r){this.defaultTileGrid_=r},i.prototype.setExtent=function(r){this.extent_=r,this.canWrapX_=!!(this.global_&&r)},i.prototype.setWorldExtent=function(r){this.worldExtent_=r},i.prototype.setGetPointResolution=function(r){this.getPointResolutionFunc_=r},i.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},i}(),fs=Su;function ot(i,r,t){return Math.min(Math.max(i,r),t)}var Ru=function(){var i;return"cosh"in Math?i=Math.cosh:i=function(r){var t=Math.exp(r);return(t+1/t)/2},i}(),Pu=function(){var i;return"log2"in Math?i=Math.log2:i=function(r){return Math.log(r)*Math.LOG2E},i}();function Lu(i,r,t,e,n,o){var a=n-t,s=o-e;if(a!==0||s!==0){var l=((i-t)*a+(r-e)*s)/(a*a+s*s);l>1?(t=n,e=o):l>0&&(t+=a*l,e+=s*l)}return Be(i,r,t,e)}function Be(i,r,t,e){var n=t-i,o=e-r;return n*n+o*o}function Iu(i){for(var r=i.length,t=0;tn&&(n=a,e=o)}if(n===0)return null;var s=i[e];i[e]=i[t],i[t]=s;for(var l=t+1;l=0;c--){f[c]=i[c][r]/i[c][c];for(var p=c-1;p>=0;p--)i[p][r]-=i[p][c]*f[c]}return f}function na(i){return i*180/Math.PI}function Ze(i){return i*Math.PI/180}function yr(i,r){var t=i%r;return t*r<0?t+r:t}function ie(i,r,t){return i+t*(r-i)}function ps(i,r){var t=Math.pow(10,r);return Math.round(i*t)/t}function Cn(i,r){return Math.floor(ps(i,r))}function xn(i,r){return Math.ceil(ps(i,r))}var Au=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),nn=6378137,gr=Math.PI*nn,Mu=[-gr,-gr,gr,gr],Fu=[-180,-85,180,85],On=nn*Math.log(Math.tan(Math.PI/2)),sr=function(i){Au(r,i);function r(t){return i.call(this,{code:t,units:oe.METERS,extent:Mu,global:!0,worldExtent:Fu,getPointResolution:function(e,n){return e/Ru(n[1]/nn)}})||this}return r}(fs),ia=[new sr("EPSG:3857"),new sr("EPSG:102100"),new sr("EPSG:102113"),new sr("EPSG:900913"),new sr("http://www.opengis.net/def/crs/EPSG/0/3857"),new sr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Nu(i,r,t){var e=i.length,n=t>1?t:2,o=r;o===void 0&&(n>2?o=i.slice():o=new Array(e));for(var a=0;aOn?s=On:s<-On&&(s=-On),o[a+1]=s}return o}function Du(i,r,t){var e=i.length,n=t>1?t:2,o=r;o===void 0&&(n>2?o=i.slice():o=new Array(e));for(var a=0;ar?e:new Array(1+r-n).join("0")+e}function ds(i,r){return i[0]+=+r[0],i[1]+=+r[1],i}function jn(i,r){for(var t=!0,e=i.length-1;e>=0;--e)if(i[e]!=r[e]){t=!1;break}return t}function so(i,r){var t=Math.cos(r),e=Math.sin(r),n=i[0]*t-i[1]*e,o=i[1]*t+i[0]*e;return i[0]=n,i[1]=o,i}function vs(i,r){return i[0]*=r,i[1]*=r,i}function gs(i,r){if(r.canWrapX()){var t=it(r.getExtent()),e=Uu(i,r,t);e&&(i[0]-=e*t)}return i}function Uu(i,r,t){var e=r.getExtent(),n=0;if(r.canWrapX()&&(i[0]e[2])){var o=t||it(e);n=Math.floor((i[0]-e[0])/o)}return n}var _s=63710088e-1;function sa(i,r,t){var e=t||_s,n=Ze(i[1]),o=Ze(r[1]),a=(o-n)/2,s=Ze(r[0]-i[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(o);return 2*e*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Wu(i,r,t,e){var n=e||_s,o=Ze(i[1]),a=Ze(i[0]),s=r/n,l=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(t)),u=a+Math.atan2(Math.sin(t)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(l));return[na(u),na(l)]}var Wi=!0;function ys(i){var r=i===void 0?!0:i;Wi=!r}function lo(i,r,t){var e;if(r!==void 0){for(var n=0,o=i.length;n=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(Wi=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function Es(i,r){return i}function Xe(i,r){return i}function $u(){ua(ia),ua(aa),zu(aa,ia,Nu,Du)}$u();function ze(i,r,t,e,n,o){for(var a=o||[],s=0,l=r;l1)f=t;else if(c>0){for(var p=0;pn&&(n=u),o=s,a=l}return n}function fo(i,r,t,e,n){for(var o=0,a=t.length;o0;){for(var f=u.pop(),c=u.pop(),p=0,d=i[c],v=i[c+1],g=i[f],m=i[f+1],_=c+e;_p&&(h=_,p=T)}p>n&&(l[(h-r)/e]=1,c+e0&&v>p)&&(d<0&&g0&&g>d)){u=f,h=c;continue}o[a++]=u,o[a++]=h,s=u,l=h,u=f,h=c}}return o[a++]=u,o[a++]=h,a}function xs(i,r,t,e,n,o,a,s){for(var l=0,u=t.length;lo&&(u-s)*(o-l)-(n-s)*(h-l)>0&&a++:h<=o&&(u-s)*(o-l)-(n-s)*(h-l)<0&&a--,s=u,l=h}return a!==0}function yo(i,r,t,e,n,o){if(t.length===0||!Ye(i,r,t[0],e,n,o))return!1;for(var a=1,s=t.length;aE&&(u=(h+f)/2,yo(i,r,t,e,u,d)&&(y=u,E=T)),h=f}return isNaN(y)&&(y=n[o]),a?(a.push(y,d,E),a):[y,d,E]}function mh(i,r,t,e,n){for(var o=[],a=0,s=t.length;a=n[0]&&o[2]<=n[2]||o[1]>=n[1]&&o[3]<=n[3]?!0:Rs(i,r,t,e,function(a,s){return Ou(n,a,s)}):!1}function Eh(i,r,t,e,n){for(var o=0,a=t.length;o0}function Is(i,r,t,e,n){for(var o=n!==void 0?n:!1,a=0,s=t.length;a1?a:2,E=o||new Array(y),d=0;d>1;n0&&i[1]>0}function Dh(i,r,t){return t===void 0&&(t=[0,0]),t[0]=i[0]*r+.5|0,t[1]=i[1]*r+.5|0,t}function Ft(i,r){return Array.isArray(i)?i:(r===void 0?r=[i,i]:(r[0]=i,r[1]=i),r)}var Gh=function(){function i(r){this.opacity_=r.opacity,this.rotateWithView_=r.rotateWithView,this.rotation_=r.rotation,this.scale_=r.scale,this.scaleArray_=Ft(r.scale),this.displacement_=r.displacement}return i.prototype.clone=function(){var r=this.getScale();return new i({opacity:this.getOpacity(),scale:Array.isArray(r)?r.slice():r,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},i.prototype.getOpacity=function(){return this.opacity_},i.prototype.getRotateWithView=function(){return this.rotateWithView_},i.prototype.getRotation=function(){return this.rotation_},i.prototype.getScale=function(){return this.scale_},i.prototype.getScaleArray=function(){return this.scaleArray_},i.prototype.getDisplacement=function(){return this.displacement_},i.prototype.getAnchor=function(){return F()},i.prototype.getImage=function(r){return F()},i.prototype.getHitDetectionImage=function(){return F()},i.prototype.getPixelRatio=function(r){return 1},i.prototype.getImageState=function(){return F()},i.prototype.getImageSize=function(){return F()},i.prototype.getOrigin=function(){return F()},i.prototype.getSize=function(){return F()},i.prototype.setDisplacement=function(r){this.displacement_=r},i.prototype.setOpacity=function(r){this.opacity_=r},i.prototype.setRotateWithView=function(r){this.rotateWithView_=r},i.prototype.setRotation=function(r){this.rotation_=r},i.prototype.setScale=function(r){this.scale_=r,this.scaleArray_=Ft(r)},i.prototype.listenImageChange=function(r){F()},i.prototype.load=function(){F()},i.prototype.unlistenImageChange=function(r){F()},i}(),Ns=Gh,kh=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,bh=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ds(i){return typeof i=="string"?i:Gs(i)}function jh(i){var r=document.createElement("div");if(r.style.color=i,r.style.color!==""){document.body.appendChild(r);var t=getComputedStyle(r).color;return document.body.removeChild(r),t}else return""}var Xh=function(){var i=1024,r={},t=0;return function(e){var n;if(r.hasOwnProperty(e))n=r[e];else{if(t>=i){var o=0;for(var a in r)(o++&3)===0&&(delete r[a],--t)}n=Yh(e),r[e]=n,++t}return n}}();function Wn(i){return Array.isArray(i)?i:Xh(i)}function Yh(i){var r,t,e,n,o;if(bh.exec(i)&&(i=jh(i)),kh.exec(i)){var a=i.length-1,s=void 0;a<=4?s=1:s=2;var l=a===4||a===8;r=parseInt(i.substr(1+0*s,s),16),t=parseInt(i.substr(1+1*s,s),16),e=parseInt(i.substr(1+2*s,s),16),l?n=parseInt(i.substr(1+3*s,s),16):n=255,s==1&&(r=(r<<4)+r,t=(t<<4)+t,e=(e<<4)+e,l&&(n=(n<<4)+n)),o=[r,t,e,n/255]}else i.indexOf("rgba(")==0?(o=i.slice(5,-1).split(",").map(Number),_a(o)):i.indexOf("rgb(")==0?(o=i.slice(4,-1).split(",").map(Number),o.push(1),_a(o)):B(!1,14);return o}function _a(i){return i[0]=ot(i[0]+.5|0,0,255),i[1]=ot(i[1]+.5|0,0,255),i[2]=ot(i[2]+.5|0,0,255),i[3]=ot(i[3],0,1),i}function Gs(i){var r=i[0];r!=(r|0)&&(r=r+.5|0);var t=i[1];t!=(t|0)&&(t=t+.5|0);var e=i[2];e!=(e|0)&&(e=e+.5|0);var n=i[3]===void 0?1:Math.round(i[3]*100)/100;return"rgba("+r+","+t+","+e+","+n+")"}function zt(i){return Array.isArray(i)?Gs(i):i}function kt(i,r,t,e){var n;return t&&t.length?n=t.shift():ni?n=new OffscreenCanvas(i||300,r||300):n=document.createElement("canvas"),i&&(n.width=i),r&&(n.height=r),n.getContext("2d",e)}function Uh(i){var r=i.offsetWidth,t=getComputedStyle(i);return r+=parseInt(t.marginLeft,10)+parseInt(t.marginRight,10),r}function Wh(i){var r=i.offsetHeight,t=getComputedStyle(i);return r+=parseInt(t.marginTop,10)+parseInt(t.marginBottom,10),r}function Bn(i,r){var t=r.parentNode;t&&t.replaceChild(i,r)}function Zn(i){return i&&i.parentNode?i.parentNode.removeChild(i):null}function ks(i){for(;i.lastChild;)i.removeChild(i.lastChild)}function Bh(i,r){for(var t=i.childNodes,e=0;;++e){var n=t[e],o=r[e];if(!n&&!o)break;if(n!==o){if(!n){i.appendChild(o);continue}if(!o){i.removeChild(n),--e;continue}i.insertBefore(o,n)}}}var wn="ol-hidden",Zh="ol-selectable",He="ol-unselectable",ya="ol-unsupported",on="ol-control",ma="ol-collapsed",zh=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),Ea=["style","variant","weight","size","lineHeight","family"],bs=function(i){var r=i.match(zh);if(!r)return null;for(var t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},e=0,n=Ea.length;e=i.maxResolution)return!1;var e=r.zoom;return e>i.minZoom&&e<=i.maxZoom}var ci=fc;function pc(i,r,t,e,n){Zs(i,r,t||0,e||i.length-1,n||dc)}function Zs(i,r,t,e,n){for(;e>t;){if(e-t>600){var o=e-t+1,a=r-t+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),h=Math.max(t,Math.floor(r-a*l/o+u)),f=Math.min(e,Math.floor(r+(o-a)*l/o+u));Zs(i,r,h,f,n)}var c=i[r],p=t,d=e;for(kr(i,t,r),n(i[e],c)>0&&kr(i,t,e);p0;)d--}n(i[t],c)===0?kr(i,t,d):(d++,kr(i,d,e)),d<=r&&(t=d+1),r<=d&&(e=d-1)}}function kr(i,r,t){var e=i[r];i[r]=i[t],i[t]=e}function dc(i,r){return ir?1:0}class zs{constructor(r=9){this._maxEntries=Math.max(4,r),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(r){let t=this.data;const e=[];if(!Rn(r,t))return e;const n=this.toBBox,o=[];for(;t;){for(let a=0;a=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(n,o,t)}_split(r,t){const e=r[t],n=e.children.length,o=this._minEntries;this._chooseSplitAxis(e,o,n);const a=this._chooseSplitIndex(e,o,n),s=pr(e.children.splice(a,e.children.length-a));s.height=e.height,s.leaf=e.leaf,lr(e,this.toBBox),lr(s,this.toBBox),t?r[t-1].children.push(s):this._splitRoot(e,s)}_splitRoot(r,t){this.data=pr([r,t]),this.data.height=r.height+1,this.data.leaf=!1,lr(this.data,this.toBBox)}_chooseSplitIndex(r,t,e){let n,o=1/0,a=1/0;for(let s=t;s<=e-t;s++){const l=Yr(r,0,s,this.toBBox),u=Yr(r,s,e,this.toBBox),h=mc(l,u),f=Ci(l)+Ci(u);h=t;u--){const h=r.children[u];Ur(s,r.leaf?o(h):h),l+=Sn(s)}return l}_adjustParentBBoxes(r,t,e){for(let n=e;n>=0;n--)Ur(t[n],r)}_condense(r){for(let t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():lr(r[t],this.toBBox)}}function vc(i,r,t){if(!t)return r.indexOf(i);for(let e=0;e=i.minX&&r.maxY>=i.minY}function pr(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function xa(i,r,t,e,n){const o=[r,t];for(;o.length;){if(t=o.pop(),r=o.pop(),t-r<=e)continue;const a=r+Math.ceil((t-r)/e/2)*e;pc(i,a,r,t,n),o.push(r,a,a,t)}}var Ec=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Oa={RENDER_ORDER:"renderOrder"},Tc=function(i){Ec(r,i);function r(t){var e=this,n=t||{},o=ut({},n);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,e=i.call(this,o)||this,e.declutter_=n.declutter!==void 0?n.declutter:!1,e.renderBuffer_=n.renderBuffer!==void 0?n.renderBuffer:100,e.style_=null,e.styleFunction_=void 0,e.setStyle(n.style),e.updateWhileAnimating_=n.updateWhileAnimating!==void 0?n.updateWhileAnimating:!1,e.updateWhileInteracting_=n.updateWhileInteracting!==void 0?n.updateWhileInteracting:!1,e}return r.prototype.getDeclutter=function(){return this.declutter_},r.prototype.getFeatures=function(t){return i.prototype.getFeatures.call(this,t)},r.prototype.getRenderBuffer=function(){return this.renderBuffer_},r.prototype.getRenderOrder=function(){return this.get(Oa.RENDER_ORDER)},r.prototype.getStyle=function(){return this.style_},r.prototype.getStyleFunction=function(){return this.styleFunction_},r.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},r.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},r.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new zs(9)),this.getRenderer().renderDeclutter(t)},r.prototype.setRenderOrder=function(t){this.set(Oa.RENDER_ORDER,t)},r.prototype.setStyle=function(t){this.style_=t!==void 0?t:oc,this.styleFunction_=t===null?void 0:ic(this.style_),this.changed()},r}(ci),Cc=Tc,an={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Pn=[an.FILL],xe=[an.STROKE],We=[an.BEGIN_PATH],wa=[an.CLOSE_PATH],N=an,xc=function(){function i(){}return i.prototype.drawCustom=function(r,t,e,n){},i.prototype.drawGeometry=function(r){},i.prototype.setStyle=function(r){},i.prototype.drawCircle=function(r,t){},i.prototype.drawFeature=function(r,t){},i.prototype.drawGeometryCollection=function(r,t){},i.prototype.drawLineString=function(r,t){},i.prototype.drawMultiLineString=function(r,t){},i.prototype.drawMultiPoint=function(r,t){},i.prototype.drawMultiPolygon=function(r,t){},i.prototype.drawPoint=function(r,t){},i.prototype.drawPolygon=function(r,t){},i.prototype.drawText=function(r,t){},i.prototype.setFillStrokeStyle=function(r,t){},i.prototype.setImageStyle=function(r,t){},i.prototype.setTextStyle=function(r,t){},i}(),Ks=xc,Oc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),wc=function(i){Oc(r,i);function r(t,e,n,o){var a=i.call(this)||this;return a.tolerance=t,a.maxExtent=e,a.pixelRatio=o,a.maxLineWidth=0,a.resolution=n,a.beginGeometryInstruction1_=null,a.beginGeometryInstruction2_=null,a.bufferedMaxExtent_=null,a.instructions=[],a.coordinates=[],a.tmpCoordinate_=[],a.hitDetectionInstructions=[],a.state={},a}return r.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return e==1?t:t.map(function(n){return n*e})},r.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,a=this.coordinates,s=a.length,l=0,u=t.length;ll&&(this.instructions.push([N.CUSTOM,l,h,t,n,Ce]),this.hitDetectionInstructions.push([N.CUSTOM,l,h,t,o||n,Ce]));break;case P.POINT:u=t.getFlatCoordinates(),this.coordinates.push(u[0],u[1]),h=this.coordinates.length,this.instructions.push([N.CUSTOM,l,h,t,n]),this.hitDetectionInstructions.push([N.CUSTOM,l,h,t,o||n]);break}this.endGeometry(e)},r.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[N.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[N.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},r.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},r.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var e,n=t.length,o,a,s=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},r.prototype.createFill=function(t){var e=t.fillStyle,n=[N.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(!0),n},r.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},r.prototype.createStroke=function(t){return[N.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},r.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},r.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,o=t.lineCap,a=t.lineDash,s=t.lineDashOffset,l=t.lineJoin,u=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=o||a!=t.currentLineDash&&!qe(t.currentLineDash,a)||t.currentLineDashOffset!=s||t.currentLineJoin!=l||t.currentLineWidth!=u||t.currentMiterLimit!=h)&&(n!==void 0&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=o,t.currentLineDash=a,t.currentLineDashOffset=s,t.currentLineJoin=l,t.currentLineWidth=u,t.currentMiterLimit=h)},r.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[N.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},r.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=ss(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;ii(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},r}(Ks),sn=wc,Sc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Rc=function(i){Sc(r,i);function r(t,e,n,o){var a=i.call(this,t,e,n,o)||this;return a.hitDetectionImage_=null,a.image_=null,a.imagePixelRatio_=void 0,a.anchorX_=void 0,a.anchorY_=void 0,a.height_=void 0,a.opacity_=void 0,a.originX_=void 0,a.originY_=void 0,a.rotateWithView_=void 0,a.rotation_=void 0,a.scale_=void 0,a.width_=void 0,a.declutterImageWithText_=void 0,a}return r.prototype.drawPoint=function(t,e){if(!!this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(n,o);this.instructions.push([N.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([N.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},r.prototype.drawMultiPoint=function(t,e){if(!!this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(n,o);this.instructions.push([N.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([N.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},r.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,i.prototype.finish.call(this)},r.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),o=t.getSize(),a=t.getHitDetectionImage(),s=t.getImage(this.pixelRatio),l=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=a,this.image_=s,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=l[0]*this.imagePixelRatio_,this.originY_=l[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},r}(sn),Pc=Rc,Lc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ic=function(i){Lc(r,i);function r(t,e,n,o){return i.call(this,t,e,n,o)||this}return r.prototype.drawFlatCoordinates_=function(t,e,n,o){var a=this.coordinates.length,s=this.appendFlatLineCoordinates(t,e,n,o,!1,!1),l=[N.MOVE_TO_LINE_TO,a,s];return this.instructions.push(l),this.hitDetectionInstructions.push(l),n},r.prototype.drawLineString=function(t,e){var n=this.state,o=n.strokeStyle,a=n.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Vr,Hr],We);var s=t.getFlatCoordinates(),l=t.getStride();this.drawFlatCoordinates_(s,0,s.length,l),this.hitDetectionInstructions.push(xe),this.endGeometry(e)}},r.prototype.drawMultiLineString=function(t,e){var n=this.state,o=n.strokeStyle,a=n.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],We);for(var s=t.getEnds(),l=t.getFlatCoordinates(),u=t.getStride(),h=0,f=0,c=s.length;fi&&(l>s&&(s=l,o=u,a=f),l=0,u=f-n)),c=p,g=_,m=y),d=E,v=T}return l+=p,l>s?[u,f]:[o,a]}var Dc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),$n={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Gc=function(i){Dc(r,i);function r(t,e,n,o){var a=i.call(this,t,e,n,o)||this;return a.labels_=null,a.text_="",a.textOffsetX_=0,a.textOffsetY_=0,a.textRotateWithView_=void 0,a.textRotation_=0,a.textFillState_=null,a.fillStates={},a.textStrokeState_=null,a.strokeStates={},a.textState_={},a.textStates={},a.textKey_="",a.fillKey_="",a.strokeKey_="",a.declutterImageWithText_=void 0,a}return r.prototype.finish=function(){var t=i.prototype.finish.call(this);return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t},r.prototype.drawText=function(t,e){var n=this.textFillState_,o=this.textStrokeState_,a=this.textState_;if(!(this.text_===""||!a||!n&&!o)){var s=this.coordinates,l=s.length,u=t.getType(),h=null,f=t.getStride();if(a.placement===Ws.LINE&&(u==P.LINE_STRING||u==P.MULTI_LINE_STRING||u==P.POLYGON||u==P.MULTI_POLYGON)){if(!Rt(this.getBufferedMaxExtent(),t.getExtent()))return;var c=void 0;if(h=t.getFlatCoordinates(),u==P.LINE_STRING)c=[h.length];else if(u==P.MULTI_LINE_STRING)c=t.getEnds();else if(u==P.POLYGON)c=t.getEnds().slice(0,1);else if(u==P.MULTI_POLYGON){var p=t.getEndss();c=[];for(var d=0,v=p.length;dI[2]}else b=E>R;var j=Math.PI,U=[],A=x+e===r;r=x,g=0,m=w,c=i[r],p=i[r+1];var k;if(A){_(),k=Math.atan2(p-v,c-d),b&&(k+=k>0?-j:j);var L=(R+E)/2,z=(M+T)/2;return U[0]=[L,z,(O-o)/2,k,n],U}for(var Z=0,V=n.length;Z0?-j:j),k!==void 0){var C=Q-k;if(C+=C>j?-2*j:C<-j?2*j:0,Math.abs(C)>a)return null}k=Q;for(var lt=Z,X=0;Z0&&i.push(` +`,""),i.push(r,""),i}var qc=function(){function i(r,t,e,n){this.overlaps=e,this.pixelRatio=t,this.resolution=r,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=Kt(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return i.prototype.createLabel=function(r,t,e,n){var o=r+t+e+n;if(this.labels_[o])return this.labels_[o];var a=n?this.strokeStates[n]:null,s=e?this.fillStates[e]:null,l=this.textStates[t],u=this.pixelRatio,h=[l.scale[0]*u,l.scale[1]*u],f=Array.isArray(r),c=La(f?r[0]:r,l.textAlign||Jr),p=n&&a.lineWidth?a.lineWidth:0,d=f?r:r.split(` +`).reduce($c,[]),v=$h(l,d),g=v.width,m=v.height,_=v.widths,y=v.heights,E=v.lineWidths,T=g+p,x=[],w=(T+2)*h[0],O=(m+p)*h[1],R={width:w<0?Math.floor(w):Math.ceil(w),height:O<0?Math.floor(O):Math.ceil(O),contextInstructions:x};if((h[0]!=1||h[1]!=1)&&x.push("scale",h),n){x.push("strokeStyle",a.strokeStyle),x.push("lineWidth",p),x.push("lineCap",a.lineCap),x.push("lineJoin",a.lineJoin),x.push("miterLimit",a.miterLimit);var M=ni?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;M.prototype.setLineDash&&(x.push("setLineDash",[a.lineDash]),x.push("lineDashOffset",a.lineDashOffset))}e&&x.push("fillStyle",s.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");for(var b=.5-c,I=c*T+b*p,j=[],U=[],A=0,k=0,L=0,z=0,Z,V=0,Q=d.length;Vr?r-u:o,E=a+h>t?t-h:a,T=d[3]+y*c[0]+d[1],x=d[0]+E*c[1]+d[2],w=m-d[3],O=_-d[0];(v||f!==0)&&(fe[0]=w,pe[0]=w,fe[1]=O,qt[1]=O,qt[0]=w+T,Jt[0]=qt[0],Jt[1]=O+x,pe[1]=Jt[1]);var R;return f!==0?(R=se(Kt(),e,n,1,1,f,-e,-n),st(R,fe),st(R,qt),st(R,Jt),st(R,pe),le(Math.min(fe[0],qt[0],Jt[0],pe[0]),Math.min(fe[1],qt[1],Jt[1],pe[1]),Math.max(fe[0],qt[0],Jt[0],pe[0]),Math.max(fe[1],qt[1],Jt[1],pe[1]),ur)):le(Math.min(w,w+T),Math.min(O,O+x),Math.max(w,w+T),Math.max(O,O+x),ur),p&&(m=Math.round(m),_=Math.round(_)),{drawImageX:m,drawImageY:_,drawImageW:y,drawImageH:E,originX:u,originY:h,declutterBox:{minX:ur[0],minY:ur[1],maxX:ur[2],maxY:ur[3],value:g},canvasTransform:R,scale:c}},i.prototype.replayImageOrLabel_=function(r,t,e,n,o,a,s){var l=!!(a||s),u=n.declutterBox,h=r.canvas,f=s?s[2]*n.scale[0]/2:0,c=u.minX-f<=h.width/t&&u.maxX+f>=0&&u.minY-f<=h.height/t&&u.maxY+f>=0;return c&&(l&&this.replayTextBackground_(r,fe,qt,Jt,pe,a,s),qh(r,n.canvasTransform,o,e,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},i.prototype.fill_=function(r){if(this.alignFill_){var t=st(this.renderedTransform_,[0,0]),e=512*this.pixelRatio;r.save(),r.translate(t[0]%e,t[1]%e),r.rotate(this.viewRotation_)}r.fill(),this.alignFill_&&r.restore()},i.prototype.setStrokeStyle_=function(r,t){r.strokeStyle=t[1],r.lineWidth=t[2],r.lineCap=t[3],r.lineJoin=t[4],r.miterLimit=t[5],r.setLineDash&&(r.lineDashOffset=t[7],r.setLineDash(t[6]))},i.prototype.drawLabelWithPointPlacement_=function(r,t,e,n){var o=this.textStates[t],a=this.createLabel(r,t,n,e),s=this.strokeStates[e],l=this.pixelRatio,u=La(Array.isArray(r)?r[0]:r,o.textAlign||Jr),h=$n[o.textBaseline||Kn],f=s&&s.lineWidth?s.lineWidth:0,c=a.width/l-2*o.scale[0],p=u*c+2*(.5-u)*f,d=h*a.height/l+2*(.5-h)*f;return{label:a,anchorX:p,anchorY:d}},i.prototype.execute_=function(r,t,e,n,o,a,s,l){var u;this.pixelCoordinates_&&qe(e,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=ze(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),yu(this.renderedTransform_,e));for(var h=0,f=n.length,c=0,p,d,v,g,m,_,y,E,T,x,w,O,R=0,M=0,b=null,I=null,j=this.coordinateCache_,U=this.viewRotation_,A=Math.round(Math.atan2(-e[1],e[0])*1e12)/1e12,k={context:r,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:U},L=this.instructions!=n||this.overlaps?0:200,z,Z,V,Q;hL&&(this.fill_(r),R=0),M>L&&(r.stroke(),M=0),!R&&!M&&(r.beginPath(),g=NaN,m=NaN),++h;break;case N.CIRCLE:c=C[1];var X=u[c],ct=u[c+1],Lt=u[c+2],It=u[c+3],xt=Lt-X,At=It-ct,rr=Math.sqrt(xt*xt+At*At);r.moveTo(X+rr,ct),r.arc(X,ct,rr,0,2*Math.PI,!0),++h;break;case N.CLOSE_PATH:r.closePath(),++h;break;case N.CUSTOM:c=C[1],p=C[2];var Wt=C[3],fn=C[4],pn=C.length==6?C[5]:void 0;k.geometry=Wt,k.feature=z,h in j||(j[h]=[]);var ue=j[h];pn?pn(u,c,p,2,ue):(ue[0]=u[c],ue[1]=u[c+1],ue.length=2),fn(ue,k),++h;break;case N.DRAW_IMAGE:c=C[1],p=C[2],E=C[3],d=C[4],v=C[5];var nr=C[6],dn=C[7],Rr=C[8],vn=C[9],Ie=C[10],Pr=C[11],gn=C[12],ir=C[13],he=C[14];if(!E&&C.length>=19){T=C[18],x=C[19],w=C[20],O=C[21];var or=this.drawLabelWithPointPlacement_(T,x,w,O);E=or.label,C[3]=E;var gi=C[22];d=(or.anchorX-gi)*this.pixelRatio,C[4]=d;var _n=C[23];v=(or.anchorY-_n)*this.pixelRatio,C[5]=v,nr=E.height,C[6]=nr,ir=E.width,C[13]=ir}var Lr=void 0;C.length>24&&(Lr=C[24]);var $t=void 0,Bt=void 0,Ae=void 0;C.length>16?($t=C[15],Bt=C[16],Ae=C[17]):($t=Ue,Bt=!1,Ae=!1),Ie&&A?Pr+=U:!Ie&&!A&&(Pr-=U);for(var Ir=0;c0){if(!a||p!==nt.IMAGE&&p!==nt.TEXT||a.indexOf(x)!==-1){var b=(c[R]-3)/4,I=n-b%s,j=n-(b/s|0),U=o(x,w,I*I+j*j);if(U)return U}h.clearRect(0,0,s,s);break}}var v=Object.keys(this.executorsByZIndex_).map(Number);v.sort(Ke);var g,m,_,y,E;for(g=v.length-1;g>=0;--g){var T=v[g].toString();for(_=this.executorsByZIndex_[T],m=Oi.length-1;m>=0;--m)if(p=Oi[m],y=_[p],y!==void 0&&(E=y.executeHitDetection(h,l,e,d,f),E))return E}},i.prototype.getClipCoords=function(r){var t=this.maxExtent_;if(!t)return null;var e=t[0],n=t[1],o=t[2],a=t[3],s=[e,n,e,a,o,a,o,n];return ze(s,0,8,2,r,s),s},i.prototype.isEmpty=function(){return Tr(this.executorsByZIndex_)},i.prototype.execute=function(r,t,e,n,o,a,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(Ke),this.maxExtent_&&(r.save(),this.clip(r,e));var u=a||Oi,h,f,c,p,d,v;for(s&&l.reverse(),h=0,f=l.length;ht)break;var s=e[a];s||(s=[],e[a]=s),s.push(((i+n)*r+(i+o))*4+3),n>0&&s.push(((i-n)*r+(i+o))*4+3),o>0&&(s.push(((i+n)*r+(i-o))*4+3),n>0&&s.push(((i-n)*r+(i-o))*4+3))}for(var l=[],n=0,u=e.length;nthis.maxCacheSize_},i.prototype.expire=function(){if(this.canExpireCache()){var r=0;for(var t in this.cache_){var e=this.cache_[t];(r++&3)===0&&!e.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}},i.prototype.get=function(r,t,e){var n=Aa(r,t,e);return n in this.cache_?this.cache_[n]:null},i.prototype.set=function(r,t,e,n){var o=Aa(r,t,e);this.cache_[o]=n,++this.cacheSize_},i.prototype.setSize=function(r){this.maxCacheSize_=r,this.expire()},i}();function Aa(i,r,t){var e=t?Ds(t):"null";return r+":"+i+":"+e}var qn=new of,af=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),sf=function(i){af(r,i);function r(t,e,n,o){var a=i.call(this)||this;return a.extent=t,a.pixelRatio_=n,a.resolution=e,a.state=o,a}return r.prototype.changed=function(){this.dispatchEvent(G.CHANGE)},r.prototype.getExtent=function(){return this.extent},r.prototype.getImage=function(){return F()},r.prototype.getPixelRatio=function(){return this.pixelRatio_},r.prototype.getResolution=function(){return this.resolution},r.prototype.getState=function(){return this.state},r.prototype.load=function(){F()},r}(xr),lf=sf,uf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();(function(i){uf(r,i);function r(t,e,n,o,a,s){var l=i.call(this,t,e,n,tt.IDLE)||this;return l.src_=o,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.state=tt.IDLE,l.imageLoadFunction_=s,l}return r.prototype.getImage=function(){return this.image_},r.prototype.handleImageError_=function(){this.state=tt.ERROR,this.unlistenImage_(),this.changed()},r.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Ut(this.extent)/this.image_.height),this.state=tt.LOADED,this.unlistenImage_(),this.changed()},r.prototype.load=function(){(this.state==tt.IDLE||this.state==tt.ERROR)&&(this.state=tt.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Eo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},r.prototype.setImage=function(t){this.image_=t,this.resolution=Ut(this.extent)/this.image_.height},r.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},r})(lf);function Eo(i,r,t){var e=i,n=!0,o=!1,a=!1,s=[kn(e,G.LOAD,function(){a=!0,o||r()})];return e.src&&gu?(o=!0,e.decode().then(function(){n&&r()}).catch(function(l){n&&(a?r():t())})):s.push(kn(e,G.ERROR,t)),function(){n=!1,s.forEach(J)}}var hf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),br=null,cf=function(i){hf(r,i);function r(t,e,n,o,a,s){var l=i.call(this)||this;return l.hitDetectionImage_=null,l.image_=t||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=s,l.unlisten_=null,l.imageState_=a,l.size_=n,l.src_=e,l.tainted_,l}return r.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===tt.LOADED){br||(br=kt(1,1)),br.drawImage(this.image_,0,0);try{br.getImageData(0,0,1,1),this.tainted_=!1}catch{br=null,this.tainted_=!0}}return this.tainted_===!0},r.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(G.CHANGE)},r.prototype.handleImageError_=function(){this.imageState_=tt.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},r.prototype.handleImageLoad_=function(){this.imageState_=tt.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},r.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},r.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},r.prototype.getImageState=function(){return this.imageState_},r.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],n=kt(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},r.prototype.getSize=function(){return this.size_},r.prototype.getSrc=function(){return this.src_},r.prototype.load=function(){if(this.imageState_==tt.IDLE){this.imageState_=tt.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=Eo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},r.prototype.replaceColor_=function(t){if(!(!this.color_||this.canvas_[t]||this.imageState_!==tt.LOADED)){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply",n.globalCompositeOperation==="multiply"||this.isTainted_())n.fillStyle=Ds(this.color_),n.fillRect(0,0,e.width/t,e.height/t),n.globalCompositeOperation="destination-in",n.drawImage(this.image_,0,0);else{for(var o=n.getImageData(0,0,e.width,e.height),a=o.data,s=this.color_[0]/255,l=this.color_[1]/255,u=this.color_[2]/255,h=this.color_[3],f=0,c=a.length;f0,6);var f=n.src!==void 0?tt.IDLE:tt.LOADED;return e.color_=n.color!==void 0?Wn(n.color):null,e.iconImage_=ff(u,h,e.imgSize_!==void 0?e.imgSize_:null,e.crossOrigin_,f,e.color_),e.offset_=n.offset!==void 0?n.offset:[0,0],e.offsetOrigin_=n.offsetOrigin!==void 0?n.offsetOrigin:Dt.TOP_LEFT,e.origin_=null,e.size_=n.size!==void 0?n.size:null,e}return r.prototype.clone=function(){var t=this.getScale();return new r({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc()})},r.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==ye.FRACTION||this.anchorYUnits_==ye.FRACTION){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==ye.FRACTION&&(t[0]*=e[0]),this.anchorYUnits_==ye.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=Dt.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_==Dt.TOP_RIGHT||this.anchorOrigin_==Dt.BOTTOM_RIGHT)&&(t[0]=-t[0]+e[0]),(this.anchorOrigin_==Dt.BOTTOM_LEFT||this.anchorOrigin_==Dt.BOTTOM_RIGHT)&&(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var n=this.getDisplacement();return[t[0]-n[0],t[1]+n[1]]},r.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},r.prototype.getColor=function(){return this.color_},r.prototype.getImage=function(t){return this.iconImage_.getImage(t)},r.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},r.prototype.getImageSize=function(){return this.iconImage_.getSize()},r.prototype.getImageState=function(){return this.iconImage_.getImageState()},r.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},r.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Dt.TOP_LEFT){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_==Dt.TOP_RIGHT||this.offsetOrigin_==Dt.BOTTOM_RIGHT)&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_==Dt.BOTTOM_LEFT||this.offsetOrigin_==Dt.BOTTOM_RIGHT)&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_},r.prototype.getSrc=function(){return this.iconImage_.getSrc()},r.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},r.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(G.CHANGE,t)},r.prototype.load=function(){this.iconImage_.load()},r.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(G.CHANGE,t)},r}(Ns),Gn=df,Zt=.5;function vf(i,r,t,e,n,o,a){var s=i[0]*Zt,l=i[1]*Zt,u=kt(s,l);u.imageSmoothingEnabled=!1;for(var h=u.canvas,f=new nf(u,Zt,n,null,a),c=t.length,p=Math.floor((256*256*256-1)/c),d={},v=1;v<=c;++v){var g=t[v-1],m=g.getStyleFunction()||e;if(!!e){var _=m(g,o);if(!!_){Array.isArray(_)||(_=[_]);for(var y=v*p,E="#"+("000000"+y.toString(16)).slice(-6),T=0,x=_.length;Tv[2];)++_,y=m*_,f.push(this.getRenderTransform(o,a,s,Zt,c,p,y).slice()),g-=m}this.hitDetectionImageData_=vf(n,f,this.renderedFeatures_,h.getStyleFunction(),u,a,s)}e(gf(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},r.prototype.forEachFeatureAtCoordinate=function(t,e,n,o,a){var s=this;if(!!this.replayGroup_){var l=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),f={},c=function(v,g,m){var _=H(v),y=f[_];if(y){if(y!==!0&&mT[0]&&O[2]>T[2]&&E.push([O[0]-x,O[1],O[2]-x,O[3]])}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==d&&this.renderedRenderOrder_==g&&je(this.wrappedRenderedExtent_,_))return qe(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var R=new Ra($i(c,p),_,c,p),M;this.getLayer().getDeclutter()&&(M=new Ra($i(c,p),_,c,p));for(var b,I,j,I=0,j=E.length;I=200&&s.status<300){var u=r.getType(),h=void 0;u==be.JSON||u==be.TEXT?h=s.responseText:u==be.XML?(h=s.responseXML,h||(h=new DOMParser().parseFromString(s.responseText,"application/xml"))):u==be.ARRAY_BUFFER&&(h=s.response),h?o(r.readFeatures(h,{extent:t,featureProjection:n}),r.readProjection(h)):a()}else a()},s.onerror=a,s.send()}function Da(i,r){return function(t,e,n,o,a){var s=this;jf(i,r,t,e,n,function(l,u){s.addFeatures(l),o!==void 0&&o(l)},a||Ve)}}var Qs=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),de=function(i){Qs(r,i);function r(t,e,n){var o=i.call(this,t)||this;return o.feature=e,o.features=n,o}return r}(Ht),Xf=function(i){Qs(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:$e.READY,wrapX:n.wrapX!==void 0?n.wrapX:!0})||this,e.on,e.once,e.un,e.loader_=Ve,e.format_=n.format,e.overlaps_=n.overlaps===void 0?!0:n.overlaps,e.url_=n.url,n.loader!==void 0?e.loader_=n.loader:e.url_!==void 0&&(B(e.format_,7),e.loader_=Da(e.url_,e.format_)),e.strategy_=n.strategy!==void 0?n.strategy:kf;var o=n.useSpatialIndex!==void 0?n.useSpatialIndex:!0;e.featuresRtree_=o?new Fa:null,e.loadedExtentsRtree_=new Fa,e.loadingExtentsCount_=0,e.nullGeometryFeatures_={},e.idIndex_={},e.uidIndex_={},e.featureChangeKeys_={},e.featuresCollection_=null;var a,s;return Array.isArray(n.features)?s=n.features:n.features&&(a=n.features,s=a.getArray()),!o&&a===void 0&&(a=new Gt(s)),s!==void 0&&e.addFeaturesInternal(s),a!==void 0&&e.bindFeaturesCollection_(a),e}return r.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},r.prototype.addFeatureInternal=function(t){var e=H(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var o=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new de(jt.ADDFEATURE,t))},r.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[W(e,G.CHANGE,this.handleFeatureChange_,this),W(e,Er.PROPERTYCHANGE,this.handleFeatureChange_,this)]},r.prototype.addToIndex_=function(t,e){var n=!0,o=e.getId();return o!==void 0&&(o.toString()in this.idIndex_?n=!1:this.idIndex_[o.toString()]=e),n&&(B(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},r.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},r.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],o=[],a=0,s=t.length;a0},r.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),i.prototype.refresh.call(this)},r.prototype.removeLoadedExtent=function(t){var e=this.loadedExtentsRtree_,n;e.forEachInExtent(t,function(o){if(zr(o.extent,t))return n=o,!0}),n&&e.remove(n)},r.prototype.removeFeature=function(t){if(!!t){var e=H(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);var n=this.removeFeatureInternal(t);n&&this.changed()}},r.prototype.removeFeatureInternal=function(t){var e=H(t),n=this.featureChangeKeys_[e];if(!!n){n.forEach(J),delete this.featureChangeKeys_[e];var o=t.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[e],this.dispatchEvent(new de(jt.REMOVEFEATURE,t)),t}},r.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},r.prototype.setLoader=function(t){this.loader_=t},r.prototype.setUrl=function(t){B(this.format_,7),this.url_=t,this.setLoader(Da(t,this.format_))},r}(Js),dr=Xf;function Ln(i,r){return st(i.inversePixelTransform,r.slice(0))}var D={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function tl(i){return Math.pow(i,3)}function er(i){return 1-tl(1-i)}function Yf(i){return 3*i*i-2*i*i*i}function Uf(i){return i}var Wf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Bf=function(i){Wf(r,i);function r(t,e,n){var o=i.call(this)||this,a=n||{};return o.tileCoord=t,o.state=e,o.interimTile=null,o.key="",o.transition_=a.transition===void 0?250:a.transition,o.transitionStarts_={},o.interpolate=!!a.interpolate,o}return r.prototype.changed=function(){this.dispatchEvent(G.CHANGE)},r.prototype.release=function(){},r.prototype.getKey=function(){return this.key+"/"+this.tileCoord},r.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==D.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},r.prototype.refreshInterimChain=function(){if(!!this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==D.LOADED){t.interimTile=null;break}else t.getState()==D.LOADING?e=t:t.getState()==D.IDLE?e.interimTile=t.interimTile:e=t;t=e.interimTile}while(t)}},r.prototype.getTileCoord=function(){return this.tileCoord},r.prototype.getState=function(){return this.state},r.prototype.setState=function(t){if(this.state!==D.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},r.prototype.load=function(){F()},r.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;var o=e-n+1e3/60;return o>=this.transition_?1:tl(o/this.transition_)},r.prototype.inTransition=function(t){return this.transition_?this.transitionStarts_[t]!==-1:!1},r.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},r}(xr),el=Bf,Zf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),zf=function(i){Zf(r,i);function r(t,e,n,o,a,s){var l=i.call(this,t,e,s)||this;return l.crossOrigin_=o,l.src_=n,l.key=n,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=a,l}return r.prototype.getImage=function(){return this.image_},r.prototype.setImage=function(t){this.image_=t,this.state=D.LOADED,this.unlistenImage_(),this.changed()},r.prototype.handleImageError_=function(){this.state=D.ERROR,this.unlistenImage_(),this.image_=Kf(),this.changed()},r.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=D.LOADED:this.state=D.EMPTY,this.unlistenImage_(),this.changed()},r.prototype.load=function(){this.state==D.ERROR&&(this.state=D.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==D.IDLE&&(this.state=D.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Eo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},r.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},r}(el);function Kf(){var i=kt(1,1);return i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1),i.canvas}var rl=zf,Vf=function(){function i(r,t,e){this.decay_=r,this.minVelocity_=t,this.delay_=e,this.points_=[],this.angle_=0,this.initialVelocity_=0}return i.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},i.prototype.update=function(r,t){this.points_.push(r,t,Date.now())},i.prototype.end=function(){if(this.points_.length<6)return!1;var r=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]0&&this.points_[e+2]>r;)e-=3;var n=this.points_[t+2]-this.points_[e+2];if(n<1e3/60)return!1;var o=this.points_[t]-this.points_[e],a=this.points_[t+1]-this.points_[e+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/n,this.initialVelocity_>this.minVelocity_},i.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},i.prototype.getAngle=function(){return this.angle_},i}(),Hf=Vf,$f=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),qf=function(i){$f(r,i);function r(t){var e=i.call(this)||this;return e.map_=t,e}return r.prototype.dispatchRenderEvent=function(t,e){F()},r.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;se(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),no(o,n)},r.prototype.forEachFeatureAtCoordinate=function(t,e,n,o,a,s,l,u){var h,f=e.viewState;function c(A,k,L,z){return a.call(s,k,A?L:null,z)}var p=f.projection,d=gs(t.slice(),p),v=[[0,0]];if(p.canWrapX()&&o){var g=p.getExtent(),m=it(g);v.push([-m,0],[m,0])}for(var _=e.layerStatesArray,y=_.length,E=[],T=[],x=0;x=0;--w){var O=_[w],R=O.layer;if(R.hasRenderer()&&Hn(O,f)&&l.call(u,R)){var M=R.getRenderer(),b=R.getSource();if(M&&b){var I=b.getWrapX()?d:t,j=c.bind(null,O.managed);T[0]=I[0]+v[x][0],T[1]=I[1]+v[x][1],h=M.forEachFeatureAtCoordinate(T,e,n,j,E)}if(h)return h}}if(E.length!==0){var U=1/E.length;return E.forEach(function(A,k){return A.distanceSq+=k*U}),E.sort(function(A,k){return A.distanceSq-k.distanceSq}),E.some(function(A){return h=A.callback(A.feature,A.layer,A.geometry)}),h}},r.prototype.forEachLayerAtPixel=function(t,e,n,o,a){return F()},r.prototype.hasFeatureAtCoordinate=function(t,e,n,o,a,s){var l=this.forEachFeatureAtCoordinate(t,e,n,o,_r,this,a,s);return l!==void 0},r.prototype.getMap=function(){return this.map_},r.prototype.renderFrame=function(t){F()},r.prototype.scheduleExpireIconCache=function(t){qn.canExpireCache()&&t.postRenderFunctions.push(Jf)},r}(eo);function Jf(i,r){qn.expire()}var Qf=qf,tp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ep=function(i){tp(r,i);function r(t){var e=i.call(this,t)||this;e.fontChangeListenerKey_=W(ee,Er.PROPERTYCHANGE,t.redrawText.bind(t)),e.element_=document.createElement("div");var n=e.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",e.element_.className=He+" ol-layers";var o=t.getViewport();return o.insertBefore(e.element_,o.firstChild||null),e.children_=[],e.renderedVisible_=!0,e}return r.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var o=new Vs(t,void 0,e);n.dispatchEvent(o)}},r.prototype.disposeInternal=function(){J(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),i.prototype.disposeInternal.call(this)},r.prototype.renderFrame=function(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(we.PRECOMPOSE,t);var e=t.layerStatesArray.sort(function(p,d){return p.zIndex-d.zIndex}),n=t.viewState;this.children_.length=0;for(var o=[],a=null,s=0,l=e.length;s=0;--s)o[s].renderDeclutter(t);Bh(this.element_,this.children_),this.dispatchRenderEvent(we.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)},r.prototype.forEachLayerAtPixel=function(t,e,n,o,a){for(var s=e.viewState,l=e.layerStatesArray,u=l.length,h=u-1;h>=0;--h){var f=l[h],c=f.layer;if(c.hasRenderer()&&Hn(f,s)&&a(c)){var p=c.getRenderer(),d=p.getDataAtPixel(t,e,n);if(d){var v=o(c,d);if(v)return v}}}},r}(Qf),rp=ep,nl=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),me=function(i){nl(r,i);function r(t,e){var n=i.call(this,t)||this;return n.layer=e,n}return r}(Ht),Si={LAYERS:"layers"},np=function(i){nl(r,i);function r(t){var e=this,n=t||{},o=ut({},n);delete o.layers;var a=n.layers;return e=i.call(this,o)||this,e.on,e.once,e.un,e.layersListenerKeys_=[],e.listenerKeys_={},e.addChangeListener(Si.LAYERS,e.handleLayersChanged_),a?Array.isArray(a)?a=new Gt(a.slice(),{unique:!0}):B(typeof a.getArray=="function",43):a=new Gt(void 0,{unique:!0}),e.setLayers(a),e}return r.prototype.handleLayerChange_=function(){this.changed()},r.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(J),this.layersListenerKeys_.length=0;var t=this.getLayers();this.layersListenerKeys_.push(W(t,St.ADD,this.handleLayersAdd_,this),W(t,St.REMOVE,this.handleLayersRemove_,this));for(var e in this.listenerKeys_)this.listenerKeys_[e].forEach(J);tn(this.listenerKeys_);for(var n=t.getArray(),o=0,a=n.length;othis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},r.prototype.disposeInternal=function(){this.relayedListenerKey_&&(J(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(G.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(J(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(J),this.dragListenerKeys_.length=0,this.element_=null,i.prototype.disposeInternal.call(this)},r}(xr),hp=up,re={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},dt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},Jn=1/0,cp=function(){function i(r,t){this.priorityFunction_=r,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return i.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,tn(this.queuedElements_)},i.prototype.dequeue=function(){var r=this.elements_,t=this.priorities_,e=r[0];r.length==1?(r.length=0,t.length=0):(r[0]=r.pop(),t[0]=t.pop(),this.siftUp_(0));var n=this.keyFunction_(e);return delete this.queuedElements_[n],e},i.prototype.enqueue=function(r){B(!(this.keyFunction_(r)in this.queuedElements_),31);var t=this.priorityFunction_(r);return t!=Jn?(this.elements_.push(r),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(r)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},i.prototype.getCount=function(){return this.elements_.length},i.prototype.getLeftChildIndex_=function(r){return r*2+1},i.prototype.getRightChildIndex_=function(r){return r*2+2},i.prototype.getParentIndex_=function(r){return r-1>>1},i.prototype.heapify_=function(){var r;for(r=(this.elements_.length>>1)-1;r>=0;r--)this.siftUp_(r)},i.prototype.isEmpty=function(){return this.elements_.length===0},i.prototype.isKeyQueued=function(r){return r in this.queuedElements_},i.prototype.isQueued=function(r){return this.isKeyQueued(this.keyFunction_(r))},i.prototype.siftUp_=function(r){for(var t=this.elements_,e=this.priorities_,n=t.length,o=t[r],a=e[r],s=r;r>1;){var l=this.getLeftChildIndex_(r),u=this.getRightChildIndex_(r),h=ur;){var s=this.getParentIndex_(t);if(n[s]>a)e[t]=e[s],n[t]=n[s],t=s;else break}e[t]=o,n[t]=a},i.prototype.reprioritize=function(){var r=this.priorityFunction_,t=this.elements_,e=this.priorities_,n=0,o=t.length,a,s,l;for(s=0;s0;)a=this.dequeue()[0],s=a.getKey(),o=a.getState(),o===D.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++n,a.load())},r}(fp),vp=dp;function gp(i,r,t,e,n){if(!i||!(t in i.wantedTiles)||!i.wantedTiles[t][r.getKey()])return Jn;var o=i.viewState.center,a=e[0]-o[0],s=e[1]-o[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}var Xt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},_p=42,To=256;function Ga(i,r,t){return function(e,n,o,a,s){if(!!e){if(!n&&!r)return e;var l=r?0:o[0]*n,u=r?0:o[1]*n,h=s?s[0]:0,f=s?s[1]:0,c=i[0]+l/2+h,p=i[2]-l/2+h,d=i[1]+u/2+f,v=i[3]-u/2+f;c>p&&(c=(p+c)/2,p=c),d>v&&(d=(v+d)/2,v=d);var g=ot(e[0],c,p),m=ot(e[1],d,v);if(a&&t&&n){var _=30*n;g+=-_*Math.log(1+Math.max(0,c-e[0])/_)+_*Math.log(1+Math.max(0,e[0]-p)/_),m+=-_*Math.log(1+Math.max(0,d-e[1])/_)+_*Math.log(1+Math.max(0,e[1]-v)/_)}return[g,m]}}}function yp(i){return i}function Co(i,r,t,e){var n=it(r)/t[0],o=Ut(r)/t[1];return e?Math.min(i,Math.max(n,o)):Math.min(i,Math.min(n,o))}function xo(i,r,t){var e=Math.min(i,r),n=50;return e*=Math.log(1+n*Math.max(0,i/r-1))/n+1,t&&(e=Math.max(e,t),e/=Math.log(1+n*Math.max(0,t/i-1))/n+1),ot(e,t/2,r*2)}function mp(i,r,t,e){return function(n,o,a,s){if(n!==void 0){var l=i[0],u=i[i.length-1],h=t?Co(l,t,a,e):l;if(s){var f=r!==void 0?r:!0;return f?xo(n,h,u):ot(n,u,h)}var c=Math.min(h,n),p=Math.floor(ro(i,c,o));return i[p]>h&&p1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);for(var o=0;o0},r.prototype.getInteracting=function(){return this.hints_[Ct.INTERACTING]>0},r.prototype.cancelAnimations=function(){this.setHint(Ct.ANIMATING,-this.hints_[Ct.ANIMATING]);for(var t,e=0,n=this.animations_.length;e=0;--n){for(var o=this.animations_[n],a=!0,s=0,l=o.length;s0?h/u.duration:1;f>=1?(u.complete=!0,f=1):a=!1;var c=u.easing(f);if(u.sourceCenter){var p=u.sourceCenter[0],d=u.sourceCenter[1],v=u.targetCenter[0],g=u.targetCenter[1];this.nextCenter_=u.targetCenter;var m=p+c*(v-p),_=d+c*(g-d);this.targetCenter_=[m,_]}if(u.sourceResolution&&u.targetResolution){var y=c===1?u.targetResolution:u.sourceResolution+c*(u.targetResolution-u.sourceResolution);if(u.anchor){var E=this.getViewportSize_(this.getRotation()),T=this.constraints_.resolution(y,0,E,!0);this.targetCenter_=this.calculateCenterZoom(T,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=y,this.applyTargetState_(!0)}if(u.sourceRotation!==void 0&&u.targetRotation!==void 0){var x=c===1?yr(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+c*(u.targetRotation-u.sourceRotation);if(u.anchor){var w=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(w,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!u.complete)break}}if(a){this.animations_[n]=null,this.setHint(Ct.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var O=o[0].callback;O&&In(O,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},r.prototype.calculateCenterRotate=function(t,e){var n,o=this.getCenterInternal();return o!==void 0&&(n=[o[0]-e[0],o[1]-e[1]],so(n,t-this.getRotation()),ds(n,e)),n},r.prototype.calculateCenterZoom=function(t,e){var n,o=this.getCenterInternal(),a=this.getResolution();if(o!==void 0&&a!==void 0){var s=e[0]-t*(e[0]-o[0])/a,l=e[1]-t*(e[1]-o[1])/a;n=[s,l]}return n},r.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],o=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(o*Math.cos(t))]}else return e},r.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},r.prototype.getCenter=function(){var t=this.getCenterInternal();return t&&Bi(t,this.getProjection())},r.prototype.getCenterInternal=function(){return this.get(Xt.CENTER)},r.prototype.getConstraints=function(){return this.constraints_},r.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},r.prototype.getHints=function(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},r.prototype.calculateExtent=function(t){var e=this.calculateExtentInternal(t);return Es(e,this.getProjection())},r.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();B(n,1);var o=this.getResolution();B(o!==void 0,2);var a=this.getRotation();return B(a!==void 0,3),Yi(n,o,a,e)},r.prototype.getMaxResolution=function(){return this.maxResolution_},r.prototype.getMinResolution=function(){return this.minResolution_},r.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},r.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},r.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},r.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},r.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},r.prototype.getProjection=function(){return this.projection_},r.prototype.getResolution=function(){return this.get(Xt.RESOLUTION)},r.prototype.getResolutions=function(){return this.resolutions_},r.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Xe(t,this.getProjection()),e)},r.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),o=it(t)/n[0],a=Ut(t)/n[1];return Math.max(o,a)},r.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(n/o)/Math.log(e);return function(s){var l=n/Math.pow(e,s*a);return l}},r.prototype.getRotation=function(){return this.get(Xt.ROTATION)},r.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(n/o)/e;return function(s){var l=Math.log(n/s)/e/a;return l}},r.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},r.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),o=this.getCenterInternal(),a=this.padding_;if(a){var s=this.getViewportSizeMinusPadding_();o=Pi(o,this.getViewportSize_(),[s[0]/2+a[3],s[1]/2+a[0]],e,n)}return{center:o.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}},r.prototype.getZoom=function(){var t,e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t},r.prototype.getZoomForResolution=function(t){var e=this.minZoom_||0,n,o;if(this.resolutions_){var a=ro(this.resolutions_,t,1);e=a,n=this.resolutions_[a],a==this.resolutions_.length-1?o=2:o=n/this.resolutions_[a+1]}else n=this.maxResolution_,o=this.zoomFactor_;return e+Math.log(n/t)/Math.log(o)},r.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=ot(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,ot(t-e,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},r.prototype.fit=function(t,e){var n;if(B(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function",24),Array.isArray(t)){B(!ao(t),25);var o=Xe(t,this.getProjection());n=va(o)}else if(t.getType()===P.CIRCLE){var o=Xe(t.getExtent(),this.getProjection());n=va(o),n.rotate(this.getRotation(),Re(o))}else{var a=Hu();a?n=t.clone().transform(a,this.getProjection()):n=t}this.fitInternal(n,e)},r.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),o=Math.sin(-e),a=t.getFlatCoordinates(),s=t.getStride(),l=1/0,u=1/0,h=-1/0,f=-1/0,c=0,p=a.length;c=0;u--){var h=l[u];if(!(h.getMap()!==this||!h.getActive()||!this.getTargetElement())){var f=h.handleEvent(t);if(!f||t.propagationStopped)break}}}},r.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,o=n;if(t){var a=t.viewHints;if(a[Ct.ANIMATING]||a[Ct.INTERACTING]){var s=Date.now()-t.time>8;n=s?0:8,o=s?0:2}}e.getTilesLoading()0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!qe(e,this.renderedAttributions_)){ks(this.ulElement_);for(var o=0,a=e.length;o0&&n%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:er}):e.setRotation(0))}},r.prototype.render=function(t){var e=t.frameState;if(!!e){var n=e.viewState.rotation;if(n!=this.rotation_){var o="rotate("+n+"rad)";if(this.autoHide_){var a=this.element.classList.contains(wn);!a&&n===0?this.element.classList.add(wn):a&&n!==0&&this.element.classList.remove(wn)}this.label_.style.transform=o}this.rotation_=n}},r}(ln),Xp=jp,Yp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Up=function(i){Yp(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{element:document.createElement("div"),target:n.target})||this;var o=n.className!==void 0?n.className:"ol-zoom",a=n.delta!==void 0?n.delta:1,s=n.zoomInClassName!==void 0?n.zoomInClassName:o+"-in",l=n.zoomOutClassName!==void 0?n.zoomOutClassName:o+"-out",u=n.zoomInLabel!==void 0?n.zoomInLabel:"+",h=n.zoomOutLabel!==void 0?n.zoomOutLabel:"\u2013",f=n.zoomInTipLabel!==void 0?n.zoomInTipLabel:"Zoom in",c=n.zoomOutTipLabel!==void 0?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=f,p.appendChild(typeof u=="string"?document.createTextNode(u):u),p.addEventListener(G.CLICK,e.handleClick_.bind(e,a),!1);var d=document.createElement("button");d.className=l,d.setAttribute("type","button"),d.title=c,d.appendChild(typeof h=="string"?document.createTextNode(h):h),d.addEventListener(G.CLICK,e.handleClick_.bind(e,-a),!1);var v=o+" "+He+" "+on,g=e.element;return g.className=v,g.appendChild(p),g.appendChild(d),e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},r.prototype.zoomByDelta_=function(t){var e=this.getMap(),n=e.getView();if(!!n){var o=n.getZoom();if(o!==void 0){var a=n.getConstrainedZoom(o+t);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:a,duration:this.duration_,easing:er})):n.setZoom(a)}}},r}(ln),Wp=Up,Bp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ja=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],Xa={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"},Zp=function(i){Bp(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{element:document.createElement("div"),target:n.target})||this,e.on,e.once,e.un,e.keys_=n.keys!==void 0?n.keys:!1,e.source_=n.source,e.isInFullscreen_=!1,e.boundHandleMapTargetChange_=e.handleMapTargetChange_.bind(e),e.cssClassName_=n.className!==void 0?n.className:"ol-full-screen",e.documentListeners_=[],e.activeClassName_=n.activeClassName!==void 0?n.activeClassName.split(" "):[e.cssClassName_+"-true"],e.inactiveClassName_=n.inactiveClassName!==void 0?n.inactiveClassName.split(" "):[e.cssClassName_+"-false"];var o=n.label!==void 0?n.label:"\u2922";e.labelNode_=typeof o=="string"?document.createTextNode(o):o;var a=n.labelActive!==void 0?n.labelActive:"\xD7";e.labelActiveNode_=typeof a=="string"?document.createTextNode(a):a;var s=n.tipLabel?n.tipLabel:"Toggle full-screen";return e.button_=document.createElement("button"),e.button_.title=s,e.button_.setAttribute("type","button"),e.button_.appendChild(e.labelNode_),e.button_.addEventListener(G.CLICK,e.handleClick_.bind(e),!1),e.setClassName_(e.button_,e.isInFullscreen_),e.element.className="".concat(e.cssClassName_," ").concat(He," ").concat(on),e.element.appendChild(e.button_),e}return r.prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},r.prototype.handleFullScreen_=function(){var t=this.getMap();if(!!t){var e=t.getOwnerDocument();if(!!Ya(e))if(Ua(e))Kp(e);else{var n=void 0;this.source_?n=typeof this.source_=="string"?e.getElementById(this.source_):this.source_:n=t.getTargetElement(),this.keys_?zp(n):al(n)}}},r.prototype.handleFullScreenChange_=function(){var t=this.getMap();if(!!t){var e=this.isInFullscreen_;this.isInFullscreen_=Ua(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Bn(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(Xa.ENTERFULLSCREEN)):(Bn(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(Xa.LEAVEFULLSCREEN)),t.updateSize())}},r.prototype.setClassName_=function(t,e){var n,o,a,s;e?((n=t.classList).remove.apply(n,this.inactiveClassName_),(o=t.classList).add.apply(o,this.activeClassName_)):((a=t.classList).remove.apply(a,this.activeClassName_),(s=t.classList).add.apply(s,this.inactiveClassName_))},r.prototype.setMap=function(t){var e=this.getMap();e&&e.removeChangeListener(dt.TARGET,this.boundHandleMapTargetChange_),i.prototype.setMap.call(this,t),this.handleMapTargetChange_(),t&&t.addChangeListener(dt.TARGET,this.boundHandleMapTargetChange_)},r.prototype.handleMapTargetChange_=function(){for(var t=this.documentListeners_,e=0,n=t.length;en?(this.direction_=jr.HORIZONTAL,this.widthLimit_=e-l):(this.direction_=jr.VERTICAL,this.heightLimit_=n-u),this.sliderInitialized_=!0},r.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),n=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),o=this.getResolutionForPosition_(n),a=e.getConstrainedZoom(e.getZoomForResolution(o));e.animateInternal({zoom:a,duration:this.duration_,easing:er})},r.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,this.dragListenerKeys_.length===0){var n=this.handleDraggerDrag_,o=this.handleDraggerEnd_,a=this.getMap().getOwnerDocument();this.dragListenerKeys_.push(W(a,Ee.POINTERMOVE,n,this),W(a,Ee.POINTERUP,o,this))}}},r.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,n=t.clientY-this.startY_,o=this.getRelativePosition_(e,n);this.currentResolution_=this.getResolutionForPosition_(o),this.getMap().getView().setResolution(this.currentResolution_)}},r.prototype.handleDraggerEnd_=function(t){if(this.dragging_){var e=this.getMap().getView();e.endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(J),this.dragListenerKeys_.length=0}},r.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),n=this.element.firstElementChild;this.direction_==jr.HORIZONTAL?n.style.left=this.widthLimit_*e+"px":n.style.top=this.heightLimit_*e+"px"},r.prototype.getRelativePosition_=function(t,e){var n;return this.direction_===jr.HORIZONTAL?n=t/this.widthLimit_:n=e/this.heightLimit_,ot(n,0,1)},r.prototype.getResolutionForPosition_=function(t){var e=this.getMap().getView().getResolutionForValueFunction();return e(1-t)},r.prototype.getPositionForResolution_=function(t){var e=this.getMap().getView().getValueForResolutionFunction();return ot(1-e(t),0,1)},r.prototype.render=function(t){if(!!t.frameState&&!(!this.sliderInitialized_&&!this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},r}(ln),td=Qp;function sl(i){var r=i||{},t=new Gt,e=r.zoom!==void 0?r.zoom:!0;e&&t.push(new Wp(r.zoomOptions));var n=r.rotate!==void 0?r.rotate:!0;n&&t.push(new Xp(r.rotateOptions));var o=r.attribution!==void 0?r.attribution:!0;return o&&t.push(new kp(r.attributionOptions)),t}var Wa={ACTIVE:"active"},ed=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rd=function(i){ed(r,i);function r(t){var e=i.call(this)||this;return e.on,e.once,e.un,t&&t.handleEvent&&(e.handleEvent=t.handleEvent),e.map_=null,e.setActive(!0),e}return r.prototype.getActive=function(){return this.get(Wa.ACTIVE)},r.prototype.getMap=function(){return this.map_},r.prototype.handleEvent=function(t){return!0},r.prototype.setActive=function(t){this.set(Wa.ACTIVE,t)},r.prototype.setMap=function(t){this.map_=t},r}(bt);function nd(i,r,t){var e=i.getCenterInternal();if(e){var n=[e[0]+r[0],e[1]+r[1]];i.animateInternal({duration:t!==void 0?t:250,easing:Uf,center:i.getConstrainedCenter(n)})}}function wo(i,r,t,e){var n=i.getZoom();if(n!==void 0){var o=i.getConstrainedZoom(n+r),a=i.getResolutionForZoom(o);i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:a,anchor:t,duration:e!==void 0?e:250,easing:er})}}var un=rd,id=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),od=function(i){id(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.delta_=n.delta?n.delta:1,e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleEvent=function(t){var e=!1;if(t.type==et.DBLCLICK){var n=t.originalEvent,o=t.map,a=t.coordinate,s=n.shiftKey?-this.delta_:this.delta_,l=o.getView();wo(l,s,a,this.duration_),n.preventDefault(),e=!0}return!e},r}(un),ad=od,sd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ld=function(i){sd(r,i);function r(t){var e=this,n=t||{};return e=i.call(this,n)||this,n.handleDownEvent&&(e.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(e.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(e.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(e.handleUpEvent=n.handleUpEvent),n.stopDown&&(e.stopDown=n.stopDown),e.handlingDownUpSequence=!1,e.trackedPointers_={},e.targetPointers=[],e}return r.prototype.getPointerCount=function(){return this.targetPointers.length},r.prototype.handleDownEvent=function(t){return!1},r.prototype.handleDragEvent=function(t){},r.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==et.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==et.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==et.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==et.POINTERMOVE&&this.handleMoveEvent(t);return!e},r.prototype.handleMoveEvent=function(t){},r.prototype.handleUpEvent=function(t){return!1},r.prototype.stopDown=function(t){return t},r.prototype.updateTrackedPointers_=function(t){if(ud(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==et.POINTERUP?delete this.trackedPointers_[n]:t.type==et.POINTERDOWN?this.trackedPointers_[n]=e:n in this.trackedPointers_&&(this.trackedPointers_[n]=e),this.targetPointers=Qa(this.trackedPointers_)}},r}(un);function So(i){for(var r=i.length,t=0,e=0,n=0;n0&&this.condition_(t)){var e=t.map,n=e.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},r}(hn),fl=gd,_d=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),yd=function(i){_d(r,i);function r(t){var e=this,n=t||{};return e=i.call(this,{stopDown:ei})||this,e.condition_=n.condition?n.condition:hd,e.lastAngle_=void 0,e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleDragEvent=function(t){if(!!Li(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==Oo){var o=e.getSize(),a=t.pixel,s=Math.atan2(o[1]/2-a[1],a[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=s-this.lastAngle_;n.adjustRotationInternal(-l)}this.lastAngle_=s}}},r.prototype.handleUpEvent=function(t){if(!Li(t))return!0;var e=t.map,n=e.getView();return n.endInteraction(this.duration_),!1},r.prototype.handleDownEvent=function(t){if(!Li(t))return!1;if(ul(t)&&this.condition_(t)){var e=t.map;return e.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},r}(hn),md=yd,Ed=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Td=function(i){Ed(r,i);function r(t){var e=i.call(this)||this;return e.geometry_=null,e.element_=document.createElement("div"),e.element_.style.position="absolute",e.element_.style.pointerEvents="auto",e.element_.className="ol-box "+t,e.map_=null,e.startPixel_=null,e.endPixel_=null,e}return r.prototype.disposeInternal=function(){this.setMap(null)},r.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+n,o.top=Math.min(t[1],e[1])+n,o.width=Math.abs(e[0]-t[0])+n,o.height=Math.abs(e[1]-t[1])+n},r.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},r.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},r.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]],o=n.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new Yn([o])},r.prototype.getGeometry=function(){return this.geometry_},r}(eo),Cd=Td,pl=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),An={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},Ii=function(i){pl(r,i);function r(t,e,n){var o=i.call(this,t)||this;return o.coordinate=e,o.mapBrowserEvent=n,o}return r}(Ht),xd=function(i){pl(r,i);function r(t){var e=i.call(this)||this;e.on,e.once,e.un;var n=t||{};return e.box_=new Cd(n.className||"ol-dragbox"),e.minArea_=n.minArea!==void 0?n.minArea:64,n.onBoxEnd&&(e.onBoxEnd=n.onBoxEnd),e.startPixel_=null,e.condition_=n.condition?n.condition:ul,e.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:e.defaultBoxEndCondition,e}return r.prototype.defaultBoxEndCondition=function(t,e,n){var o=n[0]-e[0],a=n[1]-e[1];return o*o+a*a>=this.minArea_},r.prototype.getGeometry=function(){return this.box_.getGeometry()},r.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Ii(An.BOXDRAG,t.coordinate,t))},r.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Ii(e?An.BOXEND:An.BOXCANCEL,t.coordinate,t)),!1},r.prototype.handleDownEvent=function(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Ii(An.BOXSTART,t.coordinate,t)),!0):!1},r.prototype.onBoxEnd=function(t){},r}(hn),Od=xd,wd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Sd=function(i){wd(r,i);function r(t){var e=this,n=t||{},o=n.condition?n.condition:pd;return e=i.call(this,{condition:o,className:n.className||"ol-dragzoom",minArea:n.minArea})||this,e.duration_=n.duration!==void 0?n.duration:200,e.out_=n.out!==void 0?n.out:!1,e}return r.prototype.onBoxEnd=function(t){var e=this.getMap(),n=e.getView(),o=this.getGeometry();if(this.out_){var a=n.rotatedExtentForGeometry(o),s=n.getResolutionForExtentInternal(a),l=n.getResolution()/s;o=o.clone(),o.scale(l*l)}n.fitInternal(o,{duration:this.duration_,easing:er})},r}(Od),Rd=Sd,Ne={LEFT:37,UP:38,RIGHT:39,DOWN:40},Pd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ld=function(i){Pd(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.defaultCondition_=function(o){return hl(o)&&cl(o)},e.condition_=n.condition!==void 0?n.condition:e.defaultCondition_,e.duration_=n.duration!==void 0?n.duration:100,e.pixelDelta_=n.pixelDelta!==void 0?n.pixelDelta:128,e}return r.prototype.handleEvent=function(t){var e=!1;if(t.type==G.KEYDOWN){var n=t.originalEvent,o=n.keyCode;if(this.condition_(t)&&(o==Ne.DOWN||o==Ne.LEFT||o==Ne.RIGHT||o==Ne.UP)){var a=t.map,s=a.getView(),l=s.getResolution()*this.pixelDelta_,u=0,h=0;o==Ne.DOWN?h=-l:o==Ne.LEFT?u=-l:o==Ne.RIGHT?u=l:h=l;var f=[u,h];so(f,s.getRotation()),nd(s,f,this.duration_),n.preventDefault(),e=!0}}return!e},r}(un),Id=Ld,Ad=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Md=function(i){Ad(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.condition_=n.condition?n.condition:cl,e.delta_=n.delta?n.delta:1,e.duration_=n.duration!==void 0?n.duration:100,e}return r.prototype.handleEvent=function(t){var e=!1;if(t.type==G.KEYDOWN||t.type==G.KEYPRESS){var n=t.originalEvent,o=n.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var a=t.map,s=o=="+".charCodeAt(0)?this.delta_:-this.delta_,l=a.getView();wo(l,s,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},r}(un),Fd=Md,Nd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ai={TRACKPAD:"trackpad",WHEEL:"wheel"},Dd=function(i){Nd(r,i);function r(t){var e=this,n=t||{};e=i.call(this,n)||this,e.totalDelta_=0,e.lastDelta_=0,e.maxDelta_=n.maxDelta!==void 0?n.maxDelta:1,e.duration_=n.duration!==void 0?n.duration:250,e.timeout_=n.timeout!==void 0?n.timeout:80,e.useAnchor_=n.useAnchor!==void 0?n.useAnchor:!0,e.constrainResolution_=n.constrainResolution!==void 0?n.constrainResolution:!1;var o=n.condition?n.condition:fd;return e.condition_=n.onFocusOnly?qi(ll,o):o,e.lastAnchor_=null,e.startTime_=void 0,e.timeoutId_,e.mode_=void 0,e.trackpadEventGap_=400,e.trackpadTimeoutId_,e.deltaPerZoom_=300,e}return r.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap().getView();t.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},r.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==G.WHEEL)return!0;var n=t.map,o=t.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);var a;if(t.type==G.WHEEL&&(a=o.deltaY,pu&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(a/=is),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(a*=40)),a===0)return!1;this.lastDelta_=a;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(a)<4?Ai.TRACKPAD:Ai.WHEEL);var l=n.getView();if(this.mode_===Ai.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-a/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=a;var u=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),u),!1},r.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-ot(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),wo(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},r.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},r}(un),dl=Dd,Gd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),kd=function(i){Gd(r,i);function r(t){var e=this,n=t||{},o=n;return o.stopDown||(o.stopDown=ei),e=i.call(this,o)||this,e.anchor_=null,e.lastAngle_=void 0,e.rotating_=!1,e.rotationDelta_=0,e.threshold_=n.threshold!==void 0?n.threshold:.3,e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],o=this.targetPointers[1],a=Math.atan2(o.clientY-n.clientY,o.clientX-n.clientX);if(this.lastAngle_!==void 0){var s=a-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=s}this.lastAngle_=a;var l=t.map,u=l.getView();if(u.getConstraints().rotation!==Oo){var h=l.getViewport().getBoundingClientRect(),f=So(this.targetPointers);f[0]-=h.left,f[1]-=h.top,this.anchor_=l.getCoordinateFromPixelInternal(f),this.rotating_&&(l.render(),u.adjustRotationInternal(e,this.anchor_))}},r.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map,n=e.getView();return n.endInteraction(this.duration_),!1}else return!0},r.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}else return!1},r}(hn),bd=kd,jd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Xd=function(i){jd(r,i);function r(t){var e=this,n=t||{},o=n;return o.stopDown||(o.stopDown=ei),e=i.call(this,o)||this,e.anchor_=null,e.duration_=n.duration!==void 0?n.duration:400,e.lastDistance_=void 0,e.lastScaleDelta_=1,e}return r.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],o=this.targetPointers[1],a=n.clientX-o.clientX,s=n.clientY-o.clientY,l=Math.sqrt(a*a+s*s);this.lastDistance_!==void 0&&(e=this.lastDistance_/l),this.lastDistance_=l;var u=t.map,h=u.getView();e!=1&&(this.lastScaleDelta_=e);var f=u.getViewport().getBoundingClientRect(),c=So(this.targetPointers);c[0]-=f.left,c[1]-=f.top,this.anchor_=u.getCoordinateFromPixelInternal(c),u.render(),h.adjustResolutionInternal(e,this.anchor_)},r.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map,n=e.getView(),o=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,o),!1}else return!0},r.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}else return!1},r}(hn),Yd=Xd,Ud=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Wd=function(i){Ud(r,i);function r(t,e,n){var o=i.call(this)||this;if(o.ends_=[],o.maxDelta_=-1,o.maxDeltaRevision_=-1,Array.isArray(t[0]))o.setCoordinates(t,e);else if(e!==void 0&&n)o.setFlatCoordinates(e,t),o.ends_=n;else{for(var a=o.getLayout(),s=t,l=[],u=[],h=0,f=s.length;h0&&this.getCount()>this.highWaterMark},i.prototype.expireCache=function(r){for(;this.canExpireCache();)this.pop()},i.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},i.prototype.containsKey=function(r){return this.entries_.hasOwnProperty(r)},i.prototype.forEach=function(r){for(var t=this.oldest_;t;)r(t.value_,t.key_,this),t=t.newer},i.prototype.get=function(r,t){var e=this.entries_[r];return B(e!==void 0,15),e===this.newest_||(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e),e.value_},i.prototype.remove=function(r){var t=this.entries_[r];return B(t!==void 0,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[r],--this.count_,t.value_},i.prototype.getCount=function(){return this.count_},i.prototype.getKeys=function(){var r=new Array(this.count_),t=0,e;for(e=this.newest_;e;e=e.older)r[t++]=e.key_;return r},i.prototype.getValues=function(){var r=new Array(this.count_),t=0,e;for(e=this.newest_;e;e=e.older)r[t++]=e.value_;return r},i.prototype.peekLast=function(){return this.oldest_.value_},i.prototype.peekLastKey=function(){return this.oldest_.key_},i.prototype.peekFirstKey=function(){return this.newest_.key_},i.prototype.pop=function(){var r=this.oldest_;return delete this.entries_[r.key_],r.newer&&(r.newer.older=null),this.oldest_=r.newer,this.oldest_||(this.newest_=null),--this.count_,r.value_},i.prototype.replace=function(r,t){this.get(r),this.entries_[r].value_=t},i.prototype.set=function(r,t){B(!(r in this.entries_),16);var e={key_:r,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=e:this.oldest_=e,this.newest_=e,this.entries_[r]=e,++this.count_},i.prototype.setSize=function(r){this.highWaterMark=r},i}(),tv=Qd;function Za(i,r,t,e){return e!==void 0?(e[0]=i,e[1]=r,e[2]=t,e):[i,r,t]}function pi(i,r,t){return i+"/"+r+"/"+t}function yl(i){return pi(i[0],i[1],i[2])}function ev(i){return i.split("/").map(Number)}function rv(i){return(i[1]<t||t>r.getMaxZoom())return!1;var o=r.getFullTileRange(t);return o?o.containsXY(e,n):!0}var iv=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ov=function(i){iv(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.expireCache=function(t){for(;this.canExpireCache();){var e=this.peekLast();if(e.getKey()in t)break;this.pop().release()}},r.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var t=this.peekFirstKey(),e=ev(t),n=e[0];this.forEach(function(o){o.tileCoord[0]!==n&&(this.remove(yl(o.tileCoord)),o.release())}.bind(this))}},r}(tv),ml=ov,El=function(){function i(r,t,e,n){this.minX=r,this.maxX=t,this.minY=e,this.maxY=n}return i.prototype.contains=function(r){return this.containsXY(r[1],r[2])},i.prototype.containsTileRange=function(r){return this.minX<=r.minX&&r.maxX<=this.maxX&&this.minY<=r.minY&&r.maxY<=this.maxY},i.prototype.containsXY=function(r,t){return this.minX<=r&&r<=this.maxX&&this.minY<=t&&t<=this.maxY},i.prototype.equals=function(r){return this.minX==r.minX&&this.minY==r.minY&&this.maxX==r.maxX&&this.maxY==r.maxY},i.prototype.extend=function(r){r.minXthis.maxX&&(this.maxX=r.maxX),r.minYthis.maxY&&(this.maxY=r.maxY)},i.prototype.getHeight=function(){return this.maxY-this.minY+1},i.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},i.prototype.getWidth=function(){return this.maxX-this.minX+1},i.prototype.intersects=function(r){return this.minX<=r.maxX&&this.maxX>=r.minX&&this.minY<=r.maxY&&this.maxY>=r.minY},i}();function cr(i,r,t,e,n){return n!==void 0?(n.minX=i,n.maxX=r,n.minY=t,n.maxY=e,n):new El(i,r,t,e)}var Tl=El,Cl=function(){function i(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return i.prototype.getReadOptions=function(r,t){var e;if(t){var n=t.dataProjection?at(t.dataProjection):this.readProjection(r);t.extent&&n&&n.getUnits()===oe.TILE_PIXELS&&(n=at(n),n.setWorldExtent(t.extent)),e={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(e)},i.prototype.adaptOptions=function(r){return ut({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},r)},i.prototype.getType=function(){return F()},i.prototype.readFeature=function(r,t){return F()},i.prototype.readFeatures=function(r,t){return F()},i.prototype.readGeometry=function(r,t){return F()},i.prototype.readProjection=function(r){return F()},i.prototype.writeFeature=function(r,t){return F()},i.prototype.writeFeatures=function(r,t){return F()},i.prototype.writeGeometry=function(r,t){return F()},i}();function Le(i,r,t){var e=t?at(t.featureProjection):null,n=t?at(t.dataProjection):null,o;if(e&&n&&!ke(e,n)?o=(r?i.clone():i).transform(r?e:n,r?n:e):o=i,r&&t&&t.decimals!==void 0){var a=Math.pow(10,t.decimals),s=function(l){for(var u=0,h=l.length;u0?n[0]:null},r.prototype.readFeatureFromNode=function(t,e){return null},r.prototype.readFeatures=function(t,e){if(t)if(typeof t=="string"){var n=Nn(t);return this.readFeaturesFromDocument(n,e)}else return Fn(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e);else return[]},r.prototype.readFeaturesFromDocument=function(t,e){for(var n=[],o=t.firstChild;o;o=o.nextSibling)o.nodeType==Node.ELEMENT_NODE&&Yt(n,this.readFeaturesFromNode(o,e));return n},r.prototype.readFeaturesFromNode=function(t,e){return F()},r.prototype.readGeometry=function(t,e){if(t)if(typeof t=="string"){var n=Nn(t);return this.readGeometryFromDocument(n,e)}else return Fn(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e);else return null},r.prototype.readGeometryFromDocument=function(t,e){return null},r.prototype.readGeometryFromNode=function(t,e){return null},r.prototype.readProjection=function(t){if(t)if(typeof t=="string"){var e=Nn(t);return this.readProjectionFromDocument(e)}else return Fn(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t);else return null},r.prototype.readProjectionFromDocument=function(t){return this.dataProjection},r.prototype.readProjectionFromNode=function(t){return this.dataProjection},r.prototype.writeFeature=function(t,e){var n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)},r.prototype.writeFeatureNode=function(t,e){return null},r.prototype.writeFeatures=function(t,e){var n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)},r.prototype.writeFeaturesNode=function(t,e){return null},r.prototype.writeGeometry=function(t,e){var n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)},r.prototype.writeGeometryNode=function(t,e){return null},r}(Cl),Av=Iv;function Ao(i){var r=di(i,!1),t=Date.parse(r);return isNaN(t)?void 0:t/1e3}function ne(i){var r=di(i,!1);return Mv(r)}function Mv(i){var r=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(i);if(r)return parseFloat(r[1])}function Qn(i){var r=di(i,!1);return Fv(r)}function Fv(i){var r=/^\s*(\d+)\s*$/.exec(i);if(r)return parseInt(r[1],10)}function ft(i){return di(i,!1).trim()}function Nv(i,r){var t=new Date(r*1e3),e=t.getUTCFullYear()+"-"+Gr(t.getUTCMonth()+1,2)+"-"+Gr(t.getUTCDate(),2)+"T"+Gr(t.getUTCHours(),2)+":"+Gr(t.getUTCMinutes(),2)+":"+Gr(t.getUTCSeconds(),2)+"Z";i.appendChild(cn().createTextNode(e))}function De(i,r){var t=r.toPrecision();i.appendChild(cn().createTextNode(t))}function ti(i,r){var t=r.toString();i.appendChild(cn().createTextNode(t))}function pt(i,r){i.appendChild(cn().createTextNode(r))}var Dv=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ht=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],Gv="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",kv={rte:Sl,trk:Rl,wpt:Pl},bv=gt(ht,{rte:Mi(Sl),trk:Mi(Rl),wpt:Mi(Pl)}),jv=gt(ht,{text:K(ft,"linkText"),type:K(ft,"linkType")}),Xv=gt(ht,{rte:Y(hg),trk:Y(cg),wpt:Y(pg)}),Yv=function(i){Dv(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.dataProjection=at("EPSG:4326"),e.readExtensions_=n.readExtensions,e}return r.prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,n=t.length;ethis.sourceWorldWidth_/2){var E=[[y.source[0][0],y.source[0][1]],[y.source[1][0],y.source[1][1]],[y.source[2][0],y.source[2][1]]];E[0][0]-_>this.sourceWorldWidth_/2&&(E[0][0]-=this.sourceWorldWidth_),E[1][0]-_>this.sourceWorldWidth_/2&&(E[1][0]-=this.sourceWorldWidth_),E[2][0]-_>this.sourceWorldWidth_/2&&(E[2][0]-=this.sourceWorldWidth_);var T=Math.min(E[0][0],E[1][0],E[2][0]),x=Math.max(E[0][0],E[1][0],E[2][0]);x-T.5&&f<1,d=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var v=ra([r,t,e,n]),g=it(v)/this.targetWorldWidth_;d=g>Ha||d}!p&&this.sourceProj_.isGlobal()&&f&&(d=f>Ha||d)}if(!(!d&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!Rt(h,this.maxSourceExtent_))){var m=0;if(!d&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(l[0])||!isFinite(l[1]))){if(u>0)d=!0;else if(m=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(u>0){if(!d){var _=[(r[0]+e[0])/2,(r[1]+e[1])/2],y=this.transformInv_(_),E=void 0;if(p){var T=(yr(o[0],c)+yr(s[0],c))/2;E=T-yr(y[0],c)}else E=(o[0]+s[0])/2-y[0];var x=(o[1]+s[1])/2-y[1],w=E*E+x*x;d=w>this.errorThresholdSquared_}if(d){if(Math.abs(r[0]-e[0])<=Math.abs(r[1]-e[1])){var O=[(t[0]+e[0])/2,(t[1]+e[1])/2],R=this.transformInv_(O),M=[(n[0]+r[0])/2,(n[1]+r[1])/2],b=this.transformInv_(M);this.addQuad_(r,t,O,M,o,a,R,b,u-1),this.addQuad_(M,O,e,n,b,R,s,l,u-1)}else{var I=[(r[0]+t[0])/2,(r[1]+t[1])/2],j=this.transformInv_(I),U=[(e[0]+n[0])/2,(e[1]+n[1])/2],A=this.transformInv_(U);this.addQuad_(r,I,U,n,o,j,A,l,u-1),this.addQuad_(I,t,e,U,j,a,s,A,u-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(r,e,n,o,s,l),(m&14)==0&&this.addTriangle_(r,e,t,o,s,a),m&&((m&13)==0&&this.addTriangle_(t,n,r,a,l,o),(m&7)==0&&this.addTriangle_(t,n,e,a,l,s))}},i.prototype.calculateSourceExtent=function(){var r=Pt();return this.triangles_.forEach(function(t,e,n){var o=t.source;Br(r,o[0]),Br(r,o[1]),Br(r,o[2])}),r},i.prototype.getTriangles=function(){return this.triangles_},i}(),yg=_g,to={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},mg={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},Di;function $a(i,r,t,e,n){i.beginPath(),i.moveTo(0,0),i.lineTo(r,t),i.lineTo(e,n),i.closePath(),i.save(),i.clip(),i.fillRect(0,0,Math.max(r,e)+1,Math.max(t,n)),i.restore()}function Gi(i,r){return Math.abs(i[r*4]-210)>2||Math.abs(i[r*4+3]-.75*255)>2}function Eg(){if(Di===void 0){var i=document.createElement("canvas").getContext("2d");i.globalCompositeOperation="lighter",i.fillStyle="rgba(210, 0, 0, 0.75)",$a(i,4,5,4,0),$a(i,4,5,0,5);var r=i.getImageData(0,0,3,3).data;Di=Gi(r,0)||Gi(r,4)||Gi(r,8)}return Di}function qa(i,r,t,e){var n=ms(t,r,i),o=la(r,e,t),a=r.getMetersPerUnit();a!==void 0&&(o*=a);var s=i.getMetersPerUnit();s!==void 0&&(o/=s);var l=i.getExtent();if(!l||en(l,n)){var u=la(i,o,n)/o;isFinite(u)&&u>0&&(o/=u)}return o}function Tg(i,r,t,e){var n=Re(t),o=qa(i,r,n,e);return(!isFinite(o)||o<=0)&&cs(t,function(a){return o=qa(i,r,a,e),isFinite(o)&&o>0}),o}function Cg(i,r,t,e,n,o,a,s,l,u,h,f){var c=kt(Math.round(t*i),Math.round(t*r));if(f||ut(c,to),l.length===0)return c.canvas;c.scale(t,t);function p(E){return Math.round(E*t)/t}c.globalCompositeOperation="lighter";var d=Pt();l.forEach(function(E,T,x){oo(d,E.extent)});var v=it(d),g=Ut(d),m=kt(Math.round(t*v/e),Math.round(t*g/e));f||ut(m,to);var _=t/e;l.forEach(function(E,T,x){var w=E.extent[0]-d[0],O=-(E.extent[3]-d[3]),R=it(E.extent),M=Ut(E.extent);E.image.width>0&&E.image.height>0&&m.drawImage(E.image,u,u,E.image.width-2*u,E.image.height-2*u,w*_,O*_,R*_,M*_)});var y=Qe(a);return s.getTriangles().forEach(function(E,T,x){var w=E.source,O=E.target,R=w[0][0],M=w[0][1],b=w[1][0],I=w[1][1],j=w[2][0],U=w[2][1],A=p((O[0][0]-y[0])/o),k=p(-(O[0][1]-y[1])/o),L=p((O[1][0]-y[0])/o),z=p(-(O[1][1]-y[1])/o),Z=p((O[2][0]-y[0])/o),V=p(-(O[2][1]-y[1])/o),Q=R,C=M;R=0,M=0,b-=Q,I-=C,j-=Q,U-=C;var lt=[[b,I,0,0,L-A],[j,U,0,0,Z-A],[0,0,b,I,z-k],[0,0,j,U,V-k]],X=Iu(lt);if(!!X){if(c.save(),c.beginPath(),Eg()||!f){c.moveTo(L,z);for(var ct=4,Lt=A-L,It=k-z,xt=0;xt=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),s=Math.floor(s/2),o=cr(a,a,s,s,e)):o=this.getTileRangeForExtentAndZ(l,u,e),t(u,o))return!0;--u}return!1},i.prototype.getExtent=function(){return this.extent_},i.prototype.getMaxZoom=function(){return this.maxZoom},i.prototype.getMinZoom=function(){return this.minZoom},i.prototype.getOrigin=function(r){return this.origin_?this.origin_:this.origins_[r]},i.prototype.getResolution=function(r){return this.resolutions_[r]},i.prototype.getResolutions=function(){return this.resolutions_},i.prototype.getTileCoordChildTileRange=function(r,t,e){if(r[0]this.maxZoom||t0?e:Math.max(a/s[0],o/s[1]),u=n+1,h=new Array(u),f=0;fn.highWaterMark&&(n.highWaterMark=t)},r.prototype.useTile=function(t,e,n,o){},r}(Js),Mg=function(i){Fl(r,i);function r(t,e){var n=i.call(this,t)||this;return n.tile=e,n}return r}(Ht),Fg=Ag;function Ng(i,r){var t=/\{z\}/g,e=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){if(a)return i.replace(t,a[0].toString()).replace(e,a[1].toString()).replace(n,a[2].toString()).replace(o,function(){var u=a[0],h=r.getFullTileRange(u);B(h,55);var f=h.getHeight()-a[2]-1;return f.toString()})}}function Dg(i,r){for(var t=i.length,e=new Array(t),n=0;n=0;--o){var a=this.geometryFunction(t[o]);a?ds(n,a.getCoordinates()):t.splice(o,1)}vs(n,1/t.length);var s=Re(e),l=this.interpolationRatio,u=new Pe([n[0]*(1-l)+s[0]*l,n[1]*(1-l)+s[1]*l]);return this.createCustomCluster_?this.createCustomCluster_(u,t):new Oe({geometry:u,features:t})},r}(dr),Hg=Vg,$g=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Nl='© OpenStreetMap contributors.',qg=function(i){$g(r,i);function r(t){var e=t||{},n=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(n=e.interpolate);var o;e.attributions!==void 0?o=e.attributions:o=[Nl];var a=e.crossOrigin!==void 0?e.crossOrigin:"anonymous",s=e.url!==void 0?e.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return i.call(this,{attributions:o,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:a,interpolate:n,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,opaque:e.opaque!==void 0?e.opaque:!0,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX,zDirection:e.zDirection})||this}return r}(jo),Jg=qg,Dn={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"},Qg=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),t_=function(i){Qg(r,i);function r(t){var e=this,n=t||{},o=ut({},n);return delete o.preload,delete o.useInterimTilesOnError,e=i.call(this,o)||this,e.on,e.once,e.un,e.setPreload(n.preload!==void 0?n.preload:0),e.setUseInterimTilesOnError(n.useInterimTilesOnError!==void 0?n.useInterimTilesOnError:!0),e}return r.prototype.getPreload=function(){return this.get(Dn.PRELOAD)},r.prototype.setPreload=function(t){this.set(Dn.PRELOAD,t)},r.prototype.getUseInterimTilesOnError=function(){return this.get(Dn.USE_INTERIM_TILES_ON_ERROR)},r.prototype.setUseInterimTilesOnError=function(t){this.set(Dn.USE_INTERIM_TILES_ON_ERROR,t)},r.prototype.getData=function(t){return i.prototype.getData.call(this,t)},r}(ci),e_=t_,r_=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),n_=function(i){r_(r,i);function r(t){var e=i.call(this,t)||this;return e.extentChanged=!0,e.renderedExtent_=null,e.renderedPixelRatio,e.renderedProjection=null,e.renderedRevision,e.renderedTiles=[],e.newTiles_=!1,e.tmpExtent=Pt(),e.tmpTileRange_=new Tl(0,0,0,0),e}return r.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),o=e.getUseInterimTilesOnError();return n==D.LOADED||n==D.EMPTY||n==D.ERROR&&!o},r.prototype.getTile=function(t,e,n,o){var a=o.pixelRatio,s=o.viewState.projection,l=this.getLayer(),u=l.getSource(),h=u.getTile(t,e,n,a,s);return h.getState()==D.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):h.setState(D.LOADED)),this.isDrawableTile(h)||(h=h.getInterimTile()),h},r.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),o=st(e.pixelToCoordinateTransform,t.slice()),a=n.getExtent();if(a&&!en(a,o))return null;for(var s=e.pixelRatio,l=e.viewState.projection,u=e.viewState,h=n.getRenderSource(),f=h.getTileGridForProjection(u.projection),c=h.getTilePixelRatio(e.pixelRatio),p=f.getZForResolution(u.resolution);p>=f.getMinZoom();--p){var d=f.getTileCoordForCoordAndZ(o,p),v=h.getTile(p,d[1],d[2],s,l);if(!(v instanceof rl||v instanceof Ll))return null;if(v.getState()===D.LOADED){var g=f.getOrigin(p),m=Ft(f.getTileSize(p)),_=f.getResolution(p),y=Math.floor(c*((o[0]-g[0])/_-d[1]*m[0])),E=Math.floor(c*((g[1]-o[1])/_-d[2]*m[1]));return this.getImageData(v.getImage(),y,E)}}return null},r.prototype.loadedTileCallback=function(t,e,n){return this.isDrawableTile(n)?i.prototype.loadedTileCallback.call(this,t,e,n):!1},r.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},r.prototype.renderFrame=function(t,e){var n=t.layerStatesArray[t.layerIndex],o=t.viewState,a=o.projection,s=o.resolution,l=o.center,u=o.rotation,h=t.pixelRatio,f=this.getLayer(),c=f.getSource(),p=c.getRevision(),d=c.getTileGridForProjection(a),v=d.getZForResolution(s,c.zDirection),g=d.getResolution(v),m=t.extent,_=n.extent&&Xe(n.extent);_&&(m=Zr(m,Xe(n.extent)));var y=c.getTilePixelRatio(h),E=Math.round(t.size[0]*y),T=Math.round(t.size[1]*y);if(u){var x=Math.round(Math.sqrt(E*E+T*T));E=x,T=x}var w=g*E/2/y,O=g*T/2/y,R=[l[0]-w,l[1]-O,l[0]+w,l[1]+O],M=d.getTileRangeForExtentAndZ(m,v),b={};b[v]={};var I=this.createLoadedTileFinder(c,a,b),j=this.tmpExtent,U=this.tmpTileRange_;this.newTiles_=!1;for(var A=M.minX;A<=M.maxX;++A)for(var k=M.minY;k<=M.maxY;++k){var L=this.getTile(v,A,k,t);if(this.isDrawableTile(L)){var z=H(this);if(L.getState()==D.LOADED){b[v][L.tileCoord.toString()]=L;var Z=L.inTransition(z);!this.newTiles_&&(Z||this.renderedTiles.indexOf(L)===-1)&&(this.newTiles_=!0)}if(L.getAlpha(z,t.time)===1)continue}var V=d.getTileCoordChildTileRange(L.tileCoord,U,j),Q=!1;V&&(Q=I(v+1,V)),Q||d.forEachTileCoordParentTileRange(L.tileCoord,I,U,j)}var C=g/s;se(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,u,-E/2,-T/2);var lt=as(this.pixelTransform);this.useContainer(e,lt,n.opacity,this.getBackground(t));var X=this.context,ct=X.canvas;no(this.inversePixelTransform,this.pixelTransform),se(this.tempTransform,E/2,T/2,C,C,0,-E/2,-T/2),ct.width!=E||ct.height!=T?(ct.width=E,ct.height=T):this.containerReused||X.clearRect(0,0,E,T),_&&this.clipUnrotated(X,t,_),c.getInterpolate()||ut(X,to),this.preRender(X,t),this.renderedTiles.length=0;var Lt=Object.keys(b).map(Number);Lt.sort(Ke);var It,xt,At;n.opacity===1&&(!this.containerReused||c.getOpaque(t.viewState.projection))?Lt=Lt.reverse():(It=[],xt=[]);for(var rr=Lt.length-1;rr>=0;--rr){var Wt=Lt[rr],fn=c.getTilePixelSize(Wt,h,a),pn=d.getResolution(Wt),ue=pn/g,nr=fn[0]*ue*C,dn=fn[1]*ue*C,Rr=d.getTileCoordForCoordAndZ(Qe(R),Wt),vn=d.getTileCoordExtent(Rr),Ie=st(this.tempTransform,[y*(vn[0]-R[0])/g,y*(R[3]-vn[3])/g]),Pr=y*c.getGutterForProjection(a),gn=b[Wt];for(var ir in gn){var L=gn[ir],he=L.tileCoord,or=Rr[1]-he[1],gi=Math.round(Ie[0]-(or-1)*nr),_n=Rr[2]-he[2],Lr=Math.round(Ie[1]-(_n-1)*dn),A=Math.round(Ie[0]-or*nr),k=Math.round(Ie[1]-_n*dn),$t=gi-A,Bt=Lr-k,Ae=v===Wt,Z=Ae&&L.getAlpha(H(this),t.time)!==1,Ir=!1;if(!Z)if(It){At=[A,k,A+$t,k,A+$t,k+Bt,A,k+Bt];for(var Ot=0,yn=It.length;OtStamen Design, under CC BY 3.0.',Nl],u_={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},h_={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},c_=function(i){s_(r,i);function r(t){var e=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(e=t.interpolate);var n=t.layer.indexOf("-"),o=n==-1?t.layer:t.layer.slice(0,n),a=h_[o],s=u_[t.layer],l=t.url!==void 0?t.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+t.layer+"/{z}/{x}/{y}."+s.extension;return i.call(this,{attributions:l_,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:e,maxZoom:t.maxZoom!=null?t.maxZoom:a.maxZoom,minZoom:t.minZoom!=null?t.minZoom:a.minZoom,opaque:s.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:l,wrapX:t.wrapX,zDirection:t.zDirection})||this}return r}(jo),f_=c_;if(typeof Dl!="object")var Dl={};const S={mapWrapClass:"a2g-map-wrap",mapClass:"a2g-map",convexHullFill:null,convexHullStroke:null,textFill:null,textStroke:null,innerCircle:null,outerCircle:null,initMapConfig:function(i){this.layers.maptiler.a===null&&i.api&&i.api.maptiler&&i.api.maptiler.key&&(this.layers.maptiler.a=i.api.maptiler.key),this.layers.thunderforest.a===null&&i.api&&i.api.thunderforest&&i.api.thunderforest.key&&(this.layers.thunderforest.a=i.api.thunderforest.key),this.convexHullFill===null&&(i.style&&typeof i.style.convexHullFill=="object"?this.convexHullFill=new Tt(i.style.convexHullFill):this.convexHullFill=new Tt({color:"rgba(255, 153, 0, 0.4)"})),this.convexHullStroke===null&&(i.style&&typeof i.style.convexHullStroke=="object"?this.convexHullStroke=new Et(i.style.convexHullStroke):this.convexHullStroke=new Et({color:"rgba(255, 153, 0, 0.4)"})),this.textFill===null&&(i.style&&typeof i.style.textFill=="object"?this.textFill=new Tt(i.style.textFill):this.textFill=new Tt({color:"rgba(0, 0, 0, 0.9)"})),this.textStroke===null&&(i.style&&typeof i.style.textStroke=="object"?this.textStroke=new Et(i.style.textStroke):this.textStroke=new Et({color:"rgba(255, 153, 0, 0.4)"})),this.innerCircle===null&&(i.style&&typeof i.style.innerCircle=="object"?this.innerCircle=new ge({radius:i.style.innerCircle.radius,fill:new Tt(i.style.innerCircle.fill)}):this.innerCircle=new ge({radius:14,fill:new Tt({color:"rgba(255, 165, 0, 0.7)"})})),this.outerCircle===null&&(i.style&&typeof i.style.outerCircle=="object"?this.outerCircle=new ge({radius:i.style.outerCircle.radius,fill:new Tt(i.style.outerCircle.fill)}):this.outerCircle=new ge({radius:14,fill:new Tt({color:"rgba(255, 165, 0, 0.7)"})})),i.style&&i.style.gpx?this.gpx.initConfig(i.style.gpx):this.gpx.initConfig({})},styles:[],mapWraps:[],maps:[],mapConfigs:[],mapObjects:[],gpx:{mapSources:[],mapLayers:[],style:{Point:null,LineString:null,MultiLineString:null},initConfig:function(i){this.style.Point===null&&(typeof i.Point=="object"?this.style.Point=new yt({image:new ge({fill:new Tt(i.Point.image.fill),radius:i.Point.image.radius,stroke:new Et(i.Point.image.stroke)})}):this.style.Point=new yt({image:new ge({fill:new Tt({color:"rgba(255,255,0,0.4)"}),radius:5,stroke:new Et({color:"#ff0",width:1})})})),this.style.LineString===null&&(typeof i.LineString=="object"?this.style.LineString=new yt({stroke:new Et(i.LineString.stroke)}):this.style.LineString=new yt({stroke:new Et({color:"#f00",width:3})})),this.style.MultiLineString===null&&(typeof i.MultiLineString=="object"?this.style.MultiLineString=new yt({stroke:new Et(i.MultiLineString.stroke)}):this.style.MultiLineString=new yt({stroke:new Et({color:"#f00",width:3})}))},init:function(i){var r=this;typeof S.mapConfigs[i].gpxSource!="undefined"&&(r.mapSources[i]=new dr({url:S.mapConfigs[i].gpxSource,format:new dg}),r.mapLayers[i]=new hr({source:r.mapSources[i],style:function(t){return r.style[t.getGeometry().getType()]}}),S.layers.mapLayers[i].push(r.mapLayers[i]))}},geolocate:{locateMeDoms:[],checkboxClass:"a2g-map-geolocate-me",geolocations:[],positionFeature:new Oe,accuracyFeature:new Oe,mapSources:[],mapLayers:[],setPositionFeatureStyle:function(){this.positionFeature.setStyle(new yt({image:new ge({radius:6,fill:new Tt({color:"#3399CC"}),stroke:new Et({color:"#fff",width:2})})}))},setMapGeolocations:function(i){var r=this;r.geolocations[i]=new Lh({trackingOptions:{enableHighAccuracy:!0},projection:S.views[i].getProjection()}),r.geolocations[i].on("change:position",function(){const t=r.geolocations[i].getPosition();r.positionFeature.setGeometry(t?new Pe(t):null)}),r.geolocations[i].on("change:accuracyGeometry",function(){r.accuracyFeature.setGeometry(r.geolocations[i].getAccuracyGeometry())})},setGeolocateMeAction:function(i){var r=this;r.locateMeDoms[i]=S.mapWraps[i].getElementsByClassName(r.checkboxClass),r.locateMeDoms[i].length>0&&(r.setMapGeolocations(i),r.mapSources[i]=new dr({features:[r.accuracyFeature,r.positionFeature]}),r.mapLayers[i]=new hr({map:S.mapObjects[i],source:r.mapSources[i]}));for(var t=0;t altogether',attributionOpenStreetMap:'© OpenStreetMap',thunderforest:{a:null,baseUrl:"https://tile.thunderforest.com/",baseUrlSufix:"/{z}/{x}/{y}.png?apikey=",getUrl:function(i){return this.baseUrl+i+this.baseUrlSufix+this.a}},maptiler:{a:null,baseUrl:"https://api.maptiler.com/maps/",baseUrlSufix:"/{z}/{x}/{y}.png?key=",jpgUrlSufix:"/{z}/{x}/{y}.jpg?key=",getUrl:function(i){return i==="hybrid"||i==="openstreetmap"?this.baseUrl+i+this.jpgUrlSufix+this.a:this.baseUrl+i+this.baseUrlSufix+this.a}},countryLayerStyle:new yt({fill:new Tt({color:"#aaa"}),stroke:new Et({color:"#333"})}),setCountryLayer:function(i,r,t){var e=this;e.mapCountryOverlay[i]=r,e.mapLayerSources[i][r]=new dr({url:typeof t.countryGeoSource=="undefined"?e.coutriesGeojsonSource:t.countryGeoSource,format:new Ka}),e.mapLayers[i][r]=new hr({source:e.mapLayerSources[i][r],style:function(n){return e.countryLayerStyle.getFill().setColor("#aaa"),e.countryLayerStyle}})},setMapXyzLayer:function(i,r,t){this.mapLayerSources[i][r]=new jo(t),this.mapLayers[i][r]=new bi({source:this.mapLayerSources[i][r]})},setMapOsmLayer:function(i,r,t){this.mapLayerSources[i][r]=new Jg(t),this.mapLayers[i][r]=new bi({source:this.mapLayerSources[i][r]})},setMapStamenLayer:function(i,r,t){this.mapLayerSources[i][r]=new f_(t),this.mapLayers[i][r]=new bi({source:this.mapLayerSources[i][r]})},appendToMapLayerSwitcher:function(i,r,t){for(var e=0;e2&&this.mapLayers[i][a].setSource(null);else n>2&&this.mapLayers[i][a].setSource(null);this.appendToMapLayerSwitcher(i,t[a],a)}if(this.setLayerSwitcherAction(i),e){this.mapLayers[i][S.layers.mapLayers[i].length-1].setSource(S.layers.mapLayerSources[i][S.layers.mapLayerSources[i].length-1]);for(var a=0;a{typeof r.layers.mapCountryOverlay[i]!="undefined"&&(document.addEventListener("pointermove",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}),document.addEventListener("click",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}),document.addEventListener("focus",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}),document.addEventListener("scroll",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}))})},executedInitActions:[],featureOverlaySource:[],featureOverlayStyle:[],setFeatureOverlayStyle:function(i,r){typeof this.featureOverlayStyle[i]=="undefined"&&(r.style&&typeof r.style.featureOverlay=="object"?typeof r.style.featureOverlay.fill=="object"&&typeof r.style.featureOverlay.stroke=="object"?this.featureOverlayStyle[i]=new yt({fill:new Tt(r.style.featureOverlay.fill),stroke:new Et(r.style.featureOverlay.stroke)}):typeof r.style.featureOverlay.fill=="object"?this.featureOverlayStyle[i]=new yt({fill:new Tt(r.style.featureOverlay.fill)}):typeof r.style.featureOverlay.stroke=="object"&&(this.featureOverlayStyle[i]=new yt({stroke:new Et(r.style.featureOverlay.stroke)})):this.featureOverlayStyle[i]=new yt({stroke:new Et({color:"rgba(255,255,255, 0.6)",width:4})}))},featureOverlay:[],featureHighlight:[],setMapClickAction:function(i){S.layers.mapCountryOverlay[i]!==null&&S.mapObjects[i].on("pointermove",function(r){typeof S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]]!="undefined"&&S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]].getFeatures(r.pixel).then(function(t){const e=t.length?t[0]:void 0;e!==S.featureHighlight[i]&&(S.featureHighlight[i]&&S.featureOverlay[i].getSource().removeFeature(S.featureHighlight[i]),e&&S.featureOverlay[i].getSource().addFeature(e),S.featureHighlight[i]=e)})}),S.mapObjects[i].on("click",function(r){var t=!0;typeof S.marker.layers.mapClusters[i]!="undefined"&&S.marker.layers.mapClusters[i].getFeatures(r.pixel).then(function(e){if(e.length>0){t=!1;const n=e[0].get("features");if(n.length>1){const o=Pt();n.forEach(l=>oo(o,l.getGeometry().getExtent()));const a=S.mapObjects[i].getView(),s=S.mapObjects[i].getView().getResolution();a.getZoom()===a.getMaxZoom()?(clickFeature=e[0],clickResolution=s,S.marker.layers.mapClusterCircles[i].setStyle(S.marker.layers.clusterCircleStyle)):a.fit(o,{duration:500,padding:[170,50,30,150]})}else typeof n[0].values_.popup!="undefined"&&(S.popup.content[i].innerHTML=n[0].values_.popup,S.popup.overlay[i].setPosition(n[0].getGeometry().getCoordinates()))}}),S.layers.mapCountryOverlay[i]!==null&&typeof S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]]!="undefined"&&S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]].getFeatures(r.pixel).then(function(e){if(t){const u=e.length?e[0]:void 0;if(u!==void 0&&u.get("popup")!==void 0){S.popup.content[i].innerHTML=u.get("popup");for(var n=0,o=0,a=0,s=0;s1?[new yt({image:S.outerCircle}),new yt({image:S.innerCircle,text:new lc({text:r.toString(),fill:S.textFill,stroke:S.textStroke})})]:S.marker.icons.clusterMemberStyle(i.get("features")[0])},clusterCircleStyle:function(i,r){if(i!==S.clickFeature||r!==S.clickResolution)return;const t=i.get("features");return i.getGeometry().getCoordinates(),S.marker.layers.generatePointsCircle(t.length,i.getGeometry().getCoordinates(),r).reduce((e,n,o)=>{const a=new Pe(n);return e.push(S.marker.icons.clusterMemberStyle(new Oe(qo($o({},t[o].getProperties()),{geometry:a})))),e},[])},setMapMarkerLayer:function(i){typeof this.mapVectorSources[i]=="undefined"&&(S.mapConfigs[i].markerSource?this.mapVectorSources[i]=new dr({format:new Ka,url:S.mapConfigs[i].markerSource}):this.mapVectorSources[i]=null),typeof this.mapClusterSources[i]=="undefined"&&this.mapVectorSources[i]!==null&&(this.mapClusterSources[i]=new Hg({distance:this.clusterDistance,source:this.mapVectorSources[i]})),typeof this.mapClusters[i]=="undefined"&&typeof this.mapClusterSources[i]=="object"&&(this.mapClusters[i]=new hr({source:this.mapClusterSources[i],style:this.clusterStyle})),typeof this.mapClusterCircles[i]=="undefined"&&typeof this.mapClusterSources[i]=="object"&&(this.mapClusterCircles[i]=new hr({source:this.mapClusterSources[i],style:this.clusterCircleStyle})),this.mapVectorSources[i]!==null&&(S.layers.mapLayers[i].push(this.mapClusters[i]),S.layers.mapLayers[i].push(this.mapClusterCircles[i]))}}},clickFeature:null,clickResolution:null,fillMapConfigs:function(i){this.maps[i].dataset.mapConfig&&(this.mapConfigs[i]=JSON.parse(this.maps[i].dataset.mapConfig)),typeof this.mapConfigs[i]=="undefined"&&(this.mapConfigs[i]={}),this.maps[i].dataset.markers&&(this.mapConfigs[i].markers=this.maps[i].dataset.markers),this.maps[i].dataset.markerSource&&(this.mapConfigs[i].markerSource=this.maps[i].dataset.markerSource),this.maps[i].dataset.mapLayers&&(this.mapConfigs[i].mapLayers=JSON.parse(this.maps[i].dataset.mapLayers)),this.maps[i].dataset.gpxSource&&(this.mapConfigs[i].gpxSource=this.maps[i].dataset.gpxSource),this.maps[i].dataset.defaultMarkerIcon&&(this.mapConfigs[i].defaultMarkerIcon=this.maps[i].dataset.defaultMarkerIcon),this.maps[i].dataset.centerLon&&(this.mapConfigs[i].centerLon=this.maps[i].dataset.centerLon),this.maps[i].dataset.centerLat&&(this.mapConfigs[i].centerLat=this.maps[i].dataset.centerLat),this.maps[i].dataset.zoom&&(this.mapConfigs[i].zoom=this.maps[i].dataset.zoom),this.maps[i].dataset.maxZoom&&(this.mapConfigs[i].maxZoom=this.maps[i].dataset.maxZoom),this.maps[i].dataset.zoomSlider&&(this.mapConfigs[i].zoomSlider=this.maps[i].dataset.zoomSlider),this.maps[i].dataset.fullScreen&&(this.mapConfigs[i].fullScreen=this.maps[i].dataset.fullScreen)},init:function(i){this.initMapConfig(i);var r=document.getElementsByClassName(this.mapWrapClass);for(let t=0;t 'altogether Maps', + 'description' => '', + 'category' => 'plugin', + 'author' => 'Raphael Martin', + 'author_email' => 'raphy.martin@gmail.com', + 'state' => 'alpha', + 'clearCacheOnLoad' => 0, + 'version' => '1.0.0', + 'constraints' => [ + 'depends' => [ + 'typo3' => '10.4.0-12.1.99', + 'a2g_toolkit' => '1.0.0-1.5.99', + 'tt_address' => '6.1.0-7.1.99' + ], + 'conflicts' => [], + 'suggests' => [], + ], +]; diff --git a/ext_localconf.php b/ext_localconf.php new file mode 100755 index 0000000..0adf1d1 --- /dev/null +++ b/ext_localconf.php @@ -0,0 +1,76 @@ + 'latLonMapWizard', + 'priority' => 30, + 'class' => \A2G\A2gMaps\FormEngine\FieldControl\LocationMapWizard::class +]; + + +// PageTS +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(''); + +call_user_func(static function() { + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'A2gMaps', + 'map', + [ + \A2G\A2gMaps\Controller\MapController::class => 'map, popup, mapMarkers' + ], + // non-cacheable actions + [ + \A2G\A2gMaps\Controller\MapController::class => '' + ] + ); + + + // wizards + /* + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( + 'mod { + wizards.newContentElement.wizardItems.plugins { + elements { + map { + iconIdentifier = a2g_maps-plugin-map + title = LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:a2g_maps.name + description = LLL:EXT:a2g_maps/Resources/Private/Language/locallang_db.xlf:a2g_maps.description + tt_content_defValues { + CType = list + list_type = a2g_maps + } + } + } + show = * + } + }' + ); + */ + + $pluginIcons = [ + 'a2g_maps-plugin-map' => 'EXT:a2g_maps/Resources/Public/Icons/map.png' + ]; + $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); + + foreach($pluginIcons as $key => $icon){ + $iconRegistry->registerIcon( + $key, + \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, + ['source' => $icon] + ); + } +}); + + +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['a2g_maps'] + = \A2G\A2gMaps\Hooks\MapEntryDataHandlerHooks::class; + +/*************** + * Register "a2g" as global fluid namespace + */ +//$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['a2gmaps'][] = 'A2G\\A2gMaps\\ViewHelpers'; diff --git a/ext_tables.php b/ext_tables.php new file mode 100755 index 0000000..7a18a49 --- /dev/null +++ b/ext_tables.php @@ -0,0 +1,11 @@ +