From 1c1b928a68124c868085dfc741ff295db871d13a Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Wed, 14 Jul 2021 14:05:25 +0200 Subject: [PATCH 01/29] Add new MapActionsController and imageAction - Add new route to API contract with default values (must be removed after development) - register new MapActionsController at ActionsControllerIndex --- littlenavmap.pro | 2 ++ src/webapi/actionscontrollerindex.cpp | 19 +++++++++++ src/webapi/mapactionscontroller.cpp | 37 ++++++++++++++++++++++ src/webapi/mapactionscontroller.h | 38 ++++++++++++++++++++++ web/webapi.yaml | 45 +++++++++++++++++++++++++++ 5 files changed, 141 insertions(+) create mode 100644 src/webapi/mapactionscontroller.cpp create mode 100644 src/webapi/mapactionscontroller.h diff --git a/littlenavmap.pro b/littlenavmap.pro index 11ea9529e..2cea6babf 100644 --- a/littlenavmap.pro +++ b/littlenavmap.pro @@ -389,6 +389,7 @@ SOURCES += \ src/webapi/abstractlnmactionscontroller.cpp \ src/webapi/actionscontrollerindex.cpp \ src/webapi/airportactionscontroller.cpp \ + src/webapi/mapactionscontroller.cpp \ src/webapi/webapicontroller.cpp HEADERS += \ @@ -559,6 +560,7 @@ HEADERS += \ src/webapi/abstractlnmactionscontroller.h \ src/webapi/actionscontrollerindex.h \ src/webapi/airportactionscontroller.h \ + src/webapi/mapactionscontroller.h \ src/webapi/webapicontroller.h \ src/webapi/webapirequest.h \ src/webapi/webapiresponse.h diff --git a/src/webapi/actionscontrollerindex.cpp b/src/webapi/actionscontrollerindex.cpp index 24eda93a1..4f6300e01 100644 --- a/src/webapi/actionscontrollerindex.cpp +++ b/src/webapi/actionscontrollerindex.cpp @@ -1,8 +1,27 @@ +/***************************************************************************** +* Copyright 2015-2020 Alexander Barthel alex@littlenavmap.org +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*****************************************************************************/ + #include "actionscontrollerindex.h" #include "airportactionscontroller.h" +#include "mapactionscontroller.h" void ActionsControllerIndex::registerQMetaTypes() { /* Available action controllers must be registered here */ qRegisterMetaType(); + qRegisterMetaType(); } diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp new file mode 100644 index 000000000..3f6f20a4b --- /dev/null +++ b/src/webapi/mapactionscontroller.cpp @@ -0,0 +1,37 @@ +/***************************************************************************** +* Copyright 2015-2020 Alexander Barthel alex@littlenavmap.org +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*****************************************************************************/ + +#include "mapactionscontroller.h" +#include "abstractlnmactionscontroller.h" + +#include + +MapActionsController::MapActionsController(QObject *parent, bool verboseParam, AbstractInfoBuilder* infoBuilder) : + AbstractLnmActionsController(parent, verboseParam, infoBuilder) +{ + qDebug() << Q_FUNC_INFO; +} + +WebApiResponse MapActionsController::imageAction(WebApiRequest request){ + + WebApiResponse response = getResponse(); + + response.body = "Not implemented"; + + return response; + +} diff --git a/src/webapi/mapactionscontroller.h b/src/webapi/mapactionscontroller.h new file mode 100644 index 000000000..2c7433439 --- /dev/null +++ b/src/webapi/mapactionscontroller.h @@ -0,0 +1,38 @@ +/***************************************************************************** +* Copyright 2015-2020 Alexander Barthel alex@littlenavmap.org +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*****************************************************************************/ + +#ifndef MAPACTIONSCONTROLLER_H +#define MAPACTIONSCONTROLLER_H + +#include "webapi/abstractlnmactionscontroller.h" + +/** + * @brief Map actions controller implementation. + */ +class MapActionsController : + public AbstractLnmActionsController +{ + Q_OBJECT +public: + Q_INVOKABLE MapActionsController(QObject *parent, bool verboseParam, AbstractInfoBuilder* infoBuilder); + /** + * @brief get map image + */ + Q_INVOKABLE WebApiResponse imageAction(WebApiRequest request); +}; + +#endif // MAPACTIONSCONTROLLER_H diff --git a/web/webapi.yaml b/web/webapi.yaml index 98aa26e67..122d71734 100644 --- a/web/webapi.yaml +++ b/web/webapi.yaml @@ -8,6 +8,8 @@ servers: tags: - name: Airport description: AirportActionsController +- name: Map + description: MapActionsController paths: /airport/info: get: @@ -36,6 +38,49 @@ paths: schema: type: string example: "Airport not found" + /map/image: + get: + tags: + - Map + summary: Get map image by lat/lon rectangle + operationId: mapImageAction + parameters: + - name: toplat + required: true + in: query + description: Top latitude + schema: + type: number + default: 11.4 + - name: bottomlat + required: true + in: query + description: Bottom latitude + schema: + type: number + default: 11.5 + - name: leftlon + required: true + in: query + description: Left longitude + schema: + type: number + default: 44.1 + - name: rightlon + required: true + in: query + description: Right longitude + schema: + type: number + default: 44.2 + responses: + 200: + description: Resulting map image + content: + image/png: + schema: + type: string + format: binary components: schemas: AirportInfoResponse: From 32f1f3c90e8b5e0f0f68d0d56b471470392b0b26 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Wed, 14 Jul 2021 16:42:37 +0200 Subject: [PATCH 02/29] Clone WebMapController logic to MapActionsController - PoC example only - Proove rendering retrievable via api --- src/webapi/mapactionscontroller.cpp | 224 +++++++++++++++++++++++++++- src/webapi/mapactionscontroller.h | 37 +++++ web/webapi.yaml | 8 +- 3 files changed, 263 insertions(+), 6 deletions(-) diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index 3f6f20a4b..3498b87a3 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -18,20 +18,240 @@ #include "mapactionscontroller.h" #include "abstractlnmactionscontroller.h" +#include + +#include "mapgui/mappaintwidget.h" +#include "mapgui/mapwidget.h" +#include "navapp.h" + #include +#include +#include MapActionsController::MapActionsController(QObject *parent, bool verboseParam, AbstractInfoBuilder* infoBuilder) : - AbstractLnmActionsController(parent, verboseParam, infoBuilder) + AbstractLnmActionsController(parent, verboseParam, infoBuilder), parentWidget((QWidget *)parent) // WARNING: Uncertain cast (QWidget *) QObject { qDebug() << Q_FUNC_INFO; + init(); } WebApiResponse MapActionsController::imageAction(WebApiRequest request){ WebApiResponse response = getResponse(); - response.body = "Not implemented"; + atools::geo::Rect rect( + request.parameters.value("leftlon").toFloat(), + request.parameters.value("toplat").toFloat(), + request.parameters.value("rightlon").toFloat(), + request.parameters.value("bottomlat").toFloat() + ); + + MapPixmap map = getPixmapRect(100,100,rect); + + if(map.isValid()) + { + // =========================================================================== + // Write pixmap as image + QByteArray bytes; + QBuffer buffer(&bytes); + buffer.open(QIODevice::WriteOnly); + + map.pixmap.save(&buffer, "PNG", 80); + + response.body = bytes; + } + + response.headers.replace("Content-Type", "image/png"); return response; } +MapActionsController::~MapActionsController() +{ + qDebug() << Q_FUNC_INFO; + deInit(); +} + +void MapActionsController::init() +{ + qDebug() << Q_FUNC_INFO; + + deInit(); + + // Create a map widget clone with the desired resolution + mapPaintWidget = new MapPaintWidget(parentWidget, false /* no real widget - hidden */); + + // Activate painting + mapPaintWidget->setActive(); +} + +void MapActionsController::deInit() +{ + qDebug() << Q_FUNC_INFO; + + delete mapPaintWidget; + mapPaintWidget = nullptr; +} + +MapPixmap MapActionsController::getPixmap(int width, int height) +{ + if(verbose) + qDebug() << Q_FUNC_INFO << width << "x" << height; + + return getPixmapPosDistance(width, height, atools::geo::EMPTY_POS, + static_cast(NavApp::getMapWidget()->distance()), QLatin1String("")); +} + +MapPixmap MapActionsController::getPixmapObject(int width, int height, web::ObjectType type, const QString& ident, + float distanceKm) +{ + if(verbose) + qDebug() << Q_FUNC_INFO << width << "x" << height << "type" << type << "ident" << ident << "distanceKm" << + distanceKm; + + MapPixmap mapPixmap; + switch(type) + { + case web::USER_AIRCRAFT: { + mapPixmap = getPixmapPosDistance(width, height, NavApp::getUserAircraftPos(), distanceKm, QLatin1String(""), tr("No user aircraft")); + break; + } + + case web::ROUTE: { + mapPixmap = getPixmapRect(width, height, NavApp::getRouteRect(), tr("No flight plan")); + break; + } + + case web::AIRPORT: { + mapPixmap = getPixmapPosDistance(width, height, NavApp::getAirportPos(ident), distanceKm, QLatin1String(""), tr("Airport %1 not found").arg(ident)); + break; + } + } + return mapPixmap; +} + +MapPixmap MapActionsController::getPixmapPosDistance(int width, int height, atools::geo::Pos pos, float distanceKm, + const QString& mapCommand, const QString& errorCase) +{ + if(verbose) + qDebug() << Q_FUNC_INFO << width << "x" << height << pos << "distanceKm" << distanceKm << "cmd" << mapCommand; + + if(!pos.isValid()) + { + if(errorCase == QLatin1String("")) + { + // Use current map position + pos.setLonX(static_cast(NavApp::getMapWidget()->centerLongitude())); + pos.setLatY(static_cast(NavApp::getMapWidget()->centerLatitude())); + } + else + { + qWarning() << Q_FUNC_INFO << errorCase; + MapPixmap mappixmap; + mappixmap.error = errorCase; + return mappixmap; + } + } + + if(mapPaintWidget != nullptr) + { + // Copy all map settings + mapPaintWidget->copySettings(*NavApp::getMapWidget()); + + // Do not center world rectangle when resizing map widget + mapPaintWidget->setKeepWorldRect(false); + + // Jump to position without zooming for sharp map + mapPaintWidget->showPosNotAdjusted(pos, distanceKm); + + if(!mapCommand.isEmpty()) + { + // Move or zoom map by command + if(mapCommand == QLatin1String("left")) + mapPaintWidget->moveLeft(Marble::Instant); + else if(mapCommand == QLatin1String("right")) + mapPaintWidget->moveRight(Marble::Instant); + else if(mapCommand == QLatin1String("up")) + mapPaintWidget->moveUp(Marble::Instant); + else if(mapCommand == QLatin1String("down")) + mapPaintWidget->moveDown(Marble::Instant); + else if(mapCommand == QLatin1String("in")) + mapPaintWidget->zoomIn(Marble::Instant); + else if(mapCommand == QLatin1String("out")) + mapPaintWidget->zoomOut(Marble::Instant); + else + { + qWarning() << Q_FUNC_INFO << "Invalid map command" << mapCommand; + return MapPixmap(); + } + } + + // Jump to next sharp level + mapPaintWidget->zoomIn(Marble::Instant); + mapPaintWidget->zoomOut(Marble::Instant); + + MapPixmap mappixmap; + + // The actual zoom distance + mappixmap.correctedDistanceKm = static_cast(mapPaintWidget->distance()); + + if(mapCommand == QLatin1String("in") || mapCommand == QLatin1String("out")) + // Requested is equal to result when zooming + mappixmap.requestedDistanceKm = mappixmap.correctedDistanceKm; + else + // What was requested + mappixmap.requestedDistanceKm = distanceKm; + + // Fill result object + mappixmap.pixmap = mapPaintWidget->getPixmap(width, height); + mappixmap.pos = mapPaintWidget->getCurrentViewCenterPos(); + + return mappixmap; + } + else + { + qWarning() << Q_FUNC_INFO << "mapPaintWidget is null"; + return MapPixmap(); + } +} + +MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo::Rect rect, const QString& errorCase) +{ + if(verbose) + qDebug() << Q_FUNC_INFO << width << "x" << height << rect; + + if(rect.isValid()) + { + if(mapPaintWidget != nullptr) + { + // Copy all map settings + mapPaintWidget->copySettings(*NavApp::getMapWidget()); + + // Do not center world rectangle when resizing + mapPaintWidget->setKeepWorldRect(false); + + mapPaintWidget->showRectStreamlined(rect); + + MapPixmap mapPixmap; + + // No distance requested. Therefore requested is equal to actual + mapPixmap.correctedDistanceKm = mapPixmap.requestedDistanceKm = static_cast(mapPaintWidget->distance()); + mapPixmap.pixmap = mapPaintWidget->getPixmap(width, height); + mapPixmap.pos = mapPaintWidget->getCurrentViewCenterPos(); + + return mapPixmap; + } + else + { + qWarning() << Q_FUNC_INFO << "mapPaintWidget is null"; + return MapPixmap(); + } + } + else + { + qWarning() << Q_FUNC_INFO << errorCase; + MapPixmap mapPixmap; + mapPixmap.error = errorCase; + return mapPixmap; + } +} diff --git a/src/webapi/mapactionscontroller.h b/src/webapi/mapactionscontroller.h index 2c7433439..12fd782be 100644 --- a/src/webapi/mapactionscontroller.h +++ b/src/webapi/mapactionscontroller.h @@ -19,7 +19,15 @@ #define MAPACTIONSCONTROLLER_H #include "webapi/abstractlnmactionscontroller.h" +#include "web/webmapcontroller.h" +#include "web/webflags.h" + +#include "geo/rect.h" +#include + +class QPixmap; +class MapPaintWidget; /** * @brief Map actions controller implementation. */ @@ -33,6 +41,35 @@ class MapActionsController : * @brief get map image */ Q_INVOKABLE WebApiResponse imageAction(WebApiRequest request); + + explicit MapActionsController(QWidget *parent, bool verboseParam); + virtual ~MapActionsController() override; + + MapActionsController(const MapActionsController& other) = delete; + MapActionsController& operator=(const MapActionsController& other) = delete; + +protected: + + /* Create or delete the map paint widget */ + void init(); + void deInit(); + + /* Get pixmap with given width and height from current position. */ + MapPixmap getPixmap(int width, int height); + + /* Get pixmap with given width and height for a map object like an airport, the user aircraft or a route. */ + MapPixmap getPixmapObject(int width, int height, web::ObjectType type, const QString& ident, float distanceKm); + + /* Get map at given position and distance. Command can be used to zoom in/out or scroll from the given position: + * "in", "out", "left", "right", "up" and "down". */ + MapPixmap getPixmapPosDistance(int width, int height, atools::geo::Pos pos, float distanceKm, const QString& mapCommand, const QString& errorCase = QLatin1String("")); + + /* Zoom to rectangel on map. */ + MapPixmap getPixmapRect(int width, int height, atools::geo::Rect rect, const QString& errorCase = tr("Invalid rectangle")); + + MapPaintWidget *mapPaintWidget = nullptr; + QWidget *parentWidget; + bool verbose = false; }; #endif // MAPACTIONSCONTROLLER_H diff --git a/web/webapi.yaml b/web/webapi.yaml index 122d71734..7a4dce997 100644 --- a/web/webapi.yaml +++ b/web/webapi.yaml @@ -51,28 +51,28 @@ paths: description: Top latitude schema: type: number - default: 11.4 + default: 10 - name: bottomlat required: true in: query description: Bottom latitude schema: type: number - default: 11.5 + default: 15 - name: leftlon required: true in: query description: Left longitude schema: type: number - default: 44.1 + default: 40 - name: rightlon required: true in: query description: Right longitude schema: type: number - default: 44.2 + default: 45 responses: 200: description: Resulting map image From 332e848faf81561ab7caabcf7fd9230d660725bb Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Wed, 14 Jul 2021 17:52:10 +0200 Subject: [PATCH 03/29] Add missing image retrieval params - Replace default values by "example" values from api contract - Compatible with initial https://github.com/KOKAProduktion/littlenavmap-openlayers/tree/feature/lnm-webapi --- src/webapi/mapactionscontroller.cpp | 26 ++++++++++++++++---- web/webapi.yaml | 37 +++++++++++++++++++++++++---- 2 files changed, 54 insertions(+), 9 deletions(-) diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index 3498b87a3..c76282079 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -46,7 +46,14 @@ WebApiResponse MapActionsController::imageAction(WebApiRequest request){ request.parameters.value("bottomlat").toFloat() ); - MapPixmap map = getPixmapRect(100,100,rect); + MapPixmap map = getPixmapRect( + request.parameters.value("width").toInt(), + request.parameters.value("height").toInt(), + rect + ); + + QString format = QString(request.parameters.value("format")); + int quality = request.parameters.value("quality").toInt(); if(map.isValid()) { @@ -56,13 +63,22 @@ WebApiResponse MapActionsController::imageAction(WebApiRequest request){ QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly); - map.pixmap.save(&buffer, "PNG", 80); + if(format == QLatin1String("jpg")) + { + response.headers.replace("Content-Type", "image/jpg"); + map.pixmap.save(&buffer, "PNG", quality); + } + else if(format == QLatin1String("png")) + { + response.headers.replace("Content-Type", "image/png"); + map.pixmap.save(&buffer, "PNG", quality); + } + else + // Should never happen + qWarning() << Q_FUNC_INFO << "invalid format"; response.body = bytes; } - - response.headers.replace("Content-Type", "image/png"); - return response; } diff --git a/web/webapi.yaml b/web/webapi.yaml index 7a4dce997..a82977353 100644 --- a/web/webapi.yaml +++ b/web/webapi.yaml @@ -24,6 +24,7 @@ paths: description: Airport ICAO code schema: type: string + example: eddm responses: 200: description: Airport information @@ -51,28 +52,56 @@ paths: description: Top latitude schema: type: number - default: 10 + example: 10 - name: bottomlat required: true in: query description: Bottom latitude schema: type: number - default: 15 + example: 15 - name: leftlon required: true in: query description: Left longitude schema: type: number - default: 40 + example: 40 - name: rightlon required: true in: query description: Right longitude schema: type: number - default: 45 + example: 45 + - name: width + required: true + in: query + description: Width in pixels + schema: + type: number + example: 256 + - name: height + required: true + in: query + description: Height in pixels + schema: + type: number + example: 256 + - name: quality + required: true + in: query + description: Image quality + schema: + type: number + example: 80 + - name: format + required: true + in: query + description: Image format + schema: + type: string + enum: [png, jpg] responses: 200: description: Resulting map image From 5539560831624c4986b3ad9d51bf087bc4ac137e Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Thu, 15 Jul 2021 12:33:05 +0200 Subject: [PATCH 04/29] Remove copyright note from marble output - Make copyright note painting setable via MapPaintWidget::setPaintCopyright --- src/mapgui/mappaintwidget.h | 13 +++++++++++++ src/mappainter/mappainter.h | 1 + src/mappainter/mappaintertop.cpp | 2 +- src/mappainter/mappaintlayer.cpp | 1 + src/webapi/mapactionscontroller.cpp | 3 +++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/mapgui/mappaintwidget.h b/src/mapgui/mappaintwidget.h index bf801ee57..d43b08969 100644 --- a/src/mapgui/mappaintwidget.h +++ b/src/mapgui/mappaintwidget.h @@ -308,6 +308,16 @@ class MapPaintWidget : noNavPaint = value; } + bool isPaintCopyright() const + { + return paintCopyright; + } + + void setPaintCopyright(bool value) + { + paintCopyright = value; + } + ApronGeometryCache *getApronGeometryCache(); /* true if real map display widget - false if hidden for online services or other applications */ @@ -463,6 +473,9 @@ class MapPaintWidget : /* Dummy paint cycle without any navigation stuff. Just used to initialize Marble */ bool noNavPaint = false; + /* Paint copyright note into image */ + bool paintCopyright = true; + /* Index of the theme combo box in the toolbar */ map::MapThemeComboIndex currentThemeIndex = map::INVALID_THEME; diff --git a/src/mappainter/mappainter.h b/src/mappainter/mappainter.h index 7289ad139..c333d8100 100644 --- a/src/mappainter/mappainter.h +++ b/src/mappainter/mappainter.h @@ -100,6 +100,7 @@ struct PaintContext opts2::Flags2 flags2; map::MapWeatherSource weatherSource; bool visibleWidget; + bool paintCopyright = true; /* Text sizes and line thickness in percent / 100 */ float textSizeAircraftAi = 1.f; diff --git a/src/mappainter/mappaintertop.cpp b/src/mappainter/mappaintertop.cpp index e96c2e671..21c6bf0ee 100644 --- a/src/mappainter/mappaintertop.cpp +++ b/src/mappainter/mappaintertop.cpp @@ -148,7 +148,7 @@ void MapPainterTop::render() void MapPainterTop::paintCopyright() { QString mapCopyright = NavApp::getMapCopyright(); - if(!mapCopyright.isEmpty()) + if(!mapCopyright.isEmpty() && context->paintCopyright) { Marble::GeoPainter *painter = context->painter; atools::util::PainterContextSaver saver(painter); diff --git a/src/mappainter/mappaintlayer.cpp b/src/mappainter/mappaintlayer.cpp index 97af84f5a..4241d122d 100644 --- a/src/mappainter/mappaintlayer.cpp +++ b/src/mappainter/mappaintlayer.cpp @@ -530,6 +530,7 @@ bool MapPaintLayer::render(GeoPainter *painter, ViewportParams *viewport, const context.userPointTypeUnknown = NavApp::getUserdataController()->isSelectedUnknownType(); context.zoomDistanceMeter = static_cast(mapWidget->distance() * 1000.); context.darkMap = mapWidget->isDarkMap(); + context.paintCopyright = mapWidget->isPaintCopyright(); // Copy default font context.defaultFont = painter->font(); diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index c76282079..3ae3ec80b 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -248,6 +248,9 @@ MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo mapPaintWidget->showRectStreamlined(rect); + // Disable copyright note + mapPaintWidget->setPaintCopyright(false); + MapPixmap mapPixmap; // No distance requested. Therefore requested is equal to actual From c6fbabea79b6dfcf844c99f39d8fed90f964bd67 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Fri, 16 Jul 2021 16:14:59 +0200 Subject: [PATCH 05/29] Disable dynamic/live features --- src/webapi/mapactionscontroller.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index 3ae3ec80b..44609c493 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -248,6 +248,10 @@ MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo mapPaintWidget->showRectStreamlined(rect); + // Disable dynamic/live features + mapPaintWidget->setShowMapFeatures(map::AIRCRAFT_ALL,false); + mapPaintWidget->setShowMapFeatures(map::AIRCRAFT_TRACK,false); + // Disable copyright note mapPaintWidget->setPaintCopyright(false); From 155b7cbdd83462d76f9080caf85f177717c61154 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Thu, 30 Sep 2021 20:53:04 +0200 Subject: [PATCH 06/29] Add constrainDistance flag to showRectStreamlined - Enable small distance Rect requests (closer zoom) - https://github.com/albar965/littlenavmap/issues/784#issuecomment-931150753 --- src/mapgui/mappaintwidget.cpp | 10 ++++++---- src/mapgui/mappaintwidget.h | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/mapgui/mappaintwidget.cpp b/src/mapgui/mappaintwidget.cpp index 0f27e856f..10361ceba 100644 --- a/src/mapgui/mappaintwidget.cpp +++ b/src/mapgui/mappaintwidget.cpp @@ -763,7 +763,7 @@ void MapPaintWidget::showPosInternal(const atools::geo::Pos& pos, float distance setDistanceToMap(distanceKm, allowAdjust); } -void MapPaintWidget::showRectStreamlined(const atools::geo::Rect& rect) +void MapPaintWidget::showRectStreamlined(const atools::geo::Rect& rect, bool constrainDistance) { if(rect.isPoint(POS_IS_POINT_EPSILON)) showPosNotAdjusted(rect.getTopLeft(), 0.f); @@ -783,10 +783,12 @@ void MapPaintWidget::showRectStreamlined(const atools::geo::Rect& rect) // Center on rectangle centerRectOnMap(rect); - float distanceKm = atools::geo::nmToKm(Unit::rev(OptionData::instance().getMapZoomShowMenu(), Unit::distNmF)); + if(constrainDistance){ + float distanceKm = atools::geo::nmToKm(Unit::rev(OptionData::instance().getMapZoomShowMenu(), Unit::distNmF)); - if(distance() < distanceKm) - setDistanceToMap(distanceKm); + if(distance() < distanceKm) + setDistanceToMap(distanceKm); + } } } diff --git a/src/mapgui/mappaintwidget.h b/src/mapgui/mappaintwidget.h index d43b08969..afce00277 100644 --- a/src/mapgui/mappaintwidget.h +++ b/src/mapgui/mappaintwidget.h @@ -80,8 +80,9 @@ class MapPaintWidget : /* Show the bounding rectangle on the map */ void showRect(const atools::geo::Rect& rect, bool doubleClick); - /* streamlined for webmapcontroller from showRect(rect, false) */ - void showRectStreamlined(const atools::geo::Rect& rect); + /* streamlined for webmapcontroller from showRect(rect, false) + * constrainDistance determines whether map distance should be constrained by OptionData values */ + void showRectStreamlined(const atools::geo::Rect& rect, bool constrainDistance = true); /* Show user simulator aircraft. state is tool button state */ void showAircraft(bool centerAircraftChecked); From 3d916111a7184ad07c7a69020228783f924b47eb Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Mon, 4 Oct 2021 16:09:24 +0200 Subject: [PATCH 07/29] Implement basic map features retrieval (draft) - Implement airports restrieval by rect - Implement /map/features route - Fetches feature results from in-app map cache (wrong) - Extend info builders - Complement API contract Core changes: - Expose MapPaintWidgets MapPaintLayer via getMapPaintLayer() - Extend MapQuery by getAirportsByRect(...) --- src/common/abstractinfobuilder.cpp | 6 +++ src/common/abstractinfobuilder.h | 9 ++++ src/common/infobuildertypes.h | 7 +++ src/common/jsoninfobuilder.cpp | 41 +++++++++++++++ src/common/jsoninfobuilder.h | 1 + src/mapgui/mappaintwidget.h | 4 ++ src/query/mapquery.cpp | 27 ++++++++++ src/query/mapquery.h | 3 ++ src/webapi/mapactionscontroller.cpp | 34 +++++++++++- src/webapi/mapactionscontroller.h | 4 ++ web/webapi.yaml | 81 ++++++++++++++++++++++++++++- 11 files changed, 214 insertions(+), 3 deletions(-) diff --git a/src/common/abstractinfobuilder.cpp b/src/common/abstractinfobuilder.cpp index b79145383..9c648934b 100644 --- a/src/common/abstractinfobuilder.cpp +++ b/src/common/abstractinfobuilder.cpp @@ -60,6 +60,12 @@ QByteArray AbstractInfoBuilder::uiinfo(UiInfoData uiInfoData) const return "not implemented"; } +QByteArray AbstractInfoBuilder::features(MapFeaturesData mapFeaturesData) const +{ + Q_UNUSED(mapFeaturesData); + return "not implemented"; +} + QString AbstractInfoBuilder::getHeadingsStringByMagVar(float heading, float magvar) const { diff --git a/src/common/abstractinfobuilder.h b/src/common/abstractinfobuilder.h index 54482610c..9ae8fb024 100644 --- a/src/common/abstractinfobuilder.h +++ b/src/common/abstractinfobuilder.h @@ -25,6 +25,7 @@ namespace InfoBuilderTypes { class AirportInfoData; class SimConnectInfoData; class UiInfoData; + class MapFeaturesData; } namespace atools { namespace sql { @@ -39,6 +40,7 @@ using atools::geo::Pos; using InfoBuilderTypes::AirportInfoData; using InfoBuilderTypes::SimConnectInfoData; using InfoBuilderTypes::UiInfoData; +using InfoBuilderTypes::MapFeaturesData; /** * Generic interface for LNM-specific views. @@ -68,6 +70,13 @@ class AbstractInfoBuilder : public QObject */ virtual QByteArray airport(AirportInfoData airportInfoData) const; + /** + * Creates a description for the provided airport list. + * + * @param airportInfoData + */ + virtual QByteArray features(MapFeaturesData mapFeaturesData) const; + /** * Creates a description for the provided simconnect data. * diff --git a/src/common/infobuildertypes.h b/src/common/infobuildertypes.h index 0fe2d92e1..a8e37ac63 100644 --- a/src/common/infobuildertypes.h +++ b/src/common/infobuildertypes.h @@ -84,6 +84,13 @@ namespace InfoBuilderTypes { const qreal distanceWeb; }; + /** + * @brief Data container for map features data + */ + struct MapFeaturesData{ + const QList airports; + }; + } #endif // INFOBUILDERTYPES_H diff --git a/src/common/jsoninfobuilder.cpp b/src/common/jsoninfobuilder.cpp index 9411a7153..76dc774d5 100644 --- a/src/common/jsoninfobuilder.cpp +++ b/src/common/jsoninfobuilder.cpp @@ -331,3 +331,44 @@ QByteArray JsonInfoBuilder::uiinfo(UiInfoData uiInfoData) const return json.dump().data(); } +QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const +{ + + MapFeaturesData data = mapFeaturesData; + + JSON json; + + json = { + { "airports", JSON::object() }, + }; + + json["airports"].push_back({ "count", data.airports.count() }); + json["airports"].push_back({ "result", JSON::array() }); + + + + for(int i = 0; i < data.airports.count(); ++i){ + + map::MapAirport airport = data.airports[i]; + + json["airports"]["result"][i]["ident"] = qUtf8Printable(airport.ident); + json["airports"]["result"][i]["name"] = qUtf8Printable(airport.name); + json["airports"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(airport.position)); + json["airports"]["result"][i]["elevation"] = airport.getPosition().getAltitude(); + +// JSON airportJson; + +// airportJson = { +// { "ident", qUtf8Printable(airport.ident) }, +// { "name", qUtf8Printable(airport.name)}, +// { "position", coordinatesToJSON(getCoordinates(airport.position))}, +// { "elevation", airport.getPosition().getAltitude() }, +// }; + +// json["airports"]["result"].push_back(airportJson); + } + + return json.dump().data(); + +} + diff --git a/src/common/jsoninfobuilder.h b/src/common/jsoninfobuilder.h index 5b9a4ca60..6f432232f 100644 --- a/src/common/jsoninfobuilder.h +++ b/src/common/jsoninfobuilder.h @@ -41,6 +41,7 @@ class JsonInfoBuilder : public AbstractInfoBuilder QByteArray airport(AirportInfoData airportInfoData) const override; QByteArray siminfo(SimConnectInfoData simConnectInfoData) const override; QByteArray uiinfo(UiInfoData uiInfoData) const override; + QByteArray features(MapFeaturesData mapFeaturesData) const override; private: JSON coordinatesToJSON(QMap map) const; diff --git a/src/mapgui/mappaintwidget.h b/src/mapgui/mappaintwidget.h index afce00277..5a74cf0f2 100644 --- a/src/mapgui/mappaintwidget.h +++ b/src/mapgui/mappaintwidget.h @@ -343,6 +343,10 @@ class MapPaintWidget : return screenIndex; } + MapPaintLayer *getMapPaintLayer(){ + return paintLayer; + } + /* Saved bounding box from last zoom or scroll operation. Needed to detect view changes. */ const Marble::GeoDataLatLonBox& getCurrentViewBoundingBox() const; diff --git a/src/query/mapquery.cpp b/src/query/mapquery.cpp index 5fc09f916..8bf27dd5b 100644 --- a/src/query/mapquery.cpp +++ b/src/query/mapquery.cpp @@ -699,6 +699,33 @@ const QList *MapQuery::getAirports(const Marble::GeoDataLatLonB return nullptr; } +const QList *MapQuery::getAirportsByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, bool lazy, map::MapTypes types, + bool& overflow) +{ + + const GeoDataLatLonBox latLonBox= GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest()); + + qWarning() << Q_FUNC_INFO << latLonBox.south() << latLonBox.north()<< latLonBox.east()<< latLonBox.west(); + // Get flags for running separate queries for add-on and normal airports + bool addon = types.testFlag(map::AIRPORT_ADDON); + bool normal = types & (map::AIRPORT_HARD | map::AIRPORT_SOFT | map::AIRPORT_EMPTY); + +// airportCache.updateCache(latLonBox, mapLayer, queryRectInflationFactor, queryRectInflationIncrement, lazy, +// [ = ](const MapLayer *curLayer, const MapLayer *newLayer) -> bool +// { +// return curLayer->hasSameQueryParametersAirport(newLayer) && +// // Invalidate cache if settings differ +// airportCacheAddonFlag == addon && airportCacheNormalFlag == normal; +// }); + + airportCacheAddonFlag = addon; + airportCacheNormalFlag = normal; + + + return fetchAirports(latLonBox, airportByRectQuery, lazy, false /* overview */, addon, normal, overflow); + +} + const QList *MapQuery::getVors(const GeoDataLatLonBox& rect, const MapLayer *mapLayer, bool lazy, bool& overflow) { diff --git a/src/query/mapquery.h b/src/query/mapquery.h index 8c1f447ac..464af1e23 100644 --- a/src/query/mapquery.h +++ b/src/query/mapquery.h @@ -159,6 +159,9 @@ class MapQuery const QList *getAirports(const Marble::GeoDataLatLonBox& rect, const MapLayer *mapLayer, bool lazy, map::MapTypes types, bool& overflow); + const QList *getAirportsByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, bool lazy, map::MapTypes types, + bool& overflow); + /* Similar to getAirports */ const QList *getVors(const Marble::GeoDataLatLonBox& rect, const MapLayer *mapLayer, bool lazy, bool& overflow); diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index 44609c493..974f7c69c 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -17,10 +17,14 @@ #include "mapactionscontroller.h" #include "abstractlnmactionscontroller.h" +#include "common/infobuildertypes.h" +#include "common/abstractinfobuilder.h" #include +#include "query/mapquery.h" #include "mapgui/mappaintwidget.h" +#include "mappainter/mappaintlayer.h" #include "mapgui/mapwidget.h" #include "navapp.h" @@ -28,6 +32,8 @@ #include #include +using InfoBuilderTypes::MapFeaturesData; + MapActionsController::MapActionsController(QObject *parent, bool verboseParam, AbstractInfoBuilder* infoBuilder) : AbstractLnmActionsController(parent, verboseParam, infoBuilder), parentWidget((QWidget *)parent) // WARNING: Uncertain cast (QWidget *) QObject { @@ -82,6 +88,32 @@ WebApiResponse MapActionsController::imageAction(WebApiRequest request){ return response; } + +WebApiResponse MapActionsController::featuresAction(WebApiRequest request){ + + WebApiResponse response = getResponse(); + + atools::geo::Rect rect( + request.parameters.value("leftlon").toFloat(), + request.parameters.value("toplat").toFloat(), + request.parameters.value("rightlon").toFloat(), + request.parameters.value("bottomlat").toFloat() + ); + + bool overflow = false; + + const QList airports = *getMapQuery()->getAirportsByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,map::NONE,overflow); + + MapFeaturesData data = { + airports + }; + + response.body = infoBuilder->features(data); + + return response; + +} + MapActionsController::~MapActionsController() { qDebug() << Q_FUNC_INFO; @@ -246,7 +278,7 @@ MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo // Do not center world rectangle when resizing mapPaintWidget->setKeepWorldRect(false); - mapPaintWidget->showRectStreamlined(rect); + mapPaintWidget->showRectStreamlined(rect, false); // Disable dynamic/live features mapPaintWidget->setShowMapFeatures(map::AIRCRAFT_ALL,false); diff --git a/src/webapi/mapactionscontroller.h b/src/webapi/mapactionscontroller.h index 12fd782be..50aed0041 100644 --- a/src/webapi/mapactionscontroller.h +++ b/src/webapi/mapactionscontroller.h @@ -41,6 +41,10 @@ class MapActionsController : * @brief get map image */ Q_INVOKABLE WebApiResponse imageAction(WebApiRequest request); + /** + * @brief get map features + */ + Q_INVOKABLE WebApiResponse featuresAction(WebApiRequest request); explicit MapActionsController(QWidget *parent, bool verboseParam); virtual ~MapActionsController() override; diff --git a/web/webapi.yaml b/web/webapi.yaml index 79523f7ae..e6608a857 100644 --- a/web/webapi.yaml +++ b/web/webapi.yaml @@ -113,7 +113,49 @@ paths: image/png: schema: type: string - format: binary + format: binary + /map/features: + get: + tags: + - Map + summary: Get features by lat/lon rectangle + operationId: mapFeaturesAction + parameters: + - name: toplat + required: true + in: query + description: Top latitude + schema: + type: number + example: 10 + - name: bottomlat + required: true + in: query + description: Bottom latitude + schema: + type: number + example: 15 + - name: leftlon + required: true + in: query + description: Left longitude + schema: + type: number + example: 40 + - name: rightlon + required: true + in: query + description: Right longitude + schema: + type: number + example: 45 + responses: + 200: + description: map feature list + content: + application/json: + schema: + $ref: '#/components/schemas/MapFeaturesResponse' /sim/info: get: tags: @@ -436,4 +478,39 @@ components: distance_web: description: the distance value of the map inside LNM Web UI in km type: number - example: 6.814605113425086 \ No newline at end of file + example: 6.814605113425086 + MapFeaturesResponse: + type: object + description: List of map features + properties: + airports: + description: the zoom value of the map inside LNM UI + type: object + properties: + count: + type: number + example: 361 + result: + type: array + items: + type: object + $ref: '#/components/schemas/MapAirportFeature' + MapAirportFeature: + type: object + description: Single airport list entry + properties: + elevation: + description: the airports elevation in ft + type: number + example: 1352 + ident: + description: The airports ident (ICAO) + type: string + example: "LOIH" + name: + description: The airpotrts name + type: string + example: "Dornbirn" + position: + description: The airports geographical position + $ref: '#/components/schemas/Coordinates' From 09608110aafd3b5042fbd47fc833adf337d4b35f Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Tue, 5 Oct 2021 12:16:02 +0200 Subject: [PATCH 08/29] Don't constrain map distance on imageAction --- src/webapi/mapactionscontroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index 44609c493..d8ea0ffef 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -246,7 +246,7 @@ MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo // Do not center world rectangle when resizing mapPaintWidget->setKeepWorldRect(false); - mapPaintWidget->showRectStreamlined(rect); + mapPaintWidget->showRectStreamlined(rect, false); // Disable dynamic/live features mapPaintWidget->setShowMapFeatures(map::AIRCRAFT_ALL,false); From eedb5ca1d67f209284b7bec96a034ab808665610 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Tue, 5 Oct 2021 15:11:22 +0200 Subject: [PATCH 09/29] Add image attributions to image response and success code --- src/webapi/mapactionscontroller.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index d8ea0ffef..a77522bed 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -77,6 +77,10 @@ WebApiResponse MapActionsController::imageAction(WebApiRequest request){ // Should never happen qWarning() << Q_FUNC_INFO << "invalid format"; + // Add copyright/attributions to header + response.headers.insert("Image-Attributions", mapPaintWidget->getMapCopyright().toUtf8()); + + response.status = 200; response.body = bytes; } return response; From 6b63860f9be0f779bbc702e4c3fe8cfadfd786f6 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Tue, 5 Oct 2021 15:26:17 +0200 Subject: [PATCH 10/29] Add simple OL implementation - Insert build output of https://github.com/KOKAProduktion/littlenavmap-openlayers/pull/1 at https://github.com/KOKAProduktion/littlenavmap-openlayers/commit/94fa623ec74e30597ae6a64599d98981e9045f38 --- web/ol/index.bundle.js | 1 + web/ol/index.html | 1 + 2 files changed, 2 insertions(+) create mode 100644 web/ol/index.bundle.js create mode 100644 web/ol/index.html diff --git a/web/ol/index.bundle.js b/web/ol/index.bundle.js new file mode 100644 index 000000000..b0c0bbde4 --- /dev/null +++ b/web/ol/index.bundle.js @@ -0,0 +1 @@ +(()=>{var t={788:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(645),o=i.n(n)()((function(t){return t[1]}));o.push([t.id,'.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 2px solid blue;\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: rgba(0,60,136,0.3);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n.ol-scale-line-inner {\n border: 1px solid #eee;\n border-top: none;\n color: #eee;\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: #000000;\n float: right;\n z-Index: 10;\n}\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 12px;\n z-Index: 11;\n color: #000000;\n text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;\n}\n.ol-scale-text {\n position: absolute;\n font-size: 14px;\n text-align: center;\n bottom: 25px;\n color: #000000;\n text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;\n}\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-Index: 9;\n box-sizing: border-box;\n border: 1px solid black;\n}\n\n.ol-unsupported {\n display: none;\n}\n.ol-viewport, .ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n}\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n.ol-control {\n position: absolute;\n background-color: rgba(255,255,255,0.4);\n border-radius: 4px;\n padding: 2px;\n}\n.ol-control:hover {\n background-color: rgba(255,255,255,0.6);\n}\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: white;\n font-size: 1.14em;\n font-weight: bold;\n text-decoration: none;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: rgba(0,60,136,0.5);\n border: none;\n border-radius: 2px;\n}\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n.ol-compass {\n display: block;\n font-weight: normal;\n font-size: 1.2em;\n will-change: transform;\n}\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n background-color: rgba(0,60,136,0.7);\n}\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 0 .5em;\n color: #000;\n text-shadow: 0 0 2px #fff;\n}\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n.ol-attribution ul, .ol-attribution button {\n display: inline-block;\n}\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n.ol-attribution:not(.ol-collapsed) {\n background: rgba(255,255,255,0.8);\n}\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: inline-block;\n}\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid #7b98bc;\n height: 150px;\n margin: 2px;\n width: 150px;\n}\n.ol-overviewmap:not(.ol-collapsed) button{\n bottom: 1px;\n left: 2px;\n position: absolute;\n}\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n.ol-overviewmap:not(.ol-collapsed) {\n background: rgba(255,255,255,0.8);\n}\n.ol-overviewmap-box {\n border: 2px dotted rgba(0,60,136,0.7);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n',""]);const r=o},424:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(645),o=i.n(n)()((function(t){return t[1]}));o.push([t.id," #debug {\n display: none;\n position: absolute;\n width: 100px;\n height: 100px;\n left: 0;\n top: 0;\n background-color: rgba(255, 0, 0, 0.5);\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n }\n\n .map {\n width: 100%;\n height: 100%;\n }\n\n .ol-control button img {\n width: 25px;\n height: 25px;\n }\n\n .follow-control {\n top: 10px;\n right: .5em;\n }\n\n .follow-control.on {\n background-color: #639684;\n }\n\n .follow-control.off {}\n\n .refresh-control {\n top: 60px;\n right: .5em;\n }",""]);const r=o},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(n)for(var r=0;ro;){if(r-o>600){var a=r-o+1,l=n-o+1,h=Math.log(a),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(a-u)/a)*(l-a/2<0?-1:1);t(i,n,Math.max(o,Math.floor(n-l*u/a+c)),Math.min(r,Math.floor(n+(a-l)*u/a+c)),s)}var p=i[n],f=o,d=r;for(e(i,o,n),s(i[r],p)>0&&e(i,o,r);f0;)d--}0===s(i[o],p)?e(i,o,d):e(i,++d,r),d<=n&&(o=d+1),n<=d&&(r=d-1)}}(t,n,o||0,r||t.length-1,s||i)}function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,i,n,o,r){for(var s=[i,n];s.length;)if(!((n=s.pop())-(i=s.pop())<=o)){var a=i+Math.ceil((n-i)/o/2)*o;t(e,a,i,n,r),s.push(i,a,a,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,i=[];if(!f(t,e))return i;for(var n=this.toBBox,o=[];e;){for(var r=0;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)},n.prototype._split=function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),a=d(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},n.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,i){for(var n,o,r,a,l,h,c,p=1/0,f=1/0,d=e;d<=i-e;d++){var g=s(t,0,d,this.toBBox),_=s(t,d,i,this.toBBox),v=(o=g,r=_,void 0,void 0,void 0,void 0,a=Math.max(o.minX,r.minX),l=Math.max(o.minY,r.minY),h=Math.min(o.maxX,r.maxX),c=Math.min(o.maxY,r.maxY),Math.max(0,h-a)*Math.max(0,c-l)),y=u(g)+u(_);v=e;f--){var d=t.children[f];a(l,t.leaf?o(d):d),h+=c(l)}return h},n.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)a(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():r(t[e],this.toBBox)},n}()},379:(t,e,i)=>{"use strict";var n,o=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),r=[];function s(t){for(var e=-1,i=0;i{t.exports="data:image/svg+xml,%3csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' version='1.0' width='128' height='128' id='svg2' sodipodi:version='0.32' inkscape:version='0.91 r13725' sodipodi:docname='aircraft_small_user.svg' inkscape:output_extension='org.inkscape.output.svg.inkscape'%3e %3cmetadata id='metadata16'%3e %3crdf:RDF%3e %3ccc:Work rdf:about=''%3e %3cdc:format%3eimage/svg+xml%3c/dc:format%3e %3cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/%3e %3cdc:title/%3e %3c/cc:Work%3e %3c/rdf:RDF%3e %3c/metadata%3e %3csodipodi:namedview inkscape:window-height='735' inkscape:window-width='1073' inkscape:pageshadow='2' inkscape:pageopacity='0.0' guidetolerance='10.0' gridtolerance='10.0' objecttolerance='10.0' borderopacity='1.0' bordercolor='%23666666' pagecolor='%23ffffff' id='base' showgrid='false' inkscape:zoom='2.8875' inkscape:cx='1.0476778' inkscape:cy='65.135002' inkscape:window-x='515' inkscape:window-y='154' inkscape:current-layer='svg2' inkscape:window-maximized='0'/%3e %3cdefs id='defs4'%3e %3cinkscape:perspective sodipodi:type='inkscape:persp3d' inkscape:vp_x='0 : 10 : 1' inkscape:vp_y='0 : 1000 : 0' inkscape:vp_z='20 : 10 : 1' inkscape:persp3d-origin='10 : 6.6666667 : 1' id='perspective18'/%3e %3cfilter id='filter'%3e %3cfeGaussianBlur stdDeviation='0.4858' id='feGaussianBlur7'/%3e %3c/filter%3e %3c/defs%3e %3cpath style='fill:%23ffff00;fill-opacity:1;stroke:%23000000;stroke-width:5.2827301;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1' id='path13' d='m 64.321061,9.894986 c -3.403927,4.904341 -3.31629,4.79328 -4.848773,6.787338 -0.930048,1.631215 -2.329857,10.573931 -2.296198,14.687238 0.02089,2.552583 -0.165767,4.084366 -0.535967,4.397075 -0.312521,0.264032 -1.955246,1.083861 -3.645501,1.815777 -2.982352,1.291403 -3.732027,1.373484 -25.370713,2.81941 -17.135838,1.145053 -22.5286969,1.658918 -23.3310019,2.216614 -2.2245336,1.546326 -2.3121808,5.07125 -0.2901467,11.719857 l 1.043267,3.430023 52.8477186,8.884048 0.692335,29.494054 0.01971,6.40165 c -0.64265,0.19749 -2.132128,0.0181 -6.776943,0.4953 -4.644847,0.47728 -8.706195,1.10109 -9.025144,1.39052 -1.282344,1.16362 -0.192953,10.22934 1.22744,10.21594 2.24188,-0.0211 10.540611,1.09775 10.978887,1.4781 0.314502,0.2698 7.444817,1.235 10.190318,1.20909 2.745474,-0.0259 9.860468,-1.12385 10.168921,-1.40131 0.43221,-0.38854 8.711114,-1.66393 10.953002,-1.68511 1.420428,-0.0134 2.361236,-9.09834 1.060089,-10.23754 -0.325507,-0.28141 -4.394571,-0.8304 -9.046518,-1.21992 -4.651923,-0.38948 -6.789901,-0.12812 -7.435885,-0.31367 l -0.809377,-0.15912 1.585705,-35.798139 52.694174,-9.880328 0.98695,-3.449201 c 1.91291,-6.685769 1.7676,-10.208475 -0.48192,-11.712547 -0.8113,-0.542434 -6.21172,-0.954425 -23.36365,-1.775805 C 79.85281,38.667127 79.101952,38.599221 76.098902,37.364315 74.396938,36.664429 72.740928,35.875571 72.424256,35.61761 72.048971,35.311973 71.837318,33.783955 71.816418,31.231364 71.782757,27.118061 70.236785,18.203162 69.280184,16.589721 67.782945,14.906516 67.646504,14.859152 64.320983,9.895079 Z' inkscape:connector-curvature='0' sodipodi:nodetypes='ccscssscccccccscccscsccccccsscsccc'/%3e %3c/svg%3e"},441:t=>{t.exports="data:image/svg+xml,%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg width='100%25' height='100%25' viewBox='0 0 64 64' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cpath d='M52,36c0,11 -9,20 -20,20c-11,0 -20,-9 -20,-20c0,-9.7 6.9,-17.7 16,-19.6l0,7.6l14,-12l-14,-12l0,8.3c-13.6,1.9 -24,13.6 -24,27.7c0,15.4 12.6,28 28,28c15.4,0 28,-12.6 28,-28l-8,0Z' style='fill:%23fff;fill-rule:nonzero;'/%3e%3c/svg%3e"}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={id:n,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(379),e=i.n(t),n=i(788);e()(n.Z,{insert:"head",singleton:!1}),n.Z.locals;var o=i(424);e()(o.Z,{insert:"head",singleton:!1}),o.Z.locals;var r={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},s={};s[r.DEGREES]=2*Math.PI*6370997/360,s[r.FEET]=.3048,s[r.METERS]=1,s[r.USFEET]=1200/3937;const a=r,l=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||s[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function h(t,e,i){return Math.min(Math.max(t,e),i)}var u="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},c="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function p(t,e,i,n,o,r){var s=o-i,a=r-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=o,n=r):l>0&&(i+=s*l,n+=a*l)}return f(t,e,i,n)}function f(t,e,i,n){var o=i-t,r=n-e;return o*o+r*r}function d(t){return t*Math.PI/180}function g(t,e){var i=t%e;return i*e<0?i+e:i}function _(t,e,i){return t+i*(e-t)}var v,y=(v=function(t,e){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),m=6378137,x=Math.PI*m,w=[-x,-x,x,x],b=[-180,-85,180,85],S=m*Math.log(Math.tan(Math.PI/2)),C=function(t){function e(e){return t.call(this,{code:e,units:a.METERS,extent:w,global:!0,worldExtent:b,getPointResolution:function(t,e){return t/u(e[1]/m)}})||this}return y(e,t),e}(l),E=[new C("EPSG:3857"),new C("EPSG:102100"),new C("EPSG:102113"),new C("EPSG:900913"),new C("http://www.opengis.net/gml/srs/epsg.xml#3857")];var T=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),O=[-180,-90,180,90],R=6378137*Math.PI/180,I=function(t){function e(e,i){return t.call(this,{code:e,units:a.DEGREES,extent:O,axisOrientation:i,global:!0,metersPerUnit:R,worldExtent:O})||this}return T(e,t),e}(l),P=[new I("CRS:84"),new I("EPSG:4326","neu"),new I("urn:ogc:def:crs:OGC:1.3:CRS84"),new I("urn:ogc:def:crs:OGC:2:84"),new I("http://www.opengis.net/gml/srs/epsg.xml#4326","neu")],F={},M={};function L(t,e,i){var n=t.getCode(),o=e.getCode();n in M||(M[n]={}),M[n][o]=i}const A="top-left";function k(){return function(){throw new Error("Unimplemented abstract method.")}()}var D=0;function j(t){return t.ol_uid||(t.ol_uid=String(++D))}var z=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const G=function(t){function e(e){var i=this,n="Assertion failed. See https://openlayers.org/en/v"+"6.5.0".split("-")[0]+"/doc/errors/#"+e+" for details.";return(i=t.call(this,n)||this).code=e,i.name="AssertionError",i.message=n,i}return z(e,t),e}(Error);function W(t,e){if(!t)throw new G(e)}function X(t){for(var e=[1/0,1/0,-1/0,-1/0],i=0,n=t.length;io&&(l|=4),ar&&(l|=2),0===l&&(l=1),l}function H(t,e,i,n,o){return o?(o[0]=t,o[1]=e,o[2]=i,o[3]=n,o):[t,e,i,n]}function q(t){return H(1/0,1/0,-1/0,-1/0,t)}function J(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Q(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function $(t,e,i,n,o){for(;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function dt(t){return t[2]180)&&(i[0]=g(n+180,360)-180),i}function Et(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||Tt(t,e)===_t)&&i}function Tt(t,e){var i=function(t,e){var i;return t in M&&e in M[t]&&(i=M[t][e]),i}(t.getCode(),e.getCode());return i||(i=vt),i}function Ot(t,e){return Tt(mt(t),mt(e))}function Rt(t,e,i){return Ot(e,i)(t,void 0,t.length)}var It,Pt,Ft,Mt=null;function Lt(){return Mt}function At(t,e){return t}function kt(t,e){return t}function Dt(t,e){return t}function jt(t,e){return t}wt(E),wt(P),It=E,Pt=function(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;sS?a=S:a<-S&&(a=-S),r[s+1]=a}return r},Ft=function(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;se?1:t0){for(o=1;o=1024){var o=0;for(var r in t)0==(3&o++)&&(delete t[r],--e)}n=function(t){var e,i,n,o,r;if(Qt.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),Jt.exec(t)){var s,a=t.length-1;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),o=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(o=(o<<4)+o)),r=[e,i,n,o/255]}else 0==t.indexOf("rgba(")?ie(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),ie(r)):W(!1,14);return r}(i),t[i]=n,++e}return n}}();function ee(t){return Array.isArray(t)?t:te(t)}function ie(t){return t[0]=h(t[0]+.5|0,0,255),t[1]=h(t[1]+.5|0,0,255),t[2]=h(t[2]+.5|0,0,255),t[3]=h(t[3],0,1),t}function ne(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function oe(t,e,i){return e+":"+t+":"+(i?$t(i):"null")}var re=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var n=oe(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var o=oe(t,e,i);this.cache_[o]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}());const se=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),ae="propertychange";var le="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1,o=arguments.length;n0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=Bt,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(zt),de="change",ge="contextmenu",_e="click",ve="keydown",ye="keypress",me="resize",xe="touchmove",we="wheel";function be(t,e,i,n,o){if(n&&n!==t&&(i=i.bind(n)),o){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function Se(t,e,i,n){return be(t,e,i,n,!0)}function Ce(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),he(t))}var Ee=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Te=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return Ee(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(de)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}const qe=function(t){function e(e){var i=this,n=le({},e);delete n.source,(i=t.call(this,n)||this).mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addEventListener(Fe(Xe),i.handleSourcePropertyChange_);var o=e.source?e.source:null;return i.setSource(o),i}return Ue(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Xe)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Be},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ce(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=be(t,de,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ce(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ce(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=be(t,Ze,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);W(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=be(this,de,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Xe,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Ye);function Je(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function Qe(t,e){var i=Math.cos(e),n=Math.sin(e),o=t[0]*i-t[1]*n,r=t[1]*i+t[0]*n;return t[0]=o,t[1]=r,t}function $e(t,e){if(e.canWrapX()){var i=pt(e.getExtent()),n=function(t,e,i){var n=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]n[2])){var r=i||pt(n);o=Math.floor((t[0]-n[0])/r)}return o}(t,e,i);n&&(t[0]-=n*i)}return t}var ti=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function ei(t,e){re.expire()}const ii=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return ti(e,t),e.prototype.dispatchRenderEvent=function(t,e){k()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Ut(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ht(n,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,r,s,a){var l,h=e.viewState;function u(t,e,i,n){return o.call(r,e,t?i:null,n)}var c=h.projection,p=$e(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var d=pt(c.getExtent());f.push([-d,0],[d,0])}for(var g=e.layerStatesArray,_=g.length,v=[],y=[],m=0;m=0;--x){var w=g[x],b=w.layer;if(b.hasRenderer()&&He(w,h)&&s.call(a,b)){var S=b.getRenderer(),C=b.getSource();if(S&&C){var E=C.getWrapX()?p:t,T=u.bind(null,w.managed);y[0]=E[0]+f[m][0],y[1]=E[1]+f[m][1],l=S.forEachFeatureAtCoordinate(y,e,i,T,v)}if(l)return l}}if(0!==v.length){var O=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*O})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){return k()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,o,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,Zt,this,o,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){k()},e.prototype.scheduleExpireIconCache=function(t){re.canExpireCache()&&t.postRenderFunctions.push(ei)},e}(zt);var ni=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const oi=function(t){function e(e,i,n,o){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=n,r.context=o,r}return ni(e,t),e}(se);var ri="ol-hidden",si="ol-control",ai=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"),li=["style","variant","weight","size","lineHeight","family"],hi=function(t){var e=t.match(ai);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,o=li.length;n=0;--r)n[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,n=0;;++n){var o=i[n],r=e[n];if(!o&&!r)break;o!==r&&(o?r?t.insertBefore(r,o):(t.removeChild(o),--n):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent("postcompose",t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){for(var r=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],h=l.layer;if(h.hasRenderer()&&He(l,r)&&o(h)){var u=h.getRenderer().getDataAtPixel(t,e,i);if(u){var c=n(h,u);if(c)return c}}}},e}(ii),Yi="add",Zi="remove";var Ki=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Bi="length",Vi=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.element=i,o.index=n,o}return Ki(e,t),e}(se);const Ui=function(t){function e(e,i){var n=t.call(this)||this,o=i||{};if(n.unique_=!!o.unique,n.array_=e||[],n.unique_)for(var r=0,s=n.array_.length;r0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Ce(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(xe,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ce(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ce),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(fe),an="postrender",ln="layergroup",hn="size",un="target",cn="view";var pn=1/0;const fn=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,he(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){W(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=pn&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,o=e[t],r=i[t],s=t;t>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),h=lt;){var s=this.getParentIndex_(e);if(!(n[s]>r))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=o,n[e]=r},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,o=this.elements_,r=this.priorities_,s=0,a=o.length;for(e=0;e0;)n=(i=this.dequeue()[0]).getKey(),0!==i.getState()||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++o,i.load())},e}(fn),_n="Point",vn="LineString",yn="Polygon",mn="MultiPoint",xn="MultiLineString",wn="MultiPolygon",bn="GeometryCollection",Sn="Circle",Cn="center",En="resolution",Tn="rotation";function On(t,e,i){return function(n,o,r,s,a){if(n){var l=e?0:r[0]*o,u=e?0:r[1]*o,c=a?a[0]:0,p=a?a[1]:0,f=t[0]+l/2+c,d=t[2]-l/2+c,g=t[1]+u/2+p,_=t[3]-u/2+p;f>d&&(d=f=(d+f)/2),g>_&&(_=g=(_+g)/2);var v=h(n[0],f,d),y=h(n[1],g,_),m=30*o;return s&&i&&(v+=-m*Math.log(1+Math.max(0,f-n[0])/m)+m*Math.log(1+Math.max(0,n[0]-d)/m),y+=-m*Math.log(1+Math.max(0,g-n[1])/m)+m*Math.log(1+Math.max(0,n[1]-_)/m)),[v,y]}}}function Rn(t){return t}function In(t,e,i,n){var o=pt(e)/i[0],r=lt(e)/i[1];return n?Math.min(t,Math.max(o,r)):Math.min(t,Math.min(o,r))}function Pn(t,e,i){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),h(n,i/2,2*e)}function Fn(t,e,i,n,o){return function(r,s,a,l){if(void 0!==r){var u=n?In(t,n,a,o):t;return(void 0===i||i)&&l?Pn(r,u,e):h(r,e,u)}}}function Mn(t){return void 0!==t?0:void 0}function Ln(t){return void 0!==t?t:void 0}function An(t){return Math.pow(t,3)}function kn(t){return 1-An(1-t)}function Dn(t){return 3*t*t-2*t*t*t}function jn(t){return t}const zn="XY",Gn="XYZM";function Wn(t,e,i,n,o,r){for(var s=r||[],a=0,l=e;l1)a=i;else{if(p>0){for(var f=0;fo&&(o=h),r=a,s=l}return o}function qn(t,e,i,n,o,r,s,a,l,h,u){if(e==i)return h;var c,p;if(0===o){if((p=f(s,a,t[e],t[e+1]))0&&g>f)&&(d<0&&_0&&_>d)?(a=c,l=p):(r[s++]=a,r[s++]=l,h=a,u=l,a=c,l=p)}}return r[s++]=a,r[s++]=l,s}function to(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=e;a0;){for(var c=h.pop(),f=h.pop(),d=0,g=t[f],_=t[f+1],v=t[c],y=t[c+1],m=f+n;md&&(u=m,d=x)}d>o&&(l[(u-e)/n]=1,f+nr&&(h-a)*(r-l)-(o-a)*(u-l)>0&&s++:u<=r&&(h-a)*(r-l)-(o-a)*(u-l)<0&&s--,a=h,l=u}return 0!==s}function uo(t,e,i,n,o,r){if(0===i.length)return!1;if(!ho(t,e,i[0],n,o,r))return!1;for(var s=1,a=i.length;s=o[0]&&r[2]<=o[2]||r[1]>=o[1]&&r[3]<=o[3]||function(t,e,i,n,o){for(var r,s=[t[e],t[e+1]],a=[];e+n=s&&g<=l),n||!(4&r)||4&o||(n=(_=f-(p-l)*d)>=a&&_<=h),n||!(8&r)||8&o||(n=(g=p-(f-a)/d)>=s&&g<=l),n||!(16&r)||16&o||(n=(_=f-(p-s)*d)>=a&&_<=h)}return n}(o,t,e)})))}function po(t,e,i,n){for(;e0}function go(t,e,i,n,o){for(var r=void 0!==o&&o,s=0,a=i.length;sx&&uo(t,e,i,n,h=(u+c)/2,d)&&(m=h,x=w),u=c}return isNaN(m)&&(m=o[r]),s?(s.push(m,d,x),s):[m,d,x]}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new ao(this.getFlatInteriorPoint(),"XYM")},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new ro(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],o=0,r=0,s=i.length;rc&&f1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i),!this.isDef()){var n=arguments[i-1];return n.center&&this.setCenterInternal(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&wo(e,!0))}for(var o=Date.now(),r=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,l=[],h=0;h0},e.prototype.getInteracting=function(){return this.hints_[1]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(0,-this.hints_[0]);for(var e=0,i=this.animations_.length;e=0;--i){for(var n=this.animations_[i],o=!0,r=0,s=n.length;r0?l/a.duration:1;h>=1?(a.complete=!0,h=1):o=!1;var u=a.easing(h);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],f=c+u*(a.targetCenter[0]-c),d=p+u*(a.targetCenter[1]-p);this.targetCenter_=[f,d]}if(a.sourceResolution&&a.targetResolution){var _=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){var v=this.getViewportSize_(this.getRotation()),y=this.constraints_.resolution(_,0,v,!0);this.targetCenter_=this.calculateCenterZoom(y,a.anchor)}this.targetResolution_=_,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var m=1===u?g(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){var x=this.constraints_.rotation(m,!0);this.targetCenter_=this.calculateCenterRotate(x,a.anchor)}this.targetRotation_=m}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(o){this.animations_[i]=null,this.setHint(0,-1);var w=n[0].callback;w&&wo(w,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,n,o,r=this.getCenterInternal();return void 0!==r&&(Qe(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),o=e,(n=i)[0]+=+o[0],n[1]+=+o[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenterInternal(),o=this.getResolution();return void 0!==n&&void 0!==o&&(i=[e[0]-t*(e[0]-n[0])/o,e[1]-t*(e[1]-n[1])/o]),i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?At(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Cn)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Dt(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),i=this.getCenterInternal();W(i,1);var n=this.getResolution();W(void 0!==n,2);var o=this.getRotation();return W(void 0!==o,3),at(i,n,o,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(En)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(jt(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSize_(),n=pt(t)/i[0],o=lt(t)/i[1];return Math.max(n,o)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*o)}},e.prototype.getRotation=function(){return this.get(Tn)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/o}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),n=this.getCenterInternal(),o=this.padding;if(o){var r=this.getViewportSizeMinusPadding_();n=So(n,this.getViewportSize_(),[r[0]/2+o[3],r[1]/2+o[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var o=Wt(this.resolutions_,t,1);n=o,e=this.resolutions_[o],i=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=h(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,h(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(W(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))W(!dt(t),25),i=mo(n=jt(t,this.getProjection()));else if(t.getType()===Sn){var n;(i=mo(n=jt(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),rt(n))}else{var o=Lt();i=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(i,e)},e.prototype.fitInternal=function(t,e){var i=e||{},n=i.size;n||(n=this.getViewportSizeMinusPadding_());var o,r=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;o=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;for(var a=t.getFlatCoordinates(),l=this.getRotation(),h=Math.cos(-l),u=Math.sin(-l),c=1/0,p=1/0,f=-1/0,d=-1/0,g=t.getStride(),_=0,v=a.length;_=0;a--){var l=s[a];if(l.getMap()===this&&l.getActive()&&this.getTargetElement()&&(!l.handleEvent(t)||t.propagationStopped))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var o=t.viewHints;if(o[0]||o[1]){var r=!_i&&Date.now()-t.time>8;i=r?0:8,n=r?0:2}}e.getTilesLoading()0&&t[1]>0}(i)&&n&&n.isDef()){var s=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:at(a.center,a.resolution,a.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{}}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),o&&(!this.previousExtent_||!dt(this.previousExtent_)&&!J(r.extent,this.previousExtent_))&&(this.dispatchEvent(new $i("movestart",this,o)),this.previousExtent_=q(this.previousExtent_)),this.previousExtent_&&!r.viewHints[0]&&!r.viewHints[1]&&!J(r.extent,this.previousExtent_)&&(this.dispatchEvent(new $i("moveend",this,r)),Y(r.extent,this.previousExtent_))),this.dispatchEvent(new $i(an,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(ln,t)},e.prototype.setSize=function(t){this.set(hn,t)},e.prototype.setTarget=function(t){this.set(un,t)},e.prototype.setView=function(t){this.set(cn,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(Me);var Ro=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Io=function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return Ro(e,t),e.prototype.disposeInternal=function(){xi(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&xi(this.element);for(var e=0,i=this.listenerKeys.length;e0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Yt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,o=e.length;n0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:kn}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(ri);o||0!==i?o&&0!==i&&this.element.classList.remove(ri):this.element.classList.add(ri)}this.label_.style.transform=n}this.rotation_=i}},e}(Io);var Ao=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ko=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),target:n.target})||this;var o=void 0!==n.className?n.className:"ol-zoom",r=void 0!==n.delta?n.delta:1,s=void 0!==n.zoomInClassName?n.zoomInClassName:o+"-in",a=void 0!==n.zoomOutClassName?n.zoomOutClassName:o+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",h=void 0!==n.zoomOutLabel?n.zoomOutLabel:"−",u=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=u,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(_e,i.handleClick_.bind(i,r),!1);var f=document.createElement("button");f.className=a,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof h?document.createTextNode(h):h),f.addEventListener(_e,i.handleClick_.bind(i,-r),!1);var d=o+" ol-unselectable "+si,g=i.element;return g.className=d,g.appendChild(p),g.appendChild(f),i.duration_=void 0!==n.duration?n.duration:250,i}return Ao(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:kn})):e.setZoom(n)}}},e}(Io),Do="active";var jo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function zo(t,e,i,n){var o=t.getZoom();if(void 0!==o){var r=t.getConstrainedZoom(o+e),s=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==n?n:250,easing:kn})}}const Go=function(t){function e(e){var i=t.call(this)||this;return e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return jo(e,t),e.prototype.getActive=function(){return this.get(Do)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Do,t)},e.prototype.setMap=function(t){this.map_=t},e}(Me);var Wo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Xo=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return Wo(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==nn.DBLCLICK){var i=t.originalEvent,n=t.map,o=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;zo(n.getView(),r,o,this.duration_),i.preventDefault(),e=!0}return!e},e}(Go);var No=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Yo(t){for(var e=t.length,i=0,n=0,o=0;o0}}else if(t.type==nn.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==nn.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===nn.POINTERDOWN||e===nn.POINTERDRAG||e===nn.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==nn.POINTERUP?delete this.trackedPointers_[i]:(t.type==nn.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=ue(this.trackedPointers_)}},e}(Go);function Ko(t){var e=arguments;return function(t){for(var i=!0,n=0,o=e.length;n0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Zo);var nr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const or=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:Kt})||this).condition_=n.condition?n.condition:Bo,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return nr(e,t),e.prototype.handleDragEvent=function(t){if($o(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Mn){var n=e.getSize(),o=t.pixel,r=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=r-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!$o(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!(!$o(t)||!Ho(t)||!this.condition_(t)||(t.map.getView().beginInteraction(),this.lastAngle_=void 0,0))},e}(Zo);var rr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const sr=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return rr(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},e.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_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new yo([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(zt);var ar=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),lr=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.coordinate=i,o.mapBrowserEvent=n,o}return ar(e,t),e}(se);const hr=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.box_=new sr(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:Ho,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return ar(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new lr("boxdrag",t.coordinate,t))},e.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 lr(e?"boxend":"boxcancel",t.coordinate,t)),!1},e.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 lr("boxstart",t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Zo);var ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const cr=function(t){function e(e){var i=this,n=e||{},o=n.condition?n.condition:Jo;return(i=t.call(this,{condition:o,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return ur(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap(),i=e.getView(),n=e.getSize(),o=this.getGeometry().getExtent();if(this.out_){var r=i.calculateExtentInternal(n),s=function(t,e){return function(t,e){for(var i=0,n=e.length;i0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var o=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,o),this.initialVelocity_=Math.sqrt(o*o+r*r)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();var vr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yr="trackpad";const mr=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var o=n.condition?n.condition:Uo;return i.condition_=n.onFocusOnly?Ko(Vo,o):o,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return vr(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==we)return!0;var e,i=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==we&&(e=n.deltaY,ci&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=di),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?yr:"wheel");var r=i.getView();if(this.mode_===yr&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-h(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),zo(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Go);var xr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const wr=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Kt),(i=t.call(this,o)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return xr(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=o-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=o;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Mn){var l=s.getViewport().getBoundingClientRect(),h=Yo(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2&&(t.map.getView().endInteraction(this.duration_),1))},e.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}return!1},e}(Zo);var br=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Sr=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Kt),(i=t.call(this,o)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return br(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,r=i.clientY-n.clientY,s=Math.sqrt(o*o+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var h=a.getViewport().getBoundingClientRect(),u=Yo(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(u),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.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}return!1},e}(Zo);var Cr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Er=function(t){function e(e){return(e=le({},e)).controls||(e.controls=function(t){var e={},i=new Ui;return(void 0===e.zoom||e.zoom)&&i.push(new ko(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Lo(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Fo(e.attributionOptions)),i}()),e.interactions||(e.interactions=function(t){var e={onFocusOnly:!0}||{},i=new Ui,n=new _r(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new or),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Xo({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new ir({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new wr),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Sr({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new fr),i.push(new gr({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new mr({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new cr({duration:e.zoomDuration})),i}()),t.call(this,e)||this}return Cr(e,t),e.prototype.createRenderer=function(){return new Ni(this)},e}(Oo);var Tr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Or=function(t){function e(e,i,n){var o=t.call(this)||this,r=n||{};return o.tileCoord=e,o.state=i,o.interimTile=null,o.hifi=!0,o.key="",o.transition_=void 0===r.transition?250:r.transition,o.transitionStarts_={},o}return Tr(e,t),e.prototype.changed=function(){this.dispatchEvent(de)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(2==t.getState())return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(2==t.getState()){t.interimTile=null;break}1==t.getState()?e=t:0==t.getState()?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(3!==this.state&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){k()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:An(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(fe);var Rr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ir=function(t){function e(e,i,n,o){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=n,r.resolution=i,r.state=o,r}return Rr(e,t),e.prototype.changed=function(){this.dispatchEvent(de)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return k()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){k()},e}(fe);var Pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Fr(t,e,i){var n=t;if(n.src&&_i){var o=n.decode(),r=!0;return o.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var s=[Se(n,"load",e),Se(n,"error",i)];return function(){s.forEach(Ce)}}!function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,n,0)||this;return a.src_=o,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.state=0,a.imageLoadFunction_=s,a}Pr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=lt(this.extent)/this.image_.height),this.state=2,this.unlistenImage_(),this.changed()},e.prototype.load=function(){0!=this.state&&3!=this.state||(this.state=1,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Fr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Ir);var Mr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Lr=function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=o,a.src_=n,a.key=n,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.tileLoadFunction_=r,a}return Mr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){var t;this.state=3,this.unlistenImage_(),this.image_=((t=yi(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=2:this.state=4,this.unlistenImage_(),this.changed()},e.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Fr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Or),Ar=function(){function t(t,e,i,n,o,r){this.sourceProj_=t,this.targetProj_=e;var s={},a=Ot(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&pt(n)==pt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?pt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?pt(this.targetProj_.getExtent()):null;var l=ut(i),h=ct(i),u=ot(i),p=nt(i),f=this.transformInv_(l),d=this.transformInv_(h),g=this.transformInv_(u),_=this.transformInv_(p),v=10+(r?Math.max(0,Math.ceil(c(it(i)/(r*r*256*256)))):0);if(this.addQuad_(l,h,u,p,f,d,g,_,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,i){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i.5&&u<1,f=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(f=pt(X([t,e,i,n]))/this.targetWorldWidth_>.25||f),!p&&this.sourceProj_.isGlobal()&&u&&(f=u>.25||f)),!(!f&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||ft(h,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(o[0])&&isFinite(o[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var _=[(t[0]+i[0])/2,(t[1]+i[1])/2],v=this.transformInv_(_),y=void 0;y=p?(g(o[0],c)+g(s[0],c))/2-g(v[0],c):(o[0]+s[0])/2-v[0];var m=(o[1]+s[1])/2-v[1];f=y*y+m*m>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var x=[(e[0]+i[0])/2,(e[1]+i[1])/2],w=this.transformInv_(x),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],S=this.transformInv_(b);this.addQuad_(t,e,x,b,o,r,w,S,l-1),this.addQuad_(b,x,i,n,S,w,s,a,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(C),T=[(i[0]+n[0])/2,(i[1]+n[1])/2],O=this.transformInv_(T);this.addQuad_(t,C,T,n,o,E,O,a,l-1),this.addQuad_(C,e,i,T,E,r,s,O,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,i,n,o,s,a),0==(14&d)&&this.addTriangle_(t,i,e,o,s,r),d&&(0==(13&d)&&this.addTriangle_(e,n,t,r,a,o),0==(7&d)&&this.addTriangle_(e,n,i,r,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var o=e.source;Q(t,o[0]),Q(t,o[1]),Q(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();var kr,Dr={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function jr(t,e,i,n,o){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,o),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,o)),t.restore()}function zr(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Gr(t,e,i,n){var o=Rt(i,e,t),r=xt(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(r*=s);var a=t.getMetersPerUnit();void 0!==a&&(r/=a);var l=t.getExtent();if(!l||K(l,o)){var h=xt(t,r,o)/r;isFinite(h)&&h>0&&(r/=h)}return r}var Wr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Xr=function(t){function e(e,i,n,o,r,s,a,l,u,c,p,f){var d=t.call(this,r,0)||this;d.renderEdges_=void 0!==p&&p,d.contextOptions_=f,d.pixelRatio_=a,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=i,d.targetTileGrid_=o,d.wrappedTileCoord_=s||r,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var g=o.getTileCoordExtent(d.wrappedTileCoord_),_=d.targetTileGrid_.getExtent(),v=d.sourceTileGrid_.getExtent(),y=_?ht(g,_):g;if(0===it(y))return d.state=4,d;var m=e.getExtent();m&&(v=v?ht(v,m):m);var x=o.getResolution(d.wrappedTileCoord_[0]),w=function(t,e,i,n){var o=rt(i),r=Gr(t,e,o,n);return(!isFinite(r)||r<=0)&&et(i,(function(i){return r=Gr(t,e,i,n),isFinite(r)&&r>0})),r}(e,n,y,x);if(!isFinite(w)||w<=0)return d.state=4,d;var b=void 0!==c?c:.5;if(d.triangulation_=new Ar(e,n,y,v,w*b,x),0===d.triangulation_.getTriangles().length)return d.state=4,d;d.sourceZ_=i.getZForResolution(w);var S=d.triangulation_.calculateSourceExtent();if(v&&(e.canWrapX()?(S[1]=h(S[1],v[1],v[3]),S[3]=h(S[3],v[1],v[3])):S=ht(S,v)),it(S)){for(var C=i.getTileRangeForExtentAndZ(S,d.sourceZ_),E=C.minX;E<=C.maxX;E++)for(var T=C.minY;T<=C.maxY;T++){var O=u(d.sourceZ_,E,T,a);O&&d.sourceTiles_.push(O)}0===d.sourceTiles_.length&&(d.state=4)}else d.state=4;return d}return Wr(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&2==e.getState()&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=3;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],o="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=function(t,e,i,n,o,r,s,a,l,h,u,c){var p=yi(Math.round(i*t),Math.round(i*e));if(le(p,c),0===l.length)return p.canvas;function f(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){var n,o;n=d,(o=t.extent)[0]n[2]&&(n[2]=o[2]),o[1]n[3]&&(n[3]=o[3])}));var g=pt(d),_=lt(d),v=yi(Math.round(i*g/n),Math.round(i*_/n));le(v,c);var y=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-d[0],o=-(t.extent[3]-d[3]),r=pt(t.extent),s=lt(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*y,o*y,r*y,s*y)}));var m=ut(s);return a.getTriangles().forEach((function(t,e,o){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],g=s[1][1],_=s[2][0],y=s[2][1],x=f((a[0][0]-m[0])/r),w=f(-(a[0][1]-m[1])/r),b=f((a[1][0]-m[0])/r),S=f(-(a[1][1]-m[1])/r),C=f((a[2][0]-m[0])/r),E=f(-(a[2][1]-m[1])/r),T=l,O=h;l=0,h=0;var R=function(t){for(var e=t.length,i=0;io&&(o=s,n=r)}if(0===o)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[u-=T,g-=O,0,0,b-x],[_-=T,y-=O,0,0,C-x],[0,0,u,g,S-w],[0,0,_,y,E-w]]);if(R){if(p.save(),p.beginPath(),function(){if(void 0===kr){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",jr(t,4,5,4,0),jr(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;kr=zr(e,0)||zr(e,4)||zr(e,8)}return kr}()||c===Dr){p.moveTo(b,S);for(var I=x-b,P=w-S,F=0;F<4;F++)p.lineTo(b+f((F+1)*I/4),S+f(F*P/3)),3!=F&&p.lineTo(b+f((F+1)*I/4),S+f((F+1)*P/3));p.lineTo(C,E)}else p.moveTo(b,S),p.lineTo(x,w),p.lineTo(C,E);p.clip(),p.transform(R[0],R[2],R[1],R[3],x,w),p.translate(d[0]-T,d[3]-O),p.scale(n/i,-n/i),p.drawImage(v.canvas,0,0),p.restore()}})),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,o=(n[0][0]-m[0])/r,s=-(n[0][1]-m[1])/r,a=(n[1][0]-m[0])/r,l=-(n[1][1]-m[1])/r,h=(n[2][0]-m[0])/r,u=-(n[2][1]-m[1])/r;p.beginPath(),p.moveTo(a,l),p.lineTo(o,s),p.lineTo(h,u),p.closePath(),p.stroke()})),p.restore()),p.canvas}(n,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=2}this.changed()},e.prototype.load=function(){if(0==this.state){this.state=1,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var o=e.getState();if(0==o||1==o){t++;var r=be(e,de,(function(i){var n=e.getState();2!=n&&3!=n&&4!=n||(Ce(r),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,i){0==t.getState()&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ce),this.sourcesListenerKeys_=null},e}(Or),Nr=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return W(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return W(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){W(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Yr(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function Zr(t,e,i){return t+"/"+e+"/"+i}function Kr(t){return Zr(t[0],t[1],t[2])}var Br=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Vr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Br(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=(e=this.peekFirstKey(),e.split("/").map(Number))[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Kr(e.tileCoord)),e.release())}.bind(this))}var e},e}(Nr);var Ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Hr(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const qr=function(t){function e(e){var i=t.call(this)||this;return i.projection_=mt(e.projection),i.attributions_=Hr(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ve,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return Ur(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return k()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Hr(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Me);var Jr=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Qr(t,e,i,n,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=i,o.maxY=n,o):new Jr(t,e,i,n)}const $r=Jr;var ts=[0,0,0];const es=function(){function t(t){var e,i,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,W((e=this.resolutions_,!0,i=function(t,e){return e-t}||Gt,e.every((function(t,n){if(0===n)return!0;var o=i(e[n-1],t);return!(o>0||0===o)}))),17),!t.origins)for(var o=0,r=this.resolutions_.length-1;o=this.minZoom;){if(e(a,2===this.zoomFactor_?Qr(o=Math.floor(o/2),o,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]0?n:Math.max(s/a[0],r/a[1]),h=o+1,u=new Array(h),c=0;ci||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(n,o)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,n){},e}(qr),as=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return rs(e,t),e}(se);const ls=ss;function hs(t,e){var i=/\{z\}/g,n=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(o,s[2].toString()).replace(r,(function(){var t=s[0],i=e.getFullTileRange(t);return W(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}var us=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const cs=function(t){function e(i){var n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(n.tileUrlFunction=i.tileUrlFunction),n.urls=null,i.urls?n.setUrls(i.urls):i.url&&n.setUrl(i.url),n.tileLoadingKeys_={},n}return us(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=j(i),o=i.getState();1==o?(this.tileLoadingKeys_[n]=!0,e="tileloadstart"):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=3==o?"tileloaderror":2==o?"tileloadend":void 0),null!=e&&this.dispatchEvent(new as(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n=i[1].charCodeAt(0),o=i[2].charCodeAt(0),r=void 0;for(r=n;r<=o;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var i=t.length,n=new Array(i),o=0;oOpenStreetMap | © OpenTopoMap | Little Navmap '];const n=void 0!==e.crossOrigin?e.crossOrigin:void 0,o=[256,256],r=[256,300],s=void 0!==e.url?e.url+"api/map/image?format=png&quality=75&width="+o[0]+"&height="+o[1]:void 0;super({attributions:i,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:n,imageSmoothing:e.imageSmoothing,minZoom:void 0!==e.minZoom?e.minZoom:4,opaque:void 0===e.opaque||e.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:void 0,transition:e.transition,url:s,wrapX:e.wrapX,tileSize:[r[0],r[1]],projection:"EPSG:3857"}),this.setTileLoadFunction(this.defaultTileLoadFunction.bind(this))}defaultTileLoadFunction(t,e){const i=this.getTileGrid().getTileCoordExtent(t.getTileCoord()),n=Math.abs(i[2]-i[0])/6.6666,o=Ct([i[0]+n,i[1]+n],this.getProjection()),r=Ct([i[2]-n,i[3]-n],this.getProjection());t.getImage().src=e+"&leftlon="+o[0]+"&toplat="+o[1]+"&rightlon="+r[0]+"&bottomlat="+r[1]+"&reload="+Math.random()}getPixelRatio(){const t=this.tileGrid.getTileSize();return t[0]/t[1]}updateTileAtPixel(t,e){const i=e.getCoordinateFromPixel(t);this.updateTileAtLonLat(i,e)}updateTileAtLonLat(t,e){const i=this.tileGrid.getTileCoordForCoordAndZ(t,Math.round(e.getView().getZoom())),n=this.getTile(i[0],i[1],i[2],this.getPixelRatio(),this.getProjection());this.defaultTileLoadFunction(n,this.getUrls()[0]),setTimeout((()=>{e.renderSync()}),200)}}var ys=i(279),ms=i.n(ys);const xs=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Eo(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return k()},t.prototype.getImage=function(t){return k()},t.prototype.getHitDetectionImage=function(){return k()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return k()},t.prototype.getImageSize=function(){return k()},t.prototype.getHitDetectionImageSize=function(){return k()},t.prototype.getOrigin=function(){return k()},t.prototype.getSize=function(){return k()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Eo(t)},t.prototype.listenImageChange=function(t){k()},t.prototype.load=function(){k()},t.prototype.unlistenImageChange=function(t){k()},t}();function ws(t){return Array.isArray(t)?ne(t):t}var bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ss=function(t){function e(e){var i=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_={},i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.imageSize_=null,i.hitDetectionImageSize_=null,i.render(),i}return bs(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionCanvas_){var t=this.createRenderOptions();this.createHitDetectionCanvas_(t)}return this.hitDetectionCanvas_},e.prototype.getImage=function(t){if(!this.canvas_[t||1]){var e=this.createRenderOptions(),i=yi(e.size*t||1,e.size*t||1);this.draw_(e,i,0,0,t||1),this.canvas_[t||1]=i.canvas}return this.canvas_[t||1]},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return 2},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.createRenderOptions=function(){var t,e=Si,i=Ei,n=0,o=null,r=0,s=0;return this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Ti),t=ws(t),void 0===(s=this.stroke_.getWidth())&&(s=1),o=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),void 0===(i=this.stroke_.getLineJoin())&&(i=Ei),void 0===(e=this.stroke_.getLineCap())&&(e=Si),void 0===(n=this.stroke_.getMiterLimit())&&(n=10)),{strokeStyle:t,strokeWidth:s,size:2*(this.radius_+s)+1,lineCap:e,lineDash:o,lineDashOffset:r,lineJoin:i,miterLimit:n}},e.prototype.render=function(){var t=this.createRenderOptions(),e=yi(t.size,t.size);this.draw_(t,e,0,0,1),this.canvas_={},this.canvas_[1]=e.canvas;var i=e.canvas.width,n=i,o=this.getDisplacement();this.hitDetectionImageSize_=[t.size,t.size],this.createHitDetectionCanvas_(t),this.anchor_=[i/2-o[0],i/2+o[1]],this.size_=[i,i],this.imageSize_=[n,n]},e.prototype.draw_=function(t,e,i,n,o){var r,s,a;e.setTransform(o,0,0,o,0,0),e.translate(i,n),e.beginPath();var l=this.points_;if(l===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(l*=2),r=0;r<=l;r++)s=2*r*Math.PI/l-Math.PI/2+this.angle_,a=r%2==0?this.radius_:h,e.lineTo(t.size/2+a*Math.cos(s),t.size/2+a*Math.sin(s))}if(this.fill_){var u=this.fill_.getColor();null===u&&(u=bi),e.fillStyle=ws(u),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionCanvas_=this.getImage(1),this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=ee(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var n=yi(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n,0,0)}}},e.prototype.drawHitDetectionCanvas_=function(t,e,i,n){e.translate(i,n),e.beginPath();var o=this.points_;if(o===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var r=void 0!==this.radius2_?this.radius2_:this.radius_;r!==this.radius_&&(o*=2);var s=void 0,a=void 0,l=void 0;for(s=0;s<=o;s++)l=2*s*Math.PI/o-Math.PI/2+this.angle_,a=s%2==0?this.radius_:r,e.lineTo(t.size/2+a*Math.cos(l),t.size/2+a*Math.sin(l))}e.fillStyle=bi,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e}(xs);var Cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Es=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return Cs(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Ss),Ts=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Os=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();var Rs=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Fs,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Fs,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}(),Is=null;function Ps(t,e){if(!Is){var i=new Ts({color:"rgba(255,255,255,0.4)"}),n=new Os({color:"#3399CC",width:1.25});Is=[new Rs({image:new Es({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return Is}function Fs(t){return t.getGeometry()}const Ms=Rs,Ls="fraction",As="pixels",ks="bottom-left",Ds="bottom-right",js="top-left",zs="top-right";var Gs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ws=null,Xs=function(t){function e(e,i,n,o,r,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==o&&(a.image_.crossOrigin=o),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=r,a.size_=n,a.src_=i,a.tainted_,a}return Gs(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&2===this.imageState_){Ws||(Ws=yi(1,1)),Ws.drawImage(this.image_,0,0);try{Ws.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Ws=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(de)},e.prototype.handleImageError_=function(){this.imageState_=3,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=2,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_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=yi(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(0==this.imageState_){this.imageState_=1;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Fr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){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 i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=$t(this.color_),i.fillRect(0,0,e.width,e.height),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var n=i.getImageData(0,0,e.width,e.height),o=n.data,r=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],h=0,u=o.length;h0,6);var c=void 0!==n.src?0:2;return i.color_=void 0!==n.color?ee(n.color):null,i.iconImage_=function(t,e,i,n,o,r){var s=re.get(e,n,r);return s||(s=new Xs(t,e,i,n,o,r),re.set(e,n,r,s)),s}(l,u,h,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:js,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return Ns(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Ls||this.anchorYUnits_==Ls){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Ls&&(t[0]*=e[0]),this.anchorYUnits_==Ls&&(t[1]*=e[1])}if(this.anchorOrigin_!=js){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=zs&&this.anchorOrigin_!=Ds||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=ks&&this.anchorOrigin_!=Ds||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=js){var i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;t=t.slice(),this.offsetOrigin_!=zs&&this.offsetOrigin_!=Ds||(t[0]=n[0]-i[0]-t[0]),this.offsetOrigin_!=ks&&this.offsetOrigin_!=Ds||(t[1]=n[1]-i[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(de,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(de,t)},e}(xs),Zs="preload",Ks="useInterimTilesOnError";var Bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Vs=function(t){function e(e){var i=this,n=e||{},o=le({},n);return delete o.preload,delete o.useInterimTilesOnError,(i=t.call(this,o)||this).setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return Bs(e,t),e.prototype.getPreload=function(){return this.get(Zs)},e.prototype.setPreload=function(t){this.set(Zs,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Ks)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Ks,t)},e}(qe);var Us=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Hs=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Us(e,t),e.prototype.getFeatures=function(t){return k()},e.prototype.prepareFrame=function(t){return k()},e.prototype.renderFrame=function(t,e){return k()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,o){var r=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,o,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){},e.prototype.getDataAtPixel=function(t,e,i){return k()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return 2!=e&&3!=e&&t.addEventListener(de,this.boundHandleImageChange_),0==e&&(t.load(),e=t.getState()),2==e},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ve&&t.changed()},e}(Te);var qs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Js=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return qs(e,t),e.prototype.useContainer=function(t,e,i){var n,o,r=this.getLayer().getClassName();if(t&&""===t.style.opacity&&t.className===r&&(a=t.firstElementChild)instanceof HTMLCanvasElement&&(o=a.getContext("2d")),!o||0!==o.canvas.width&&o.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=o,this.containerReused=!0),!this.container){(n=document.createElement("div")).className=r;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(o=yi()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=o}},e.prototype.clip=function(t,e,i){var n=e.pixelRatio,o=e.size[0]*n/2,r=e.size[1]*n/2,s=e.viewState.rotation,a=ut(i),l=ct(i),h=ot(i),u=nt(i);Vt(e.coordinateToPixelTransform,a),Vt(e.coordinateToPixelTransform,l),Vt(e.coordinateToPixelTransform,h),Vt(e.coordinateToPixelTransform,u),t.save(),Gi(t,-s,o,r),t.beginPath(),t.moveTo(a[0]*n,a[1]*n),t.lineTo(l[0]*n,l[1]*n),t.lineTo(h[0]*n,h[1]*n),t.lineTo(u[0]*n,u[1]*n),t.clip(),Gi(t,s,o,r)},e.prototype.clipUnrotated=function(t,e,i){var n=ut(i),o=ct(i),r=ot(i),s=nt(i);Vt(e.coordinateToPixelTransform,n),Vt(e.coordinateToPixelTransform,o),Vt(e.coordinateToPixelTransform,r),Vt(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;Vt(a,n),Vt(a,o),Vt(a,r),Vt(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var o=new oi(t,this.inversePixelTransform,i,e);n.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_("prerender",t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_("postrender",t,e)},e.prototype.getRenderTransform=function(t,e,i,n,o,r,s){var a=o/2,l=r/2,h=n/e,u=-h,c=-t[0]+s,p=-t[1];return Ut(this.tempTransform,a,l,h,u,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n,o=Vt(this.inversePixelTransform,t.slice()),r=this.context,s=this.getLayer().getExtent();if(s&&!K(s,Vt(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(o[0]),l=Math.round(o[1]),h=document.createElement("canvas"),u=h.getContext("2d");h.width=1,h.height=1,u.clearRect(0,0,1,1),u.drawImage(r.canvas,a,l,1,1,0,0,1,1),n=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:n}return 0===n[3]?null:n},e}(Hs);var Qs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),$s=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new $r(0,0,0,0),i}return Qs(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return 2==i||4==i||3==i&&!n},e.prototype.getTile=function(t,e,i,n){var o=n.pixelRatio,r=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,o,r);return 3==a.getState()&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(2)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,o=n.projection,r=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),p=u.getTileGridForProjection(o),f=p.getZForResolution(r,u.zDirection),d=p.getResolution(f),g=t.extent,_=i.extent&&jt(i.extent);_&&(g=ht(g,jt(i.extent)));var v=u.getTilePixelRatio(l),y=Math.round(t.size[0]*v),m=Math.round(t.size[1]*v);if(a){var x=Math.round(Math.sqrt(y*y+m*m));y=x,m=x}var w=d*y/2/v,b=d*m/2/v,S=[s[0]-w,s[1]-b,s[0]+w,s[1]+b],C=p.getTileRangeForExtentAndZ(g,f),E={};E[f]={};var T=this.createLoadedTileFinder(u,o,E),O=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(var I=C.minX;I<=C.maxX;++I)for(var P=C.minY;P<=C.maxY;++P){var F=this.getTile(f,I,P,t);if(this.isDrawableTile(F)){var M=j(this);if(2==F.getState()){E[f][F.tileCoord.toString()]=F;var L=F.inTransition(M);this.newTiles_||!L&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(M,t.time))continue}var A=p.getTileCoordChildTileRange(F.tileCoord,R,O),k=!1;A&&(k=T(f+1,A)),k||p.forEachTileCoordParentTileRange(F.tileCoord,T,R,O)}var D=d/r;Ut(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,a,-y/2,-m/2);var z=function(t){return gi?qt(t):(Wi||(Wi=yi(1,1).canvas),Wi.style.transform=qt(t),Wi.style.transform)}(this.pixelTransform);this.useContainer(e,z,i.opacity);var G=this.context,W=G.canvas;Ht(this.inversePixelTransform,this.pixelTransform),Ut(this.tempTransform,y/2,m/2,D,D,0,-y/2,-m/2),W.width!=y||W.height!=m?(W.width=y,W.height=m):this.containerReused||G.clearRect(0,0,y,m),_&&this.clipUnrotated(G,t,_),le(G,u.getContextOptions()),this.preRender(G,t),this.renderedTiles.length=0;var X,N,Y,Z=Object.keys(E).map(Number);Z.sort(Gt),1!==i.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(X=[],N=[]):Z=Z.reverse();for(var K=Z.length-1;K>=0;--K){var B=Z[K],V=u.getTilePixelSize(B,l,o),U=p.getResolution(B)/d,H=V[0]*U*D,q=V[1]*U*D,Q=p.getTileCoordForCoordAndZ(ut(S),B),$=p.getTileCoordExtent(Q),tt=Vt(this.tempTransform,[v*($[0]-S[0])/d,v*(S[3]-$[3])/d]),et=v*u.getGutterForProjection(o),it=E[B];for(var nt in it){var ot=(F=it[nt]).tileCoord,rt=tt[0]-(Q[1]-ot[1])*H,st=Math.round(rt+H),at=tt[1]-(Q[2]-ot[2])*q,lt=Math.round(at+q),ct=st-(I=Math.round(rt)),pt=lt-(P=Math.round(at)),ft=f===B;if(!(L=ft&&1!==F.getAlpha(j(this),t.time)))if(X){G.save(),Y=[I,P,I+ct,P,I+ct,P+pt,I,P+pt];for(var dt=0,gt=X.length;dtu&&this.instructions.push([fa.CUSTOM,u,o,t,i,to])):l==_n&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),o=this.coordinates.length,this.instructions.push([fa.CUSTOM,u,o,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[fa.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[fa.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,n,o=e.length,r=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[fa.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[fa.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,o=t.lineDash,r=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!Yt(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=r,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[fa.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Y(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;N(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(da);var va=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ya=function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return va(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([fa.DRAW_IMAGE,o,r,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([fa.DRAW_IMAGE,o,r,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)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([fa.DRAW_IMAGE,o,r,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([fa.DRAW_IMAGE,o,r,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)}},e.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,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),o=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=o,this.image_=r,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(_a);var ma=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const xa=function(t){function e(e,i,n,o){return t.call(this,e,i,n,o)||this}return ma(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var o=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[fa.MOVE_TO_LINE_TO,o,r];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([fa.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ca);var r=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(r,0,r.length,s),this.hitDetectionInstructions.push(ua),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([fa.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ca);for(var r=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,h=0,u=r.length;ht&&(v>_&&(_=v,d=y,g=r),v=0,y=r-o)),s=a,u=p,c=f),l=m,h=x}return(v+=a)>_?[y,r]:[d,g]}var Ca=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ea={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Ta={Circle:ba,Default:_a,Image:ya,LineString:xa,Polygon:ba,Text:function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Ca(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(i||n)){var r=this.coordinates,s=r.length,a=t.getType(),l=null,h=t.getStride();if("line"!==o.placement||a!=vn&&a!=xn&&a!=yn&&a!=wn){var u=o.overflow?null:[];switch(a){case _n:case mn:l=t.getFlatCoordinates();break;case vn:l=t.getFlatMidpoint();break;case Sn:l=t.getCenter();break;case xn:l=t.getFlatMidpoints(),h=2;break;case yn:l=t.getFlatInteriorPoint(),o.overflow||u.push(l[2]/this.resolution),h=3;break;case wn:var c=t.getFlatInteriorPoints();for(l=[],w=0,b=c.length;wI[2]}else T=w>O;var P,F=Math.PI,M=[],L=S+n===e;if(v=0,y=C,p=t[e=S],f=t[e+1],L){m();var A=Math.atan2(f-g,p-d);T&&(A+=A>0?-F:F);var k=(O+w)/2,D=(R+b)/2;return M[0]=[k,D,(E-r)/2,A,o],M}for(var j=0,z=o.length;j0?-F:F),void 0!==P){var W=G-P;if(W+=W>F?-2*F:W<-F?2*F:0,Math.abs(W)>s)return null}P=G;for(var X=j,N=0;jt?t-l:o,x=r+h>e?e-h:r,w=f[3]+m*c[0]+f[1],b=f[0]+x*c[1]+f[2],S=v-f[3],C=y-f[0];return(d||0!==u)&&(ja[0]=S,Wa[0]=S,ja[1]=C,za[1]=C,za[0]=S+w,Ga[0]=za[0],Ga[1]=C+b,Wa[1]=Ga[1]),0!==u?(Vt(_=Ut([1,0,0,1,0,0],i,n,1,1,u,-i,-n),ja),Vt(_,za),Vt(_,Ga),Vt(_,Wa),H(Math.min(ja[0],za[0],Ga[0],Wa[0]),Math.min(ja[1],za[1],Ga[1],Wa[1]),Math.max(ja[0],za[0],Ga[0],Wa[0]),Math.max(ja[1],za[1],Ga[1],Wa[1]),Da)):H(Math.min(S,S+w),Math.min(C,C+b),Math.max(S,S+w),Math.max(C,C+b),Da),p&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:m,drawImageH:x,originX:l,originY:h,declutterBox:{minX:Da[0],minY:Da[1],maxX:Da[2],maxY:Da[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,o,r,s){var a=!(!r&&!s),l=n.declutterBox,h=t.canvas,u=s?s[2]*n.scale[0]/2:0;return l.minX-u<=h.width/e&&l.maxX+u>=0&&l.minY-u<=h.height/e&&l.maxY+u>=0&&(a&&this.replayTextBackground_(t,ja,za,Ga,Wa,r,s),function(t,e,i,n,o,r,s,a,l,h,u){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(u[0],u[1]),function(t,e){for(var i=t.contextInstructions,n=0,o=i.length;nz&&(this.fill_(t),P=0),F>z&&(t.stroke(),F=0),P||F||(t.beginPath(),d=NaN,g=NaN),++O;break;case fa.CIRCLE:var W=l[I=G[1]],X=l[I+1],N=l[I+2]-W,Y=l[I+3]-X,Z=Math.sqrt(N*N+Y*Y);t.moveTo(W+Z,X),t.arc(W,X,Z,0,2*Math.PI,!0),++O;break;case fa.CLOSE_PATH:t.closePath(),++O;break;case fa.CUSTOM:I=G[1],c=G[2];var K=G[3],B=G[4],V=6==G.length?G[5]:void 0;j.geometry=K,j.feature=S,O in A||(A[O]=[]);var U=A[O];V?V(l,I,c,2,U):(U[0]=l[I],U[1]=l[I+1],U.length=2),B(U,j),++O;break;case fa.DRAW_IMAGE:I=G[1],c=G[2],y=G[3],p=G[4],f=G[5];var H=G[6],q=G[7],J=G[8],Q=G[9],$=G[10],tt=G[11],et=G[12],it=G[13],nt=G[14];if(!y&&G.length>=19){m=G[18],x=G[19],w=G[20],b=G[21];var ot=this.drawLabelWithPointPlacement_(m,x,w,b);y=ot.label,G[3]=y;var rt=G[22];p=(ot.anchorX-rt)*this.pixelRatio,G[4]=p;var st=G[23];f=(ot.anchorY-st)*this.pixelRatio,G[5]=f,H=y.height,G[6]=H,it=y.width,G[13]=it}var at=void 0;G.length>24&&(at=G[24]);var lt=void 0,ht=void 0,ut=void 0;G.length>16?(lt=G[15],ht=G[16],ut=G[17]):(lt=Ii,ht=!1,ut=!1),$&&D?tt+=k:$||D||(tt-=k);for(var ct=0;Ii)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+o)*e+(t+r))+3),o>0&&a.push(4*((t-o)*e+(t+r))+3),r>0&&(a.push(4*((t+o)*e+(t-r))+3),o>0&&a.push(4*((t-o)*e+(t-r))+3))}for(var l=[],h=(o=0,n.length);o0){if(!r||c!==Pa&&c!==La||-1!==r.indexOf(t)){var h=(p[a]-3)/4,f=n-h%s,d=n-(h/s|0),g=o(t,e,f*f+d*d);if(g)return g}u.clearRect(0,0,s,s);break}}var d,g,_,v,y,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(Gt),d=m.length-1;d>=0;--d){var x=m[d].toString();for(_=this.executorsByZIndex_[x],g=Ka.length-1;g>=0;--g)if(void 0!==(v=_[c=Ka[g]])&&(y=v.executeHitDetection(u,a,i,f,h)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],o=e[2],r=e[3],s=[i,n,i,r,o,r,o,n];return Wn(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return ce(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,o,r,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(Gt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,h,u,c,p,f,d=r||Ka;for(s&&a.reverse(),l=0,h=a.length;l0&&(s.width=0),this.container;var h=Math.round(t.size[0]*i),u=Math.round(t.size[1]*i);s.width!=h||s.height!=u?(s.width=h,s.height=u,s.style.transform!==o&&(s.style.transform=o)):this.containerReused||r.clearRect(0,0,h,u),this.preRender(r,t);var c=t.viewState,p=(c.projection,!1);if(n.extent&&this.clipping){var f=jt(n.extent);(p=!B(f,t.extent)&&ft(f,t.extent))&&this.clipUnrotated(r,t,f)}this.renderWorlds(a,t),p&&r.restore(),this.postRender(r,t);var d=n.opacity,g=this.container;return d!==parseFloat(g.style.opacity)&&(g.style.opacity=1===d?"":String(d)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];Vt(this.pixelTransform,i);var n=this.renderedCenter_,o=this.renderedResolution_,r=this.renderedRotation_,s=this.renderedProjection_,a=this.renderedExtent_,l=this.getLayer(),h=[],u=i[0]/2,c=i[1]/2;h.push(this.getRenderTransform(n,o,r,.5,u,c,0).slice());var p=l.getSource(),f=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!B(f,a)){for(var d=a[0],g=pt(f),_=0,v=void 0;df[2];)v=g*++_,h.push(this.getRenderTransform(n,o,r,.5,u,c,v).slice()),d-=g}this.hitDetectionImageData_=function(t,e,i,n,o,r,s){var a=yi(t[0]/2,t[1]/2);a.imageSmoothingEnabled=!1;for(var l=a.canvas,h=new qa(a,.5,o,null,s),u=i.length,c=Math.floor(16777215/u),p={},f=1;f<=u;++f){var d=i[f-1],g=d.getStyleFunction()||n;if(n){var _=g(d,r);if(_){Array.isArray(_)||(_=[_]);for(var v="#"+("000000"+(f*c).toString(16)).slice(-6),y=0,m=_.length;y=i[2])){var o=pt(i),r=Math.floor((n[0]-i[0])/o)*o;t[0]-=r,t[2]-=r}return t}(v[0],h);w[0]y[0]&&w[2]>y[2]&&v.push([w[0]-m,w[1],w[2]-m,w[3]])}if(!this.dirty_&&this.renderedResolution_==u&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&B(this.renderedExtent_,_))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var b,S=new Oa($a(u,c),_,u,c);this.getLayer().getDeclutter()&&(b=new Oa($a(u,c),_,u,c));var C,E=Lt();if(E){for(var T=0,O=v.length;T=200&&a.status<300){var n=e.getType(),l=void 0;"json"==n||"text"==n?l=a.responseText:"xml"==n?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):n==pl&&(l=a.response),l?r(e.readFeatures(l,{extent:i,featureProjection:o}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(t,e,i,n,o,(function(t,e){void 0!==r&&r(t),a.addFeatures(t)}),s||Bt)}}var dl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gl=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.feature=i,o.features=n,o}return dl(e,t),e}(se);const _l=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:Ve,wrapX:void 0===n.wrapX||n.wrapX})||this).loader_=Bt,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&(W(i.format_,7),i.loader_=fl(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:cl;var o,r,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new ll:null,i.loadedExtentsRtree_=new ll,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?r=n.features:n.features&&(r=(o=n.features).getArray()),s||void 0!==o||(o=new Ui(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==o&&i.bindFeaturesCollection_(o),i}return dl(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=j(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new gl(hl,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[be(e,de,this.handleFeatureChange_,this),be(e,ae,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(W(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],o=0,r=t.length;o',n.className="follow-control on ol-unselectable ol-control",n.appendChild(r),t.call(this,{element:n,target:o.target}),r.addEventListener("click",this.handleFollow.bind(this),!1)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.handleFollow=function(){i=!i,n.className=i?"follow-control on ol-unselectable ol-control":"follow-control off ol-unselectable ol-control",e()},o}(Io);var yl=i(441),ml=i.n(yl);const xl=function(t){var e,i=document.createElement("div");function n(n){var o=n||{};e=n.handleRefresh;var r=document.createElement("button");r.innerHTML='',i.className="refresh-control on ol-unselectable ol-control",i.appendChild(r),t.call(this,{element:i,target:o.target}),r.addEventListener("click",this.handleRefresh.bind(this),!1)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.handleRefresh=function(){e()},n}(Io);var wl="/";console.log("Starting production mode:",wl);var bl=new class{constructor(t,e){this.url=t,this.target=e,this.refreshInterval=1e3,this.sources=[new vs({url:this.url})],this.activesource=0,this.layers=[new ia({source:this.sources[0],className:"lnm-layer-0",visible:!0})],this.following=!0,this.initMap()}initMap(){const t=[new vl({handleFollow:()=>{this.following=!this.following}}),new xl({handleRefresh:()=>{this.sources.forEach((t=>{t.refresh()}))}}),new Fo({collapsible:!1})];this.setupAircraftFeature(),this.map=new Er({controls:t,layers:this.layers,target:this.target,view:new Co({minZoom:4})})}setupAircraftFeature(){this.aircraftFeature=new al({geometry:new ao([0,0])}),this.aircraftFeatureStyle=new Ms({image:new Ys({anchor:[.5,.5],anchorXUnits:"fraction",anchorYUnits:"fraction",src:ms(),scale:.5,opacity:0})}),this.aircraftFeature.setStyle(this.aircraftFeatureStyle);const t=new _l({features:[this.aircraftFeature]}),e=new rl({source:t});this.layers.push(e)}fetch(t,e,i){fetch(t).then((t=>t.text())).then((t=>e(t))).catch((t=>{i(t)}))}getAircraftPosition(t){this.fetch(this.url+"api/sim/info",(e=>{try{const i=JSON.parse(e);i.active?(this.setAircraftFeatureVisibility(!0),t([i.position.lon,i.position.lat],i.heading)):this.setAircraftFeatureVisibility(!1)}catch(t){console.log(t)}}),(t=>{console.log(t)}))}setAircraftFeatureVisibility(t){t&&0==this.aircraftFeature.getStyle().getImage().getOpacity()?this.aircraftFeature.getStyle().getImage().setOpacity(1):t||1!=this.aircraftFeature.getStyle().getImage().getOpacity()||this.aircraftFeature.getStyle().getImage().setOpacity(0)}ParseDMS(t){var e=t.split(/[^\d\w!.]+/),i=this.ConvertDMSToDD(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),e[3]);return[this.ConvertDMSToDD(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),e[7]),i]}ConvertDMSToDD(t,e,i,n){var o=t+e/60+i/3600;return"S"!=n&&"W"!=n||(o*=-1),o}startRefreshLoop(){setTimeout(this.refreshLoop.bind(this),this.refreshInterval)}refreshLoop(){this.getAircraftPosition(((t,e)=>{const i=St(t);this.aircraftFeature.setGeometry(new ao(i)),this.aircraftFeatureStyle.getImage().setRotation(this.degreesToRadians(e)),this.following&&this.map.getView().animate({center:i,duration:200})})),setTimeout(this.refreshLoop.bind(this),this.refreshInterval)}degreesToRadians(t){return t*(Math.PI/180)}toggleActiveSource(){this.activesource<1?(this.activesource=1,this.layers[1].setVisible(!0),this.layers[0].setVisible(!1)):(this.activesource=0,this.layers[0].setVisible(!0),this.layers[1].setVisible(!1))}}(wl,"map");window.onload=()=>{(t=>{var e=t.getView(),i=1,n=null,o=!1;document.body.onmousedown=function(){o=!0},document.body.onmouseup=function(){n=null,o=!1};var r=document.createElement("div");r.classList.add("pointer_overlay");var s="50px";r.style.position="absolute",r.style.left=s,r.style.right=s,r.style.top=s,r.style.bottom=s,document.body.append(r),r.addEventListener("mousemove",(function(i){if(o){if(n){var r=[n[0]-i.clientX,n[1]-i.clientY],s=t.getCoordinateFromPixel([i.clientX,i.clientY]),a=t.getCoordinateFromPixel([i.clientX-r[0],i.clientY-r[1]]);e.adjustCenter([s[0]-a[0],s[1]-a[1]])}n=[i.clientX,i.clientY]}})),r.addEventListener("wheel",(function(t){t.deltaY>0&&ie.getMinZoom()&&(i-=1),e.animate({zoom:i,duration:200})}))})(bl.map),bl.map.getView().setZoom(2),bl.map.getView().setCenter(St([0,0])),bl.startRefreshLoop()}})()})(); \ No newline at end of file diff --git a/web/ol/index.html b/web/ol/index.html new file mode 100644 index 000000000..cdbb63202 --- /dev/null +++ b/web/ol/index.html @@ -0,0 +1 @@ +Little Navmap - openlayers
\ No newline at end of file From 7de26a0211897079007e9bf12d050b35e59028bf Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Thu, 14 Oct 2021 20:43:17 +0200 Subject: [PATCH 11/29] Complement previous commit --- src/webapi/mapactionscontroller.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index a77522bed..969665361 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -119,7 +119,7 @@ MapPixmap MapActionsController::getPixmap(int width, int height) qDebug() << Q_FUNC_INFO << width << "x" << height; return getPixmapPosDistance(width, height, atools::geo::EMPTY_POS, - static_cast(NavApp::getMapWidget()->distance()), QLatin1String("")); + static_cast(mapPaintWidget->distance()), QLatin1String("")); } MapPixmap MapActionsController::getPixmapObject(int width, int height, web::ObjectType type, const QString& ident, @@ -161,8 +161,8 @@ MapPixmap MapActionsController::getPixmapPosDistance(int width, int height, atoo if(errorCase == QLatin1String("")) { // Use current map position - pos.setLonX(static_cast(NavApp::getMapWidget()->centerLongitude())); - pos.setLatY(static_cast(NavApp::getMapWidget()->centerLatitude())); + pos.setLonX(static_cast(mapPaintWidget->centerLongitude())); + pos.setLatY(static_cast(mapPaintWidget->centerLatitude())); } else { @@ -176,7 +176,7 @@ MapPixmap MapActionsController::getPixmapPosDistance(int width, int height, atoo if(mapPaintWidget != nullptr) { // Copy all map settings - mapPaintWidget->copySettings(*NavApp::getMapWidget()); + mapPaintWidget->copySettings(*NavApp::getMapWidgetGui()); // Do not center world rectangle when resizing map widget mapPaintWidget->setKeepWorldRect(false); @@ -245,7 +245,7 @@ MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo if(mapPaintWidget != nullptr) { // Copy all map settings - mapPaintWidget->copySettings(*NavApp::getMapWidget()); + mapPaintWidget->copySettings(*NavApp::getMapWidgetGui()); // Do not center world rectangle when resizing mapPaintWidget->setKeepWorldRect(false); @@ -254,7 +254,7 @@ MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo // Disable dynamic/live features mapPaintWidget->setShowMapFeatures(map::AIRCRAFT_ALL,false); - mapPaintWidget->setShowMapFeatures(map::AIRCRAFT_TRACK,false); + mapPaintWidget->setShowMapFeaturesDisplay(map::AIRCRAFT_TRACK,false); // Disable copyright note mapPaintWidget->setPaintCopyright(false); From f94269f15799b836c340bac78a84239ad44616e9 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Thu, 14 Oct 2021 23:24:48 +0200 Subject: [PATCH 12/29] Implement map features retrieval by rect - Apply https://github.com/albar965/littlenavmap/issues/790#issuecomment-941127829 - Perform dummy image action and extract results - Expose MapPaintLayer::updateLayers() to allow mapLayer initialisation --- src/mappainter/mappaintlayer.h | 2 +- src/query/mapquery.cpp | 25 ++++++++++++--------- src/webapi/abstractlnmactionscontroller.cpp | 8 +++---- src/webapi/abstractlnmactionscontroller.h | 4 ++-- src/webapi/mapactionscontroller.cpp | 20 ++++++++++++++++- 5 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/mappainter/mappaintlayer.h b/src/mappainter/mappaintlayer.h index d7de04a53..13b6ac7b2 100644 --- a/src/mappainter/mappaintlayer.h +++ b/src/mappainter/mappaintlayer.h @@ -158,10 +158,10 @@ class MapPaintLayer : } void initQueries(); + void updateLayers(); private: void initMapLayerSettings(); - void updateLayers(); /* Implemented from LayerInterface: We draw above all but below user tools */ virtual QStringList renderPosition() const override diff --git a/src/query/mapquery.cpp b/src/query/mapquery.cpp index 90595db11..68ab6415b 100644 --- a/src/query/mapquery.cpp +++ b/src/query/mapquery.cpp @@ -737,24 +737,29 @@ const QList *MapQuery::getAirportsByRect(const atools::geo::Rec const GeoDataLatLonBox latLonBox= GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest()); - qWarning() << Q_FUNC_INFO << latLonBox.south() << latLonBox.north()<< latLonBox.east()<< latLonBox.west(); // Get flags for running separate queries for add-on and normal airports bool addon = types.testFlag(map::AIRPORT_ADDON); bool normal = types & (map::AIRPORT_HARD | map::AIRPORT_SOFT | map::AIRPORT_EMPTY); -// airportCache.updateCache(latLonBox, mapLayer, queryRectInflationFactor, queryRectInflationIncrement, lazy, -// [ = ](const MapLayer *curLayer, const MapLayer *newLayer) -> bool -// { -// return curLayer->hasSameQueryParametersAirport(newLayer) && -// // Invalidate cache if settings differ -// airportCacheAddonFlag == addon && airportCacheNormalFlag == normal; -// }); - airportCacheAddonFlag = addon; airportCacheNormalFlag = normal; + switch(mapLayer->getDataSource()) + { + case layer::ALL: + airportByRectQuery->bindValue(":minlength", mapLayer->getMinRunwayLength()); + return fetchAirports(latLonBox, airportByRectQuery, lazy, false /* overview */, addon, normal, overflow); - return fetchAirports(latLonBox, airportByRectQuery, lazy, false /* overview */, addon, normal, overflow); + case layer::MEDIUM: + // Airports > 4000 ft + return fetchAirports(latLonBox, airportMediumByRectQuery, lazy, true /* overview */, addon, normal, overflow); + + case layer::LARGE: + // Airports > 8000 ft + return fetchAirports(latLonBox, airportLargeByRectQuery, lazy, true /* overview */, addon, normal, overflow); + + } + return nullptr; } diff --git a/src/webapi/abstractlnmactionscontroller.cpp b/src/webapi/abstractlnmactionscontroller.cpp index add24d02b..bda28fa3e 100644 --- a/src/webapi/abstractlnmactionscontroller.cpp +++ b/src/webapi/abstractlnmactionscontroller.cpp @@ -51,13 +51,11 @@ NavApp* AbstractLnmActionsController::getNavApp(){ return NavApp::navAppInstance(); } -MapQuery* AbstractLnmActionsController::getMapQuery(){ - // TODO you have to get the map query from the MapPaintWidget instance used for the web UI +MapQuery* AbstractLnmActionsController::getMapQueryGui(){ return getNavApp()->getMapQueryGui(); } -WaypointTrackQuery* AbstractLnmActionsController::getWaypointTrackQuery(){ - // TODO you have to get the map query from the MapPaintWidget instance used for the web UI +WaypointTrackQuery* AbstractLnmActionsController::getWaypointTrackQueryGui(){ return getNavApp()->getWaypointTrackQueryGui(); } @@ -107,7 +105,7 @@ const AirportAdminNames AbstractLnmActionsController::getAirportAdminNames(map:: int AbstractLnmActionsController::getTransitionAltitude(map::MapAirport& airport){ // Get transition altitude from nav database map::MapAirport navAirport = airport; - getMapQuery()->getAirportNavReplace(navAirport); + getMapQueryGui()->getAirportNavReplace(navAirport); if(navAirport.isValid() && navAirport.transitionAltitude > 0) return navAirport.transitionAltitude; return -1; diff --git a/src/webapi/abstractlnmactionscontroller.h b/src/webapi/abstractlnmactionscontroller.h index 8f67b8b16..d9ca921cb 100644 --- a/src/webapi/abstractlnmactionscontroller.h +++ b/src/webapi/abstractlnmactionscontroller.h @@ -73,8 +73,8 @@ class AbstractLnmActionsController : protected: // Main LNM objects NavApp* getNavApp(); - MapQuery* getMapQuery(); - WaypointTrackQuery* getWaypointTrackQuery(); + MapQuery* getMapQueryGui(); + WaypointTrackQuery* getWaypointTrackQueryGui(); InfoQuery* getInfoQuery(); AirportQuery* getAirportQuery(AirportQueryType type); MainWindow* getMainWindow(); diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index 64b5f7bf3..ad6420278 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -106,7 +106,23 @@ WebApiResponse MapActionsController::featuresAction(WebApiRequest request){ bool overflow = false; - const QList airports = *getMapQuery()->getAirportsByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,map::NONE,overflow); + // Init dummy image request + WebApiRequest *imageRequest = new WebApiRequest(); + imageRequest->parameters = QMap(); + imageRequest->parameters.insert("leftlon",request.parameters.value("leftlon")), + imageRequest->parameters.insert("toplat",request.parameters.value("toplat")), + imageRequest->parameters.insert("rightlon",request.parameters.value("rightlon")), + imageRequest->parameters.insert("bottomlat",request.parameters.value("bottomlat")), + imageRequest->parameters.insert("width","300"); + imageRequest->parameters.insert("height","300"); + imageRequest->parameters.insert("format","jpg"); + imageRequest->parameters.insert("quality","1"); + + // Perform dummy image request + imageAction(*imageRequest); + + // Extract results created during dummy image request + const QList airports = *mapPaintWidget->getMapQuery()->getAirportsByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,map::NONE,overflow); MapFeaturesData data = { airports @@ -132,6 +148,8 @@ void MapActionsController::init() // Create a map widget clone with the desired resolution mapPaintWidget = new MapPaintWidget(parentWidget, false /* no real widget - hidden */); + // Ensure MapPaintLayer::mapLayer initialisation + mapPaintWidget->getMapPaintLayer()->updateLayers(); // Activate painting mapPaintWidget->setActive(); From d7ecd793e14ef8fb7b8f38755c51bfea97dd8ac7 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Tue, 19 Oct 2021 15:51:06 +0200 Subject: [PATCH 13/29] Add detailFactor to MapActionsController calls - Extend API contract --- src/webapi/mapactionscontroller.cpp | 39 +++++++---------------------- src/webapi/mapactionscontroller.h | 6 ++--- web/webapi.yaml | 18 +++++++++++++ 3 files changed, 29 insertions(+), 34 deletions(-) diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index ad6420278..ca0917cd5 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -52,10 +52,13 @@ WebApiResponse MapActionsController::imageAction(WebApiRequest request){ request.parameters.value("bottomlat").toFloat() ); + int detailFactor = request.parameters.value("detailfactor").toInt(); + MapPixmap map = getPixmapRect( request.parameters.value("width").toInt(), request.parameters.value("height").toInt(), - rect + rect, + detailFactor ); QString format = QString(request.parameters.value("format")); @@ -113,6 +116,7 @@ WebApiResponse MapActionsController::featuresAction(WebApiRequest request){ imageRequest->parameters.insert("toplat",request.parameters.value("toplat")), imageRequest->parameters.insert("rightlon",request.parameters.value("rightlon")), imageRequest->parameters.insert("bottomlat",request.parameters.value("bottomlat")), + imageRequest->parameters.insert("detailfactor",request.parameters.value("detailfactor")); imageRequest->parameters.insert("width","300"); imageRequest->parameters.insert("height","300"); imageRequest->parameters.insert("format","jpg"); @@ -172,34 +176,6 @@ MapPixmap MapActionsController::getPixmap(int width, int height) static_cast(mapPaintWidget->distance()), QLatin1String("")); } -MapPixmap MapActionsController::getPixmapObject(int width, int height, web::ObjectType type, const QString& ident, - float distanceKm) -{ - if(verbose) - qDebug() << Q_FUNC_INFO << width << "x" << height << "type" << type << "ident" << ident << "distanceKm" << - distanceKm; - - MapPixmap mapPixmap; - switch(type) - { - case web::USER_AIRCRAFT: { - mapPixmap = getPixmapPosDistance(width, height, NavApp::getUserAircraftPos(), distanceKm, QLatin1String(""), tr("No user aircraft")); - break; - } - - case web::ROUTE: { - mapPixmap = getPixmapRect(width, height, NavApp::getRouteRect(), tr("No flight plan")); - break; - } - - case web::AIRPORT: { - mapPixmap = getPixmapPosDistance(width, height, NavApp::getAirportPos(ident), distanceKm, QLatin1String(""), tr("Airport %1 not found").arg(ident)); - break; - } - } - return mapPixmap; -} - MapPixmap MapActionsController::getPixmapPosDistance(int width, int height, atools::geo::Pos pos, float distanceKm, const QString& mapCommand, const QString& errorCase) { @@ -285,7 +261,7 @@ MapPixmap MapActionsController::getPixmapPosDistance(int width, int height, atoo } } -MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo::Rect rect, const QString& errorCase) +MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo::Rect rect, int detailFactor, const QString& errorCase) { if(verbose) qDebug() << Q_FUNC_INFO << width << "x" << height << rect; @@ -306,6 +282,9 @@ MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo mapPaintWidget->setShowMapFeatures(map::AIRCRAFT_ALL,false); mapPaintWidget->setShowMapFeaturesDisplay(map::AIRCRAFT_TRACK,false); + // Set detail factor + mapPaintWidget->getMapPaintLayer()->setDetailFactor(detailFactor); + // Disable copyright note mapPaintWidget->setPaintCopyright(false); diff --git a/src/webapi/mapactionscontroller.h b/src/webapi/mapactionscontroller.h index 50aed0041..afe8f6c63 100644 --- a/src/webapi/mapactionscontroller.h +++ b/src/webapi/mapactionscontroller.h @@ -20,6 +20,7 @@ #include "webapi/abstractlnmactionscontroller.h" #include "web/webmapcontroller.h" +#include "mapgui/maplayersettings.h" #include "web/webflags.h" @@ -61,15 +62,12 @@ class MapActionsController : /* Get pixmap with given width and height from current position. */ MapPixmap getPixmap(int width, int height); - /* Get pixmap with given width and height for a map object like an airport, the user aircraft or a route. */ - MapPixmap getPixmapObject(int width, int height, web::ObjectType type, const QString& ident, float distanceKm); - /* Get map at given position and distance. Command can be used to zoom in/out or scroll from the given position: * "in", "out", "left", "right", "up" and "down". */ MapPixmap getPixmapPosDistance(int width, int height, atools::geo::Pos pos, float distanceKm, const QString& mapCommand, const QString& errorCase = QLatin1String("")); /* Zoom to rectangel on map. */ - MapPixmap getPixmapRect(int width, int height, atools::geo::Rect rect, const QString& errorCase = tr("Invalid rectangle")); + MapPixmap getPixmapRect(int width, int height, atools::geo::Rect rect, int detailFactor = MapLayerSettings::MAP_DEFAULT_DETAIL_FACTOR, const QString& errorCase = tr("Invalid rectangle")); MapPaintWidget *mapPaintWidget = nullptr; QWidget *parentWidget; diff --git a/web/webapi.yaml b/web/webapi.yaml index e6608a857..138e31ec3 100644 --- a/web/webapi.yaml +++ b/web/webapi.yaml @@ -106,6 +106,15 @@ paths: schema: type: string enum: [png, jpg] + - name: detailfactor + required: true + in: query + description: Detail factor + schema: + type: integer + minimum: 8 + maximum: 15 + example: 10 responses: 200: description: Resulting map image @@ -149,6 +158,15 @@ paths: schema: type: number example: 45 + - name: detailfactor + required: true + in: query + description: Detail factor + schema: + type: integer + minimum: 8 + maximum: 15 + example: 10 responses: 200: description: map feature list From ae22eefb3a0e2d1914e3eb326c65b5c44dc559ff Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Tue, 19 Oct 2021 17:28:01 +0200 Subject: [PATCH 14/29] Extend MapActionsController::features result - Add NDB, VOR, and Marker data - Extend MapQuery by atools Rect query methods - Extend info builder - NDB,VOR,Marker results appear not to match airport retrieval rect --- src/common/infobuildertypes.h | 3 ++ src/common/jsoninfobuilder.cpp | 45 +++++++++++++++++++++++++++++ src/query/mapquery.cpp | 22 ++++++++++++++ src/query/mapquery.h | 8 +++++ src/webapi/mapactionscontroller.cpp | 9 +++++- 5 files changed, 86 insertions(+), 1 deletion(-) diff --git a/src/common/infobuildertypes.h b/src/common/infobuildertypes.h index a8e37ac63..66d37e96f 100644 --- a/src/common/infobuildertypes.h +++ b/src/common/infobuildertypes.h @@ -89,6 +89,9 @@ namespace InfoBuilderTypes { */ struct MapFeaturesData{ const QList airports; + const QList ndbs; + const QList vors; + const QList markers; }; } diff --git a/src/common/jsoninfobuilder.cpp b/src/common/jsoninfobuilder.cpp index 76dc774d5..907ea7239 100644 --- a/src/common/jsoninfobuilder.cpp +++ b/src/common/jsoninfobuilder.cpp @@ -340,11 +340,23 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const json = { { "airports", JSON::object() }, + { "ndbs", JSON::object() }, + { "vors", JSON::object() }, + { "markers", JSON::object() }, }; json["airports"].push_back({ "count", data.airports.count() }); json["airports"].push_back({ "result", JSON::array() }); + json["ndbs"].push_back({ "count", data.ndbs.count() }); + json["ndbs"].push_back({ "result", JSON::array() }); + + json["vors"].push_back({ "count", data.vors.count() }); + json["vors"].push_back({ "result", JSON::array() }); + + json["markers"].push_back({ "count", data.markers.count() }); + json["markers"].push_back({ "result", JSON::array() }); + for(int i = 0; i < data.airports.count(); ++i){ @@ -368,6 +380,39 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const // json["airports"]["result"].push_back(airportJson); } + for(int i = 0; i < data.ndbs.count(); ++i){ + + map::MapNdb ndb = data.ndbs[i]; + + json["ndbs"]["result"][i]["ident"] = qUtf8Printable(ndb.ident); + json["ndbs"]["result"][i]["name"] = qUtf8Printable(ndb.name); + json["ndbs"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(ndb.position)); + json["ndbs"]["result"][i]["elevation"] = ndb.getPosition().getAltitude(); + + } + + for(int i = 0; i < data.vors.count(); ++i){ + + map::MapVor vor = data.vors[i]; + + json["vors"]["result"][i]["ident"] = qUtf8Printable(vor.ident); + json["vors"]["result"][i]["name"] = qUtf8Printable(vor.name); + json["vors"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(vor.position)); + json["vors"]["result"][i]["elevation"] = vor.getPosition().getAltitude(); + + } + + for(int i = 0; i < data.markers.count(); ++i){ + + map::MapMarker marker = data.markers[i]; + + json["markers"]["result"][i]["ident"] = qUtf8Printable(marker.ident); + json["markers"]["result"][i]["type"] = qUtf8Printable(marker.type); + json["markers"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(marker.position)); + json["markers"]["result"][i]["elevation"] = marker.getPosition().getAltitude(); + + } + return json.dump().data(); } diff --git a/src/query/mapquery.cpp b/src/query/mapquery.cpp index 68ab6415b..e8fd2690a 100644 --- a/src/query/mapquery.cpp +++ b/src/query/mapquery.cpp @@ -791,6 +791,14 @@ const QList *MapQuery::getVors(const GeoDataLatLonBox& rect, const return &vorCache.list; } +const QList *MapQuery::getVorsByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, + bool lazy, bool& overflow) +{ + const GeoDataLatLonBox latLonBox = GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest()); + return getVors(latLonBox,mapLayer,lazy,overflow); +} + + const QList *MapQuery::getNdbs(const GeoDataLatLonBox& rect, const MapLayer *mapLayer, bool lazy, bool& overflow) { @@ -819,6 +827,13 @@ const QList *MapQuery::getNdbs(const GeoDataLatLonBox& rect, const return &ndbCache.list; } +const QList *MapQuery::getNdbsByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, + bool lazy, bool& overflow) +{ + const GeoDataLatLonBox latLonBox = GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest()); + return getNdbs(latLonBox,mapLayer,lazy,overflow); +} + const QList MapQuery::getUserdataPoints(const GeoDataLatLonBox& rect, const QStringList& types, const QStringList& typesAll, bool unknownType, float distance) @@ -948,6 +963,13 @@ const QList *MapQuery::getMarkers(const GeoDataLatLonBox& rect, return &markerCache.list; } +const QList *MapQuery::getMarkersByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, + bool lazy, bool& overflow) +{ + const GeoDataLatLonBox latLonBox = GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest()); + return getMarkers(latLonBox,mapLayer,lazy,overflow); +} + const QList *MapQuery::getHoldings(const Marble::GeoDataLatLonBox& rect, const MapLayer *mapLayer, bool lazy, bool& overflow) { diff --git a/src/query/mapquery.h b/src/query/mapquery.h index a0a383322..d0acd51a5 100644 --- a/src/query/mapquery.h +++ b/src/query/mapquery.h @@ -186,14 +186,22 @@ class MapQuery const QList *getVors(const Marble::GeoDataLatLonBox& rect, const MapLayer *mapLayer, bool lazy, bool& overflow); + const QList *getVorsByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, bool lazy, + bool& overflow); /* Similar to getAirports */ const QList *getNdbs(const Marble::GeoDataLatLonBox& rect, const MapLayer *mapLayer, bool lazy, bool& overflow); + const QList *getNdbsByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, bool lazy, + bool& overflow); + /* Similar to getAirports */ const QList *getMarkers(const Marble::GeoDataLatLonBox& rect, const MapLayer *mapLayer, bool lazy, bool& overflow); + const QList *getMarkersByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, bool lazy, + bool& overflow); + /* Similar to getAirports */ const QList *getHoldings(const Marble::GeoDataLatLonBox& rect, const MapLayer *mapLayer, bool lazy, bool& overflow); diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index ca0917cd5..f5844f44c 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -128,8 +128,15 @@ WebApiResponse MapActionsController::featuresAction(WebApiRequest request){ // Extract results created during dummy image request const QList airports = *mapPaintWidget->getMapQuery()->getAirportsByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,map::NONE,overflow); + const QList ndbs = *mapPaintWidget->getMapQuery()->getNdbsByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,overflow); + const QList vors = *mapPaintWidget->getMapQuery()->getVorsByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,overflow); + const QList markers = *mapPaintWidget->getMapQuery()->getMarkersByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,overflow); + MapFeaturesData data = { - airports + airports, + ndbs, + vors, + markers }; response.body = infoBuilder->features(data); From bcd605fddcbe0c3c4efe7b2c098add09f1bc8572 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Tue, 19 Oct 2021 17:41:53 +0200 Subject: [PATCH 15/29] Complement API contract on NDB, VOR and Markers --- web/webapi.yaml | 95 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/web/webapi.yaml b/web/webapi.yaml index 138e31ec3..76d3b2da6 100644 --- a/web/webapi.yaml +++ b/web/webapi.yaml @@ -502,7 +502,7 @@ components: description: List of map features properties: airports: - description: the zoom value of the map inside LNM UI + description: airports list type: object properties: count: @@ -513,6 +513,42 @@ components: items: type: object $ref: '#/components/schemas/MapAirportFeature' + ndbs: + description: NDBs list + type: object + properties: + count: + type: number + example: 361 + result: + type: array + items: + type: object + $ref: '#/components/schemas/MapNDBFeature' + vors: + description: VORs list + type: object + properties: + count: + type: number + example: 361 + result: + type: array + items: + type: object + $ref: '#/components/schemas/MapVORFeature' + markers: + description: markers list + type: object + properties: + count: + type: number + example: 361 + result: + type: array + items: + type: object + $ref: '#/components/schemas/MapMarkerFeature' MapAirportFeature: type: object description: Single airport list entry @@ -532,3 +568,60 @@ components: position: description: The airports geographical position $ref: '#/components/schemas/Coordinates' + MapNDBFeature: + type: object + description: Single NDB list entry + properties: + elevation: + description: the NDB elevation in ft + type: number + example: 3.40 + ident: + description: The NDB ident (ICAO) + type: string + example: "OB" + name: + description: The NDB name + type: string + example: "Overberg" + position: + description: The NDB geographical position + $ref: '#/components/schemas/Coordinates' + MapVORFeature: + type: object + description: Single VOR list entry + properties: + elevation: + description: the VOR elevation in ft + type: number + example: 659 + ident: + description: The VOR ident (ICAO) + type: string + example: "GRV" + name: + description: The VOR name + type: string + example: "George" + position: + description: The VOR geographical position + $ref: '#/components/schemas/Coordinates' + MapMarkerFeature: + type: object + description: Single marker list entry + properties: + elevation: + description: the marker elevation in ft + type: number + example: 0 + ident: + description: The marker ident (ICAO) + type: string + example: "AL" + type: + description: The marker type + type: string + example: "OUTER" + position: + description: The airports geographical position + $ref: '#/components/schemas/Coordinates' From b3330c5f2c6e9f87c42a82ca93a2c057ce215bbd Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Mon, 13 Dec 2021 13:25:30 +0100 Subject: [PATCH 16/29] Adapt renamed methods of MapPaintWidget - setShowMapFeatures -> setShowMapObject - setShowMapFeaturesDisplay -> setShowMapObjectDisplay --- src/webapi/mapactionscontroller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index 969665361..8c2550831 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -253,8 +253,8 @@ MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo mapPaintWidget->showRectStreamlined(rect, false); // Disable dynamic/live features - mapPaintWidget->setShowMapFeatures(map::AIRCRAFT_ALL,false); - mapPaintWidget->setShowMapFeaturesDisplay(map::AIRCRAFT_TRACK,false); + mapPaintWidget->setShowMapObject(map::AIRCRAFT_ALL,false); + mapPaintWidget->setShowMapObjectDisplay(map::AIRCRAFT_TRACK,false); // Disable copyright note mapPaintWidget->setPaintCopyright(false); From 27cd181f4ac34757cd0a605ac81f4a0d9a1fc563 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Mon, 13 Dec 2021 13:27:12 +0100 Subject: [PATCH 17/29] Adapt renamed methods of MapPaintWidget - setShowMapFeatures -> setShowMapObject - setShowMapFeaturesDisplay -> setShowMapObjectDisplay (cherry picked from commit b3330c5f2c6e9f87c42a82ca93a2c057ce215bbd) --- src/webapi/mapactionscontroller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index f5844f44c..94deb9d6e 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -286,8 +286,8 @@ MapPixmap MapActionsController::getPixmapRect(int width, int height, atools::geo mapPaintWidget->showRectStreamlined(rect, false); // Disable dynamic/live features - mapPaintWidget->setShowMapFeatures(map::AIRCRAFT_ALL,false); - mapPaintWidget->setShowMapFeaturesDisplay(map::AIRCRAFT_TRACK,false); + mapPaintWidget->setShowMapObject(map::AIRCRAFT_ALL,false); + mapPaintWidget->setShowMapObjectDisplay(map::AIRCRAFT_TRACK,false); // Set detail factor mapPaintWidget->getMapPaintLayer()->setDetailFactor(detailFactor); From 3968661df741a61cf31085c6af08179f8d6cc335 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Mon, 13 Dec 2021 13:43:49 +0100 Subject: [PATCH 18/29] Add degree unit argument to get*ByRect conversions - https://github.com/albar965/littlenavmap/issues/790#issuecomment-947781212 --- src/query/mapquery.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/query/mapquery.cpp b/src/query/mapquery.cpp index 8117faabe..fc536ff76 100644 --- a/src/query/mapquery.cpp +++ b/src/query/mapquery.cpp @@ -824,7 +824,7 @@ const QList *MapQuery::getVors(const GeoDataLatLonBox& rect, const const QList *MapQuery::getVorsByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, bool lazy, bool& overflow) { - const GeoDataLatLonBox latLonBox = GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest()); + const GeoDataLatLonBox latLonBox = GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest(), GeoDataCoordinates::Degree); return getVors(latLonBox,mapLayer,lazy,overflow); } @@ -860,7 +860,7 @@ const QList *MapQuery::getNdbs(const GeoDataLatLonBox& rect, const const QList *MapQuery::getNdbsByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, bool lazy, bool& overflow) { - const GeoDataLatLonBox latLonBox = GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest()); + const GeoDataLatLonBox latLonBox = GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest(), GeoDataCoordinates::Degree); return getNdbs(latLonBox,mapLayer,lazy,overflow); } @@ -994,7 +994,7 @@ const QList *MapQuery::getMarkers(const GeoDataLatLonBox& rect, const QList *MapQuery::getMarkersByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, bool lazy, bool& overflow) { - const GeoDataLatLonBox latLonBox = GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest()); + const GeoDataLatLonBox latLonBox = GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest(), GeoDataCoordinates::Degree); return getMarkers(latLonBox,mapLayer,lazy,overflow); } From 734e132f630cce66a2653a9310acb59702c1bf81 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Mon, 13 Dec 2021 14:33:20 +0100 Subject: [PATCH 19/29] Adapt MapQuery changes - https://github.com/albar965/littlenavmap/commit/aae02c4d29be73f523b8b2b145bbdde16a9f4c4f --- src/query/mapquery.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/query/mapquery.cpp b/src/query/mapquery.cpp index fc536ff76..7df9037c0 100644 --- a/src/query/mapquery.cpp +++ b/src/query/mapquery.cpp @@ -769,28 +769,13 @@ const QList *MapQuery::getAirportsByRect(const atools::geo::Rec // Get flags for running separate queries for add-on and normal airports bool addon = types.testFlag(map::AIRPORT_ADDON); - bool normal = types & (map::AIRPORT_HARD | map::AIRPORT_SOFT | map::AIRPORT_EMPTY); + bool normal = types & map::AIRPORT_ALL; airportCacheAddonFlag = addon; airportCacheNormalFlag = normal; - switch(mapLayer->getDataSource()) - { - case layer::ALL: - airportByRectQuery->bindValue(":minlength", mapLayer->getMinRunwayLength()); - return fetchAirports(latLonBox, airportByRectQuery, lazy, false /* overview */, addon, normal, overflow); - - case layer::MEDIUM: - // Airports > 4000 ft - return fetchAirports(latLonBox, airportMediumByRectQuery, lazy, true /* overview */, addon, normal, overflow); - - case layer::LARGE: - // Airports > 8000 ft - return fetchAirports(latLonBox, airportLargeByRectQuery, lazy, true /* overview */, addon, normal, overflow); - - } - return nullptr; - + airportByRectQuery->bindValue(":minlength", mapLayer->getMinRunwayLength()); + return fetchAirports(latLonBox, airportByRectQuery, lazy, false /* overview */, addon, normal, overflow); } const QList *MapQuery::getVors(const GeoDataLatLonBox& rect, const MapLayer *mapLayer, From 9ea04292a00ac4c470a8d525387fe31201e0adf0 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Thu, 16 Dec 2021 10:24:44 +0100 Subject: [PATCH 20/29] Add map object id's to map features action result --- src/common/jsoninfobuilder.cpp | 4 ++++ web/webapi.yaml | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/common/jsoninfobuilder.cpp b/src/common/jsoninfobuilder.cpp index 907ea7239..510ad1038 100644 --- a/src/common/jsoninfobuilder.cpp +++ b/src/common/jsoninfobuilder.cpp @@ -363,6 +363,7 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const map::MapAirport airport = data.airports[i]; + json["airports"]["result"][i]["id"] = airport.id; json["airports"]["result"][i]["ident"] = qUtf8Printable(airport.ident); json["airports"]["result"][i]["name"] = qUtf8Printable(airport.name); json["airports"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(airport.position)); @@ -384,6 +385,7 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const map::MapNdb ndb = data.ndbs[i]; + json["ndbs"]["result"][i]["id"] = ndb.id; json["ndbs"]["result"][i]["ident"] = qUtf8Printable(ndb.ident); json["ndbs"]["result"][i]["name"] = qUtf8Printable(ndb.name); json["ndbs"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(ndb.position)); @@ -395,6 +397,7 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const map::MapVor vor = data.vors[i]; + json["vors"]["result"][i]["id"] = vor.id; json["vors"]["result"][i]["ident"] = qUtf8Printable(vor.ident); json["vors"]["result"][i]["name"] = qUtf8Printable(vor.name); json["vors"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(vor.position)); @@ -406,6 +409,7 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const map::MapMarker marker = data.markers[i]; + json["markers"]["result"][i]["id"] = marker.id; json["markers"]["result"][i]["ident"] = qUtf8Printable(marker.ident); json["markers"]["result"][i]["type"] = qUtf8Printable(marker.type); json["markers"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(marker.position)); diff --git a/web/webapi.yaml b/web/webapi.yaml index 76d3b2da6..1641cfbf6 100644 --- a/web/webapi.yaml +++ b/web/webapi.yaml @@ -549,9 +549,19 @@ components: items: type: object $ref: '#/components/schemas/MapMarkerFeature' + MapObject: + type: object + description: Identifiable map object + properties: + id: + description: The record id + type: number + example: 1 MapAirportFeature: type: object description: Single airport list entry + allOf: + - $ref: '#/components/schemas/MapObject' properties: elevation: description: the airports elevation in ft @@ -571,6 +581,8 @@ components: MapNDBFeature: type: object description: Single NDB list entry + allOf: + - $ref: '#/components/schemas/MapObject' properties: elevation: description: the NDB elevation in ft @@ -590,6 +602,8 @@ components: MapVORFeature: type: object description: Single VOR list entry + allOf: + - $ref: '#/components/schemas/MapObject' properties: elevation: description: the VOR elevation in ft @@ -609,6 +623,8 @@ components: MapMarkerFeature: type: object description: Single marker list entry + allOf: + - $ref: '#/components/schemas/MapObject' properties: elevation: description: the marker elevation in ft From 54c769ace8f1dece5327a56e94cb0f2a481e7096 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Thu, 16 Dec 2021 11:51:08 +0100 Subject: [PATCH 21/29] Implement beasic get map feature by id action - Complement API contract - Implement querying map objects by object_id and type_id - Add object_id and type_id values to features action response --- src/common/abstractinfobuilder.cpp | 6 ++ src/common/abstractinfobuilder.h | 9 ++- src/common/jsoninfobuilder.cpp | 106 ++++++++++++++++++++++++++-- src/common/jsoninfobuilder.h | 1 + src/webapi/mapactionscontroller.cpp | 24 +++++++ src/webapi/mapactionscontroller.h | 8 ++- web/webapi.yaml | 36 +++++++++- 7 files changed, 181 insertions(+), 9 deletions(-) diff --git a/src/common/abstractinfobuilder.cpp b/src/common/abstractinfobuilder.cpp index 9c648934b..e65e432cb 100644 --- a/src/common/abstractinfobuilder.cpp +++ b/src/common/abstractinfobuilder.cpp @@ -66,6 +66,12 @@ QByteArray AbstractInfoBuilder::features(MapFeaturesData mapFeaturesData) const return "not implemented"; } +QByteArray AbstractInfoBuilder::feature(MapFeaturesData mapFeaturesData) const +{ + Q_UNUSED(mapFeaturesData); + return "not implemented"; +} + QString AbstractInfoBuilder::getHeadingsStringByMagVar(float heading, float magvar) const { diff --git a/src/common/abstractinfobuilder.h b/src/common/abstractinfobuilder.h index 9ae8fb024..cffc4fccc 100644 --- a/src/common/abstractinfobuilder.h +++ b/src/common/abstractinfobuilder.h @@ -71,12 +71,19 @@ class AbstractInfoBuilder : public QObject virtual QByteArray airport(AirportInfoData airportInfoData) const; /** - * Creates a description for the provided airport list. + * Creates a description for the provided feature list. * * @param airportInfoData */ virtual QByteArray features(MapFeaturesData mapFeaturesData) const; + /** + * Creates a description for the provided map object. + * + * @param airportInfoData + */ + virtual QByteArray feature(MapFeaturesData mapFeaturesData) const; + /** * Creates a description for the provided simconnect data. * diff --git a/src/common/jsoninfobuilder.cpp b/src/common/jsoninfobuilder.cpp index 510ad1038..56d849caf 100644 --- a/src/common/jsoninfobuilder.cpp +++ b/src/common/jsoninfobuilder.cpp @@ -363,7 +363,8 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const map::MapAirport airport = data.airports[i]; - json["airports"]["result"][i]["id"] = airport.id; + json["airports"]["result"][i]["object_id"] = airport.id; + json["airports"]["result"][i]["type_id"] = map::AIRPORT; json["airports"]["result"][i]["ident"] = qUtf8Printable(airport.ident); json["airports"]["result"][i]["name"] = qUtf8Printable(airport.name); json["airports"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(airport.position)); @@ -385,7 +386,8 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const map::MapNdb ndb = data.ndbs[i]; - json["ndbs"]["result"][i]["id"] = ndb.id; + json["ndbs"]["result"][i]["object_id"] = ndb.id; + json["ndbs"]["result"][i]["type_id"] = map::NDB; json["ndbs"]["result"][i]["ident"] = qUtf8Printable(ndb.ident); json["ndbs"]["result"][i]["name"] = qUtf8Printable(ndb.name); json["ndbs"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(ndb.position)); @@ -397,7 +399,8 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const map::MapVor vor = data.vors[i]; - json["vors"]["result"][i]["id"] = vor.id; + json["vors"]["result"][i]["object_id"] = vor.id; + json["vors"]["result"][i]["type_id"] = map::VOR; json["vors"]["result"][i]["ident"] = qUtf8Printable(vor.ident); json["vors"]["result"][i]["name"] = qUtf8Printable(vor.name); json["vors"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(vor.position)); @@ -409,7 +412,102 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const map::MapMarker marker = data.markers[i]; - json["markers"]["result"][i]["id"] = marker.id; + json["markers"]["result"][i]["object_id"] = marker.id; + json["markers"]["result"][i]["type_id"] = map::MARKER; + json["markers"]["result"][i]["ident"] = qUtf8Printable(marker.ident); + json["markers"]["result"][i]["type"] = qUtf8Printable(marker.type); + json["markers"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(marker.position)); + json["markers"]["result"][i]["elevation"] = marker.getPosition().getAltitude(); + + } + + return json.dump().data(); + +} + +QByteArray JsonInfoBuilder::feature(MapFeaturesData mapFeaturesData) const +{ + + MapFeaturesData data = mapFeaturesData; + + JSON json; + + json = { + { "airports", JSON::object() }, + { "ndbs", JSON::object() }, + { "vors", JSON::object() }, + { "markers", JSON::object() }, + }; + + json["airports"].push_back({ "count", data.airports.count() }); + json["airports"].push_back({ "result", JSON::array() }); + + json["ndbs"].push_back({ "count", data.ndbs.count() }); + json["ndbs"].push_back({ "result", JSON::array() }); + + json["vors"].push_back({ "count", data.vors.count() }); + json["vors"].push_back({ "result", JSON::array() }); + + json["markers"].push_back({ "count", data.markers.count() }); + json["markers"].push_back({ "result", JSON::array() }); + + + + for(int i = 0; i < data.airports.count(); ++i){ + + map::MapAirport airport = data.airports[i]; + + json["airports"]["result"][i]["object_id"] = airport.id; + json["airports"]["result"][i]["type_id"] = map::AIRPORT; + json["airports"]["result"][i]["ident"] = qUtf8Printable(airport.ident); + json["airports"]["result"][i]["name"] = qUtf8Printable(airport.name); + json["airports"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(airport.position)); + json["airports"]["result"][i]["elevation"] = airport.getPosition().getAltitude(); + +// JSON airportJson; + +// airportJson = { +// { "ident", qUtf8Printable(airport.ident) }, +// { "name", qUtf8Printable(airport.name)}, +// { "position", coordinatesToJSON(getCoordinates(airport.position))}, +// { "elevation", airport.getPosition().getAltitude() }, +// }; + +// json["airports"]["result"].push_back(airportJson); + } + + for(int i = 0; i < data.ndbs.count(); ++i){ + + map::MapNdb ndb = data.ndbs[i]; + + json["ndbs"]["result"][i]["object_id"] = ndb.id; + json["ndbs"]["result"][i]["type_id"] = map::NDB; + json["ndbs"]["result"][i]["ident"] = qUtf8Printable(ndb.ident); + json["ndbs"]["result"][i]["name"] = qUtf8Printable(ndb.name); + json["ndbs"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(ndb.position)); + json["ndbs"]["result"][i]["elevation"] = ndb.getPosition().getAltitude(); + + } + + for(int i = 0; i < data.vors.count(); ++i){ + + map::MapVor vor = data.vors[i]; + + json["vors"]["result"][i]["object_id"] = vor.id; + json["vors"]["result"][i]["type_id"] = map::VOR; + json["vors"]["result"][i]["ident"] = qUtf8Printable(vor.ident); + json["vors"]["result"][i]["name"] = qUtf8Printable(vor.name); + json["vors"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(vor.position)); + json["vors"]["result"][i]["elevation"] = vor.getPosition().getAltitude(); + + } + + for(int i = 0; i < data.markers.count(); ++i){ + + map::MapMarker marker = data.markers[i]; + + json["markers"]["result"][i]["object_id"] = marker.id; + json["markers"]["result"][i]["type_id"] = map::MARKER; json["markers"]["result"][i]["ident"] = qUtf8Printable(marker.ident); json["markers"]["result"][i]["type"] = qUtf8Printable(marker.type); json["markers"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(marker.position)); diff --git a/src/common/jsoninfobuilder.h b/src/common/jsoninfobuilder.h index 6f432232f..e39ea2b17 100644 --- a/src/common/jsoninfobuilder.h +++ b/src/common/jsoninfobuilder.h @@ -42,6 +42,7 @@ class JsonInfoBuilder : public AbstractInfoBuilder QByteArray siminfo(SimConnectInfoData simConnectInfoData) const override; QByteArray uiinfo(UiInfoData uiInfoData) const override; QByteArray features(MapFeaturesData mapFeaturesData) const override; + QByteArray feature(MapFeaturesData mapFeaturesData) const override; private: JSON coordinatesToJSON(QMap map) const; diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index 94deb9d6e..72c37a814 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -145,6 +145,30 @@ WebApiResponse MapActionsController::featuresAction(WebApiRequest request){ } +WebApiResponse MapActionsController::featureAction(WebApiRequest request){ + + WebApiResponse response = getResponse(); + + int object_id = request.parameters.value("object_id").toInt(); + int type_id = request.parameters.value("type_id").toInt(); + + map::MapResult result; + + mapPaintWidget->getMapQuery()->getMapObjectById(result,type_id,map::AIRSPACE_SRC_NONE,object_id,false); + + MapFeaturesData data = { + result.airports, + result.ndbs, + result.vors, + result.markers + }; + + response.body = infoBuilder->feature(data); + + return response; + +} + MapActionsController::~MapActionsController() { qDebug() << Q_FUNC_INFO; diff --git a/src/webapi/mapactionscontroller.h b/src/webapi/mapactionscontroller.h index afe8f6c63..861373932 100644 --- a/src/webapi/mapactionscontroller.h +++ b/src/webapi/mapactionscontroller.h @@ -39,13 +39,17 @@ class MapActionsController : public: Q_INVOKABLE MapActionsController(QObject *parent, bool verboseParam, AbstractInfoBuilder* infoBuilder); /** - * @brief get map image + * @brief get map image by rect */ Q_INVOKABLE WebApiResponse imageAction(WebApiRequest request); /** - * @brief get map features + * @brief get map features by rect */ Q_INVOKABLE WebApiResponse featuresAction(WebApiRequest request); + /** + * @brief get map feature by id + */ + Q_INVOKABLE WebApiResponse featureAction(WebApiRequest request); explicit MapActionsController(QWidget *parent, bool verboseParam); virtual ~MapActionsController() override; diff --git a/web/webapi.yaml b/web/webapi.yaml index 1641cfbf6..68b82d5ff 100644 --- a/web/webapi.yaml +++ b/web/webapi.yaml @@ -174,6 +174,34 @@ paths: application/json: schema: $ref: '#/components/schemas/MapFeaturesResponse' + /map/feature: + get: + tags: + - Map + summary: Get feature by map object id and object type id + operationId: mapFeatureAction + parameters: + - name: object_id + required: true + in: query + description: the map object id + schema: + type: number + example: 10 + - name: type_id + required: true + in: query + description: the map object type id + schema: + type: number + example: 1 + responses: + 200: + description: map feature list + content: + application/json: + schema: + $ref: '#/components/schemas/MapFeaturesResponse' /sim/info: get: tags: @@ -553,8 +581,12 @@ components: type: object description: Identifiable map object properties: - id: - description: The record id + object_id: + description: the map object id + type: number + example: 1 + type_id: + description: the map object type id type: number example: 1 MapAirportFeature: From 77b3eaa4e72cf8380c9097da39819433333a93ec Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Mon, 3 Jan 2022 13:23:16 +0100 Subject: [PATCH 22/29] Add waypoints to map features result --- src/common/infobuildertypes.h | 1 + src/common/jsoninfobuilder.cpp | 34 ++++++++++++++++++++++++++++- src/query/waypointtrackquery.cpp | 9 ++++++++ src/query/waypointtrackquery.h | 4 ++++ src/webapi/mapactionscontroller.cpp | 17 ++++++++++++--- web/webapi.yaml | 33 ++++++++++++++++++++++++++++ 6 files changed, 94 insertions(+), 4 deletions(-) diff --git a/src/common/infobuildertypes.h b/src/common/infobuildertypes.h index 66d37e96f..7c08d39cc 100644 --- a/src/common/infobuildertypes.h +++ b/src/common/infobuildertypes.h @@ -92,6 +92,7 @@ namespace InfoBuilderTypes { const QList ndbs; const QList vors; const QList markers; + const QList waypoints; }; } diff --git a/src/common/jsoninfobuilder.cpp b/src/common/jsoninfobuilder.cpp index 56d849caf..056a73919 100644 --- a/src/common/jsoninfobuilder.cpp +++ b/src/common/jsoninfobuilder.cpp @@ -343,6 +343,7 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const { "ndbs", JSON::object() }, { "vors", JSON::object() }, { "markers", JSON::object() }, + { "waypoints", JSON::object() }, }; json["airports"].push_back({ "count", data.airports.count() }); @@ -357,6 +358,9 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const json["markers"].push_back({ "count", data.markers.count() }); json["markers"].push_back({ "result", JSON::array() }); + json["waypoints"].push_back({ "count", data.waypoints.count() }); + json["waypoints"].push_back({ "result", JSON::array() }); + for(int i = 0; i < data.airports.count(); ++i){ @@ -421,6 +425,19 @@ QByteArray JsonInfoBuilder::features(MapFeaturesData mapFeaturesData) const } + for(int i = 0; i < data.waypoints.count(); ++i){ + + map::MapWaypoint waypoint = data.waypoints[i]; + + json["waypoints"]["result"][i]["object_id"] = waypoint.id; + json["waypoints"]["result"][i]["type_id"] = map::WAYPOINT; + json["waypoints"]["result"][i]["ident"] = qUtf8Printable(waypoint.ident); + json["waypoints"]["result"][i]["type"] = qUtf8Printable(waypoint.type); + json["waypoints"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(waypoint.position)); + json["waypoints"]["result"][i]["elevation"] = waypoint.getPosition().getAltitude(); + + } + return json.dump().data(); } @@ -437,6 +454,7 @@ QByteArray JsonInfoBuilder::feature(MapFeaturesData mapFeaturesData) const { "ndbs", JSON::object() }, { "vors", JSON::object() }, { "markers", JSON::object() }, + { "waypoints", JSON::object() }, }; json["airports"].push_back({ "count", data.airports.count() }); @@ -451,7 +469,8 @@ QByteArray JsonInfoBuilder::feature(MapFeaturesData mapFeaturesData) const json["markers"].push_back({ "count", data.markers.count() }); json["markers"].push_back({ "result", JSON::array() }); - + json["waypoints"].push_back({ "count", data.waypoints.count() }); + json["waypoints"].push_back({ "result", JSON::array() }); for(int i = 0; i < data.airports.count(); ++i){ @@ -515,6 +534,19 @@ QByteArray JsonInfoBuilder::feature(MapFeaturesData mapFeaturesData) const } + for(int i = 0; i < data.waypoints.count(); ++i){ + + map::MapWaypoint waypoint = data.waypoints[i]; + + json["waypoints"]["result"][i]["object_id"] = waypoint.id; + json["waypoints"]["result"][i]["type_id"] = map::WAYPOINT; + json["waypoints"]["result"][i]["ident"] = qUtf8Printable(waypoint.ident); + json["waypoints"]["result"][i]["type"] = qUtf8Printable(waypoint.type); + json["waypoints"]["result"][i]["position"] = coordinatesToJSON(getCoordinates(waypoint.position)); + json["waypoints"]["result"][i]["elevation"] = waypoint.getPosition().getAltitude(); + + } + return json.dump().data(); } diff --git a/src/query/waypointtrackquery.cpp b/src/query/waypointtrackquery.cpp index 72fa0ba68..0a3bc9ab7 100644 --- a/src/query/waypointtrackquery.cpp +++ b/src/query/waypointtrackquery.cpp @@ -117,6 +117,15 @@ void WaypointTrackQuery::getWaypoints(QList& waypoints, const } } +const QList WaypointTrackQuery::getWaypointsByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, + bool lazy, bool& overflow) +{ + const GeoDataLatLonBox latLonBox = GeoDataLatLonBox(rect.getNorth(),rect.getSouth(),rect.getEast(), rect.getWest(), GeoDataCoordinates::Degree); + QList waypoints = QList(); + getWaypoints(waypoints,latLonBox,mapLayer,lazy,overflow); + return waypoints; +} + const SqlRecord *WaypointTrackQuery::getWaypointInformation(int waypointId) { const SqlRecord *rec = waypointQuery->getWaypointInformation(waypointId); diff --git a/src/query/waypointtrackquery.h b/src/query/waypointtrackquery.h index 334d77624..f8207f74b 100644 --- a/src/query/waypointtrackquery.h +++ b/src/query/waypointtrackquery.h @@ -79,6 +79,10 @@ class WaypointTrackQuery void getWaypointsRect(QVector& waypoints, const atools::geo::Pos& pos, float distanceNm); void getWaypointRectNearest(map::MapWaypoint& waypoint, const atools::geo::Pos& pos, float distanceNm); + /* Wrapper for getWaypoints usage by atools Rect */ + const QList getWaypointsByRect(const atools::geo::Rect& rect, const MapLayer *mapLayer, + bool lazy, bool& overflow); + /* Similar to getAirports */ void getWaypoints(QList& waypoints, const Marble::GeoDataLatLonBox& rect, const MapLayer *mapLayer, bool lazy, bool& overflow); diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index 72c37a814..1ee7b6ffa 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -23,6 +23,7 @@ #include #include "query/mapquery.h" +#include "query/waypointtrackquery.h" #include "mapgui/mappaintwidget.h" #include "mappainter/mappaintlayer.h" #include "mapgui/mapwidget.h" @@ -131,12 +132,14 @@ WebApiResponse MapActionsController::featuresAction(WebApiRequest request){ const QList ndbs = *mapPaintWidget->getMapQuery()->getNdbsByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,overflow); const QList vors = *mapPaintWidget->getMapQuery()->getVorsByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,overflow); const QList markers = *mapPaintWidget->getMapQuery()->getMarkersByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,overflow); + const QList waypoints = mapPaintWidget->getWaypointTrackQuery()->getWaypointsByRect(rect,mapPaintWidget->getMapPaintLayer()->getMapLayer(), false,overflow); MapFeaturesData data = { airports, ndbs, vors, - markers + markers, + waypoints }; response.body = infoBuilder->features(data); @@ -154,13 +157,21 @@ WebApiResponse MapActionsController::featureAction(WebApiRequest request){ map::MapResult result; - mapPaintWidget->getMapQuery()->getMapObjectById(result,type_id,map::AIRSPACE_SRC_NONE,object_id,false); + switch (type_id) { + case map::WAYPOINT: + result.waypoints.append(mapPaintWidget->getWaypointTrackQuery()->getWaypointById(object_id)); + break; + default: + mapPaintWidget->getMapQuery()->getMapObjectById(result,type_id,map::AIRSPACE_SRC_NONE,object_id,false); + break; + } MapFeaturesData data = { result.airports, result.ndbs, result.vors, - result.markers + result.markers, + result.waypoints }; response.body = infoBuilder->feature(data); diff --git a/web/webapi.yaml b/web/webapi.yaml index 68b82d5ff..fdac51ae9 100644 --- a/web/webapi.yaml +++ b/web/webapi.yaml @@ -577,6 +577,18 @@ components: items: type: object $ref: '#/components/schemas/MapMarkerFeature' + waypoints: + description: markers list + type: object + properties: + count: + type: number + example: 361 + result: + type: array + items: + type: object + $ref: '#/components/schemas/MapWaypointFeature' MapObject: type: object description: Identifiable map object @@ -673,3 +685,24 @@ components: position: description: The airports geographical position $ref: '#/components/schemas/Coordinates' + MapWaypointFeature: + type: object + description: Single waypoint list entry + allOf: + - $ref: '#/components/schemas/MapObject' + properties: + elevation: + description: the marker elevation in ft + type: number + example: 0 + ident: + description: The marker ident (ICAO) + type: string + example: "AL" + type: + description: The marker type + type: string + example: "OUTER" + position: + description: The airports geographical position + $ref: '#/components/schemas/Coordinates' From 02356fb016a231934a55da6ba1b95150fb5dc311 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Mon, 7 Mar 2022 12:23:38 +0100 Subject: [PATCH 23/29] Add wind direction and speed to sim info response --- src/common/infobuildertypes.h | 2 ++ src/common/jsoninfobuilder.cpp | 2 ++ src/webapi/simactionscontroller.cpp | 9 ++++++++- web/webapi.yaml | 9 +++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/common/infobuildertypes.h b/src/common/infobuildertypes.h index 7c08d39cc..0007a04a3 100644 --- a/src/common/infobuildertypes.h +++ b/src/common/infobuildertypes.h @@ -72,6 +72,8 @@ namespace InfoBuilderTypes { */ struct SimConnectInfoData{ const SimConnectData* data; + const float windSpeed; + const float windDir; }; /** diff --git a/src/common/jsoninfobuilder.cpp b/src/common/jsoninfobuilder.cpp index 056a73919..1eb6f1ffe 100644 --- a/src/common/jsoninfobuilder.cpp +++ b/src/common/jsoninfobuilder.cpp @@ -302,6 +302,8 @@ QByteArray JsonInfoBuilder::siminfo(SimConnectInfoData simconnectInfoData) const { "ground_altitude", data.getUserAircraft().getGroundAltitudeFt() }, { "altitude_above_ground", data.getUserAircraft().getAltitudeAboveGroundFt() }, { "heading", data.getUserAircraft().getHeadingDegMag() }, + { "wind_direction", simconnectInfoData.windDir }, + { "wind_speed", simconnectInfoData.windSpeed }, }; }else{ diff --git a/src/webapi/simactionscontroller.cpp b/src/webapi/simactionscontroller.cpp index 53fb12cc5..310711bc2 100644 --- a/src/webapi/simactionscontroller.cpp +++ b/src/webapi/simactionscontroller.cpp @@ -4,9 +4,11 @@ #include "common/abstractinfobuilder.h" #include "navapp.h" #include "atools.h" +#include "geo/calculations.h" #include "fs/sc/simconnectdata.h" using InfoBuilderTypes::SimConnectInfoData; +using atools::geo::normalizeCourse; SimActionsController::SimActionsController(QObject *parent, bool verboseParam, AbstractInfoBuilder* infoBuilder) : AbstractLnmActionsController(parent, verboseParam, infoBuilder) @@ -26,8 +28,13 @@ Q_UNUSED(request) SimConnectData simConnectData = getSimConnectData(); + float windSpeed = simConnectData.getUserAircraft().getWindSpeedKts(); + float windDir = normalizeCourse(simConnectData.getUserAircraft().getWindDirectionDegT() - simConnectData.getUserAircraft().getMagVarDeg()); + SimConnectInfoData data = { - &simConnectData + &simConnectData, + windSpeed, + windDir }; response.body = infoBuilder->siminfo(data); diff --git a/web/webapi.yaml b/web/webapi.yaml index fdac51ae9..1cc1ad047 100644 --- a/web/webapi.yaml +++ b/web/webapi.yaml @@ -478,6 +478,7 @@ components: example: 178.37759399414062 heading: type: number + description: "degrees" example: 155.85145568847656 indicated_altitude: description: "ft" @@ -505,6 +506,14 @@ components: description: "fpm" type: number example: -4.088292598724365 + wind_direction: + description: "degrees corrected by aircrafts position magvar" + type: number + example: 50.69130325317383 + wind_speed: + description: "kts" + type: number + example: 4.874995708465576 UiInfoResponse: type: object description: Common UI info From f9bdd7bc01b6f99535525fd0532f461f2cf34ab5 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Mon, 7 Mar 2022 16:33:54 +0100 Subject: [PATCH 24/29] Fix merge issues/adapt changes --- src/webapi/abstractlnmactionscontroller.h | 4 ++-- src/webapi/mapactionscontroller.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/webapi/abstractlnmactionscontroller.h b/src/webapi/abstractlnmactionscontroller.h index d9ca921cb..8f67b8b16 100644 --- a/src/webapi/abstractlnmactionscontroller.h +++ b/src/webapi/abstractlnmactionscontroller.h @@ -73,8 +73,8 @@ class AbstractLnmActionsController : protected: // Main LNM objects NavApp* getNavApp(); - MapQuery* getMapQueryGui(); - WaypointTrackQuery* getWaypointTrackQueryGui(); + MapQuery* getMapQuery(); + WaypointTrackQuery* getWaypointTrackQuery(); InfoQuery* getInfoQuery(); AirportQuery* getAirportQuery(AirportQueryType type); MainWindow* getMainWindow(); diff --git a/src/webapi/mapactionscontroller.cpp b/src/webapi/mapactionscontroller.cpp index 1ee7b6ffa..5bf3d72c4 100644 --- a/src/webapi/mapactionscontroller.cpp +++ b/src/webapi/mapactionscontroller.cpp @@ -25,9 +25,11 @@ #include "query/mapquery.h" #include "query/waypointtrackquery.h" #include "mapgui/mappaintwidget.h" +#include "mapgui/mapthemehandler.h" #include "mappainter/mappaintlayer.h" #include "mapgui/mapwidget.h" #include "navapp.h" +#include "common/mapresult.h" #include #include @@ -88,7 +90,7 @@ WebApiResponse MapActionsController::imageAction(WebApiRequest request){ qWarning() << Q_FUNC_INFO << "invalid format"; // Add copyright/attributions to header - response.headers.insert("Image-Attributions", mapPaintWidget->getMapCopyright().toUtf8()); + response.headers.insert("Image-Attributions", getNavApp()->getMapThemeHandler()->getTheme(mapPaintWidget->getCurrentThemeIndex()).getCopyright().toUtf8()); response.status = 200; response.body = bytes; From 0d902e3855c1bd1469f36358ca8f769c368a888b Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Mon, 7 Mar 2022 17:56:33 +0100 Subject: [PATCH 25/29] Update OL build - source: https://github.com/KOKAProduktion/littlenavmap-openlayers/commit/d68a5205b7e0540347a19f45f2a210491eeb72f2 --- web/ol/index.bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ol/index.bundle.js b/web/ol/index.bundle.js index b0c0bbde4..68fa52e5a 100644 --- a/web/ol/index.bundle.js +++ b/web/ol/index.bundle.js @@ -1 +1 @@ -(()=>{var t={788:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(645),o=i.n(n)()((function(t){return t[1]}));o.push([t.id,'.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 2px solid blue;\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: rgba(0,60,136,0.3);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n.ol-scale-line-inner {\n border: 1px solid #eee;\n border-top: none;\n color: #eee;\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: #000000;\n float: right;\n z-Index: 10;\n}\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 12px;\n z-Index: 11;\n color: #000000;\n text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;\n}\n.ol-scale-text {\n position: absolute;\n font-size: 14px;\n text-align: center;\n bottom: 25px;\n color: #000000;\n text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;\n}\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-Index: 9;\n box-sizing: border-box;\n border: 1px solid black;\n}\n\n.ol-unsupported {\n display: none;\n}\n.ol-viewport, .ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n}\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n.ol-control {\n position: absolute;\n background-color: rgba(255,255,255,0.4);\n border-radius: 4px;\n padding: 2px;\n}\n.ol-control:hover {\n background-color: rgba(255,255,255,0.6);\n}\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: white;\n font-size: 1.14em;\n font-weight: bold;\n text-decoration: none;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: rgba(0,60,136,0.5);\n border: none;\n border-radius: 2px;\n}\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n.ol-compass {\n display: block;\n font-weight: normal;\n font-size: 1.2em;\n will-change: transform;\n}\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n background-color: rgba(0,60,136,0.7);\n}\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 0 .5em;\n color: #000;\n text-shadow: 0 0 2px #fff;\n}\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n.ol-attribution ul, .ol-attribution button {\n display: inline-block;\n}\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n.ol-attribution:not(.ol-collapsed) {\n background: rgba(255,255,255,0.8);\n}\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: inline-block;\n}\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid #7b98bc;\n height: 150px;\n margin: 2px;\n width: 150px;\n}\n.ol-overviewmap:not(.ol-collapsed) button{\n bottom: 1px;\n left: 2px;\n position: absolute;\n}\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n.ol-overviewmap:not(.ol-collapsed) {\n background: rgba(255,255,255,0.8);\n}\n.ol-overviewmap-box {\n border: 2px dotted rgba(0,60,136,0.7);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n',""]);const r=o},424:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(645),o=i.n(n)()((function(t){return t[1]}));o.push([t.id," #debug {\n display: none;\n position: absolute;\n width: 100px;\n height: 100px;\n left: 0;\n top: 0;\n background-color: rgba(255, 0, 0, 0.5);\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n }\n\n .map {\n width: 100%;\n height: 100%;\n }\n\n .ol-control button img {\n width: 25px;\n height: 25px;\n }\n\n .follow-control {\n top: 10px;\n right: .5em;\n }\n\n .follow-control.on {\n background-color: #639684;\n }\n\n .follow-control.off {}\n\n .refresh-control {\n top: 60px;\n right: .5em;\n }",""]);const r=o},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(n)for(var r=0;ro;){if(r-o>600){var a=r-o+1,l=n-o+1,h=Math.log(a),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(a-u)/a)*(l-a/2<0?-1:1);t(i,n,Math.max(o,Math.floor(n-l*u/a+c)),Math.min(r,Math.floor(n+(a-l)*u/a+c)),s)}var p=i[n],f=o,d=r;for(e(i,o,n),s(i[r],p)>0&&e(i,o,r);f0;)d--}0===s(i[o],p)?e(i,o,d):e(i,++d,r),d<=n&&(o=d+1),n<=d&&(r=d-1)}}(t,n,o||0,r||t.length-1,s||i)}function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,i,n,o,r){for(var s=[i,n];s.length;)if(!((n=s.pop())-(i=s.pop())<=o)){var a=i+Math.ceil((n-i)/o/2)*o;t(e,a,i,n,r),s.push(i,a,a,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,i=[];if(!f(t,e))return i;for(var n=this.toBBox,o=[];e;){for(var r=0;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)},n.prototype._split=function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),a=d(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},n.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,i){for(var n,o,r,a,l,h,c,p=1/0,f=1/0,d=e;d<=i-e;d++){var g=s(t,0,d,this.toBBox),_=s(t,d,i,this.toBBox),v=(o=g,r=_,void 0,void 0,void 0,void 0,a=Math.max(o.minX,r.minX),l=Math.max(o.minY,r.minY),h=Math.min(o.maxX,r.maxX),c=Math.min(o.maxY,r.maxY),Math.max(0,h-a)*Math.max(0,c-l)),y=u(g)+u(_);v=e;f--){var d=t.children[f];a(l,t.leaf?o(d):d),h+=c(l)}return h},n.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)a(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():r(t[e],this.toBBox)},n}()},379:(t,e,i)=>{"use strict";var n,o=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),r=[];function s(t){for(var e=-1,i=0;i{t.exports="data:image/svg+xml,%3csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' version='1.0' width='128' height='128' id='svg2' sodipodi:version='0.32' inkscape:version='0.91 r13725' sodipodi:docname='aircraft_small_user.svg' inkscape:output_extension='org.inkscape.output.svg.inkscape'%3e %3cmetadata id='metadata16'%3e %3crdf:RDF%3e %3ccc:Work rdf:about=''%3e %3cdc:format%3eimage/svg+xml%3c/dc:format%3e %3cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/%3e %3cdc:title/%3e %3c/cc:Work%3e %3c/rdf:RDF%3e %3c/metadata%3e %3csodipodi:namedview inkscape:window-height='735' inkscape:window-width='1073' inkscape:pageshadow='2' inkscape:pageopacity='0.0' guidetolerance='10.0' gridtolerance='10.0' objecttolerance='10.0' borderopacity='1.0' bordercolor='%23666666' pagecolor='%23ffffff' id='base' showgrid='false' inkscape:zoom='2.8875' inkscape:cx='1.0476778' inkscape:cy='65.135002' inkscape:window-x='515' inkscape:window-y='154' inkscape:current-layer='svg2' inkscape:window-maximized='0'/%3e %3cdefs id='defs4'%3e %3cinkscape:perspective sodipodi:type='inkscape:persp3d' inkscape:vp_x='0 : 10 : 1' inkscape:vp_y='0 : 1000 : 0' inkscape:vp_z='20 : 10 : 1' inkscape:persp3d-origin='10 : 6.6666667 : 1' id='perspective18'/%3e %3cfilter id='filter'%3e %3cfeGaussianBlur stdDeviation='0.4858' id='feGaussianBlur7'/%3e %3c/filter%3e %3c/defs%3e %3cpath style='fill:%23ffff00;fill-opacity:1;stroke:%23000000;stroke-width:5.2827301;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1' id='path13' d='m 64.321061,9.894986 c -3.403927,4.904341 -3.31629,4.79328 -4.848773,6.787338 -0.930048,1.631215 -2.329857,10.573931 -2.296198,14.687238 0.02089,2.552583 -0.165767,4.084366 -0.535967,4.397075 -0.312521,0.264032 -1.955246,1.083861 -3.645501,1.815777 -2.982352,1.291403 -3.732027,1.373484 -25.370713,2.81941 -17.135838,1.145053 -22.5286969,1.658918 -23.3310019,2.216614 -2.2245336,1.546326 -2.3121808,5.07125 -0.2901467,11.719857 l 1.043267,3.430023 52.8477186,8.884048 0.692335,29.494054 0.01971,6.40165 c -0.64265,0.19749 -2.132128,0.0181 -6.776943,0.4953 -4.644847,0.47728 -8.706195,1.10109 -9.025144,1.39052 -1.282344,1.16362 -0.192953,10.22934 1.22744,10.21594 2.24188,-0.0211 10.540611,1.09775 10.978887,1.4781 0.314502,0.2698 7.444817,1.235 10.190318,1.20909 2.745474,-0.0259 9.860468,-1.12385 10.168921,-1.40131 0.43221,-0.38854 8.711114,-1.66393 10.953002,-1.68511 1.420428,-0.0134 2.361236,-9.09834 1.060089,-10.23754 -0.325507,-0.28141 -4.394571,-0.8304 -9.046518,-1.21992 -4.651923,-0.38948 -6.789901,-0.12812 -7.435885,-0.31367 l -0.809377,-0.15912 1.585705,-35.798139 52.694174,-9.880328 0.98695,-3.449201 c 1.91291,-6.685769 1.7676,-10.208475 -0.48192,-11.712547 -0.8113,-0.542434 -6.21172,-0.954425 -23.36365,-1.775805 C 79.85281,38.667127 79.101952,38.599221 76.098902,37.364315 74.396938,36.664429 72.740928,35.875571 72.424256,35.61761 72.048971,35.311973 71.837318,33.783955 71.816418,31.231364 71.782757,27.118061 70.236785,18.203162 69.280184,16.589721 67.782945,14.906516 67.646504,14.859152 64.320983,9.895079 Z' inkscape:connector-curvature='0' sodipodi:nodetypes='ccscssscccccccscccscsccccccsscsccc'/%3e %3c/svg%3e"},441:t=>{t.exports="data:image/svg+xml,%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg width='100%25' height='100%25' viewBox='0 0 64 64' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cpath d='M52,36c0,11 -9,20 -20,20c-11,0 -20,-9 -20,-20c0,-9.7 6.9,-17.7 16,-19.6l0,7.6l14,-12l-14,-12l0,8.3c-13.6,1.9 -24,13.6 -24,27.7c0,15.4 12.6,28 28,28c15.4,0 28,-12.6 28,-28l-8,0Z' style='fill:%23fff;fill-rule:nonzero;'/%3e%3c/svg%3e"}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={id:n,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(379),e=i.n(t),n=i(788);e()(n.Z,{insert:"head",singleton:!1}),n.Z.locals;var o=i(424);e()(o.Z,{insert:"head",singleton:!1}),o.Z.locals;var r={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},s={};s[r.DEGREES]=2*Math.PI*6370997/360,s[r.FEET]=.3048,s[r.METERS]=1,s[r.USFEET]=1200/3937;const a=r,l=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||s[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function h(t,e,i){return Math.min(Math.max(t,e),i)}var u="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},c="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function p(t,e,i,n,o,r){var s=o-i,a=r-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=o,n=r):l>0&&(i+=s*l,n+=a*l)}return f(t,e,i,n)}function f(t,e,i,n){var o=i-t,r=n-e;return o*o+r*r}function d(t){return t*Math.PI/180}function g(t,e){var i=t%e;return i*e<0?i+e:i}function _(t,e,i){return t+i*(e-t)}var v,y=(v=function(t,e){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),m=6378137,x=Math.PI*m,w=[-x,-x,x,x],b=[-180,-85,180,85],S=m*Math.log(Math.tan(Math.PI/2)),C=function(t){function e(e){return t.call(this,{code:e,units:a.METERS,extent:w,global:!0,worldExtent:b,getPointResolution:function(t,e){return t/u(e[1]/m)}})||this}return y(e,t),e}(l),E=[new C("EPSG:3857"),new C("EPSG:102100"),new C("EPSG:102113"),new C("EPSG:900913"),new C("http://www.opengis.net/gml/srs/epsg.xml#3857")];var T=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),O=[-180,-90,180,90],R=6378137*Math.PI/180,I=function(t){function e(e,i){return t.call(this,{code:e,units:a.DEGREES,extent:O,axisOrientation:i,global:!0,metersPerUnit:R,worldExtent:O})||this}return T(e,t),e}(l),P=[new I("CRS:84"),new I("EPSG:4326","neu"),new I("urn:ogc:def:crs:OGC:1.3:CRS84"),new I("urn:ogc:def:crs:OGC:2:84"),new I("http://www.opengis.net/gml/srs/epsg.xml#4326","neu")],F={},M={};function L(t,e,i){var n=t.getCode(),o=e.getCode();n in M||(M[n]={}),M[n][o]=i}const A="top-left";function k(){return function(){throw new Error("Unimplemented abstract method.")}()}var D=0;function j(t){return t.ol_uid||(t.ol_uid=String(++D))}var z=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const G=function(t){function e(e){var i=this,n="Assertion failed. See https://openlayers.org/en/v"+"6.5.0".split("-")[0]+"/doc/errors/#"+e+" for details.";return(i=t.call(this,n)||this).code=e,i.name="AssertionError",i.message=n,i}return z(e,t),e}(Error);function W(t,e){if(!t)throw new G(e)}function X(t){for(var e=[1/0,1/0,-1/0,-1/0],i=0,n=t.length;io&&(l|=4),ar&&(l|=2),0===l&&(l=1),l}function H(t,e,i,n,o){return o?(o[0]=t,o[1]=e,o[2]=i,o[3]=n,o):[t,e,i,n]}function q(t){return H(1/0,1/0,-1/0,-1/0,t)}function J(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Q(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function $(t,e,i,n,o){for(;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function dt(t){return t[2]180)&&(i[0]=g(n+180,360)-180),i}function Et(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||Tt(t,e)===_t)&&i}function Tt(t,e){var i=function(t,e){var i;return t in M&&e in M[t]&&(i=M[t][e]),i}(t.getCode(),e.getCode());return i||(i=vt),i}function Ot(t,e){return Tt(mt(t),mt(e))}function Rt(t,e,i){return Ot(e,i)(t,void 0,t.length)}var It,Pt,Ft,Mt=null;function Lt(){return Mt}function At(t,e){return t}function kt(t,e){return t}function Dt(t,e){return t}function jt(t,e){return t}wt(E),wt(P),It=E,Pt=function(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;sS?a=S:a<-S&&(a=-S),r[s+1]=a}return r},Ft=function(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;se?1:t0){for(o=1;o=1024){var o=0;for(var r in t)0==(3&o++)&&(delete t[r],--e)}n=function(t){var e,i,n,o,r;if(Qt.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),Jt.exec(t)){var s,a=t.length-1;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),o=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(o=(o<<4)+o)),r=[e,i,n,o/255]}else 0==t.indexOf("rgba(")?ie(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),ie(r)):W(!1,14);return r}(i),t[i]=n,++e}return n}}();function ee(t){return Array.isArray(t)?t:te(t)}function ie(t){return t[0]=h(t[0]+.5|0,0,255),t[1]=h(t[1]+.5|0,0,255),t[2]=h(t[2]+.5|0,0,255),t[3]=h(t[3],0,1),t}function ne(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function oe(t,e,i){return e+":"+t+":"+(i?$t(i):"null")}var re=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var n=oe(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var o=oe(t,e,i);this.cache_[o]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}());const se=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),ae="propertychange";var le="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1,o=arguments.length;n0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=Bt,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(zt),de="change",ge="contextmenu",_e="click",ve="keydown",ye="keypress",me="resize",xe="touchmove",we="wheel";function be(t,e,i,n,o){if(n&&n!==t&&(i=i.bind(n)),o){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function Se(t,e,i,n){return be(t,e,i,n,!0)}function Ce(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),he(t))}var Ee=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Te=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return Ee(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(de)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}const qe=function(t){function e(e){var i=this,n=le({},e);delete n.source,(i=t.call(this,n)||this).mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addEventListener(Fe(Xe),i.handleSourcePropertyChange_);var o=e.source?e.source:null;return i.setSource(o),i}return Ue(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Xe)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Be},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ce(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=be(t,de,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ce(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ce(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=be(t,Ze,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);W(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=be(this,de,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Xe,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Ye);function Je(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function Qe(t,e){var i=Math.cos(e),n=Math.sin(e),o=t[0]*i-t[1]*n,r=t[1]*i+t[0]*n;return t[0]=o,t[1]=r,t}function $e(t,e){if(e.canWrapX()){var i=pt(e.getExtent()),n=function(t,e,i){var n=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]n[2])){var r=i||pt(n);o=Math.floor((t[0]-n[0])/r)}return o}(t,e,i);n&&(t[0]-=n*i)}return t}var ti=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function ei(t,e){re.expire()}const ii=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return ti(e,t),e.prototype.dispatchRenderEvent=function(t,e){k()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Ut(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ht(n,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,r,s,a){var l,h=e.viewState;function u(t,e,i,n){return o.call(r,e,t?i:null,n)}var c=h.projection,p=$e(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var d=pt(c.getExtent());f.push([-d,0],[d,0])}for(var g=e.layerStatesArray,_=g.length,v=[],y=[],m=0;m=0;--x){var w=g[x],b=w.layer;if(b.hasRenderer()&&He(w,h)&&s.call(a,b)){var S=b.getRenderer(),C=b.getSource();if(S&&C){var E=C.getWrapX()?p:t,T=u.bind(null,w.managed);y[0]=E[0]+f[m][0],y[1]=E[1]+f[m][1],l=S.forEachFeatureAtCoordinate(y,e,i,T,v)}if(l)return l}}if(0!==v.length){var O=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*O})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){return k()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,o,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,Zt,this,o,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){k()},e.prototype.scheduleExpireIconCache=function(t){re.canExpireCache()&&t.postRenderFunctions.push(ei)},e}(zt);var ni=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const oi=function(t){function e(e,i,n,o){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=n,r.context=o,r}return ni(e,t),e}(se);var ri="ol-hidden",si="ol-control",ai=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"),li=["style","variant","weight","size","lineHeight","family"],hi=function(t){var e=t.match(ai);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,o=li.length;n=0;--r)n[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,n=0;;++n){var o=i[n],r=e[n];if(!o&&!r)break;o!==r&&(o?r?t.insertBefore(r,o):(t.removeChild(o),--n):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent("postcompose",t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){for(var r=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],h=l.layer;if(h.hasRenderer()&&He(l,r)&&o(h)){var u=h.getRenderer().getDataAtPixel(t,e,i);if(u){var c=n(h,u);if(c)return c}}}},e}(ii),Yi="add",Zi="remove";var Ki=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Bi="length",Vi=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.element=i,o.index=n,o}return Ki(e,t),e}(se);const Ui=function(t){function e(e,i){var n=t.call(this)||this,o=i||{};if(n.unique_=!!o.unique,n.array_=e||[],n.unique_)for(var r=0,s=n.array_.length;r0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Ce(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(xe,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ce(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ce),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(fe),an="postrender",ln="layergroup",hn="size",un="target",cn="view";var pn=1/0;const fn=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,he(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){W(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=pn&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,o=e[t],r=i[t],s=t;t>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),h=lt;){var s=this.getParentIndex_(e);if(!(n[s]>r))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=o,n[e]=r},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,o=this.elements_,r=this.priorities_,s=0,a=o.length;for(e=0;e0;)n=(i=this.dequeue()[0]).getKey(),0!==i.getState()||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++o,i.load())},e}(fn),_n="Point",vn="LineString",yn="Polygon",mn="MultiPoint",xn="MultiLineString",wn="MultiPolygon",bn="GeometryCollection",Sn="Circle",Cn="center",En="resolution",Tn="rotation";function On(t,e,i){return function(n,o,r,s,a){if(n){var l=e?0:r[0]*o,u=e?0:r[1]*o,c=a?a[0]:0,p=a?a[1]:0,f=t[0]+l/2+c,d=t[2]-l/2+c,g=t[1]+u/2+p,_=t[3]-u/2+p;f>d&&(d=f=(d+f)/2),g>_&&(_=g=(_+g)/2);var v=h(n[0],f,d),y=h(n[1],g,_),m=30*o;return s&&i&&(v+=-m*Math.log(1+Math.max(0,f-n[0])/m)+m*Math.log(1+Math.max(0,n[0]-d)/m),y+=-m*Math.log(1+Math.max(0,g-n[1])/m)+m*Math.log(1+Math.max(0,n[1]-_)/m)),[v,y]}}}function Rn(t){return t}function In(t,e,i,n){var o=pt(e)/i[0],r=lt(e)/i[1];return n?Math.min(t,Math.max(o,r)):Math.min(t,Math.min(o,r))}function Pn(t,e,i){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),h(n,i/2,2*e)}function Fn(t,e,i,n,o){return function(r,s,a,l){if(void 0!==r){var u=n?In(t,n,a,o):t;return(void 0===i||i)&&l?Pn(r,u,e):h(r,e,u)}}}function Mn(t){return void 0!==t?0:void 0}function Ln(t){return void 0!==t?t:void 0}function An(t){return Math.pow(t,3)}function kn(t){return 1-An(1-t)}function Dn(t){return 3*t*t-2*t*t*t}function jn(t){return t}const zn="XY",Gn="XYZM";function Wn(t,e,i,n,o,r){for(var s=r||[],a=0,l=e;l1)a=i;else{if(p>0){for(var f=0;fo&&(o=h),r=a,s=l}return o}function qn(t,e,i,n,o,r,s,a,l,h,u){if(e==i)return h;var c,p;if(0===o){if((p=f(s,a,t[e],t[e+1]))0&&g>f)&&(d<0&&_0&&_>d)?(a=c,l=p):(r[s++]=a,r[s++]=l,h=a,u=l,a=c,l=p)}}return r[s++]=a,r[s++]=l,s}function to(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=e;a0;){for(var c=h.pop(),f=h.pop(),d=0,g=t[f],_=t[f+1],v=t[c],y=t[c+1],m=f+n;md&&(u=m,d=x)}d>o&&(l[(u-e)/n]=1,f+nr&&(h-a)*(r-l)-(o-a)*(u-l)>0&&s++:u<=r&&(h-a)*(r-l)-(o-a)*(u-l)<0&&s--,a=h,l=u}return 0!==s}function uo(t,e,i,n,o,r){if(0===i.length)return!1;if(!ho(t,e,i[0],n,o,r))return!1;for(var s=1,a=i.length;s=o[0]&&r[2]<=o[2]||r[1]>=o[1]&&r[3]<=o[3]||function(t,e,i,n,o){for(var r,s=[t[e],t[e+1]],a=[];e+n=s&&g<=l),n||!(4&r)||4&o||(n=(_=f-(p-l)*d)>=a&&_<=h),n||!(8&r)||8&o||(n=(g=p-(f-a)/d)>=s&&g<=l),n||!(16&r)||16&o||(n=(_=f-(p-s)*d)>=a&&_<=h)}return n}(o,t,e)})))}function po(t,e,i,n){for(;e0}function go(t,e,i,n,o){for(var r=void 0!==o&&o,s=0,a=i.length;sx&&uo(t,e,i,n,h=(u+c)/2,d)&&(m=h,x=w),u=c}return isNaN(m)&&(m=o[r]),s?(s.push(m,d,x),s):[m,d,x]}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new ao(this.getFlatInteriorPoint(),"XYM")},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new ro(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],o=0,r=0,s=i.length;rc&&f1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i),!this.isDef()){var n=arguments[i-1];return n.center&&this.setCenterInternal(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&wo(e,!0))}for(var o=Date.now(),r=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,l=[],h=0;h0},e.prototype.getInteracting=function(){return this.hints_[1]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(0,-this.hints_[0]);for(var e=0,i=this.animations_.length;e=0;--i){for(var n=this.animations_[i],o=!0,r=0,s=n.length;r0?l/a.duration:1;h>=1?(a.complete=!0,h=1):o=!1;var u=a.easing(h);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],f=c+u*(a.targetCenter[0]-c),d=p+u*(a.targetCenter[1]-p);this.targetCenter_=[f,d]}if(a.sourceResolution&&a.targetResolution){var _=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){var v=this.getViewportSize_(this.getRotation()),y=this.constraints_.resolution(_,0,v,!0);this.targetCenter_=this.calculateCenterZoom(y,a.anchor)}this.targetResolution_=_,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var m=1===u?g(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){var x=this.constraints_.rotation(m,!0);this.targetCenter_=this.calculateCenterRotate(x,a.anchor)}this.targetRotation_=m}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(o){this.animations_[i]=null,this.setHint(0,-1);var w=n[0].callback;w&&wo(w,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,n,o,r=this.getCenterInternal();return void 0!==r&&(Qe(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),o=e,(n=i)[0]+=+o[0],n[1]+=+o[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenterInternal(),o=this.getResolution();return void 0!==n&&void 0!==o&&(i=[e[0]-t*(e[0]-n[0])/o,e[1]-t*(e[1]-n[1])/o]),i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?At(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Cn)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Dt(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),i=this.getCenterInternal();W(i,1);var n=this.getResolution();W(void 0!==n,2);var o=this.getRotation();return W(void 0!==o,3),at(i,n,o,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(En)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(jt(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSize_(),n=pt(t)/i[0],o=lt(t)/i[1];return Math.max(n,o)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*o)}},e.prototype.getRotation=function(){return this.get(Tn)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/o}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),n=this.getCenterInternal(),o=this.padding;if(o){var r=this.getViewportSizeMinusPadding_();n=So(n,this.getViewportSize_(),[r[0]/2+o[3],r[1]/2+o[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var o=Wt(this.resolutions_,t,1);n=o,e=this.resolutions_[o],i=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=h(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,h(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(W(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))W(!dt(t),25),i=mo(n=jt(t,this.getProjection()));else if(t.getType()===Sn){var n;(i=mo(n=jt(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),rt(n))}else{var o=Lt();i=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(i,e)},e.prototype.fitInternal=function(t,e){var i=e||{},n=i.size;n||(n=this.getViewportSizeMinusPadding_());var o,r=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;o=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;for(var a=t.getFlatCoordinates(),l=this.getRotation(),h=Math.cos(-l),u=Math.sin(-l),c=1/0,p=1/0,f=-1/0,d=-1/0,g=t.getStride(),_=0,v=a.length;_=0;a--){var l=s[a];if(l.getMap()===this&&l.getActive()&&this.getTargetElement()&&(!l.handleEvent(t)||t.propagationStopped))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var o=t.viewHints;if(o[0]||o[1]){var r=!_i&&Date.now()-t.time>8;i=r?0:8,n=r?0:2}}e.getTilesLoading()0&&t[1]>0}(i)&&n&&n.isDef()){var s=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:at(a.center,a.resolution,a.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{}}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),o&&(!this.previousExtent_||!dt(this.previousExtent_)&&!J(r.extent,this.previousExtent_))&&(this.dispatchEvent(new $i("movestart",this,o)),this.previousExtent_=q(this.previousExtent_)),this.previousExtent_&&!r.viewHints[0]&&!r.viewHints[1]&&!J(r.extent,this.previousExtent_)&&(this.dispatchEvent(new $i("moveend",this,r)),Y(r.extent,this.previousExtent_))),this.dispatchEvent(new $i(an,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(ln,t)},e.prototype.setSize=function(t){this.set(hn,t)},e.prototype.setTarget=function(t){this.set(un,t)},e.prototype.setView=function(t){this.set(cn,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(Me);var Ro=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Io=function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return Ro(e,t),e.prototype.disposeInternal=function(){xi(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&xi(this.element);for(var e=0,i=this.listenerKeys.length;e0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Yt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,o=e.length;n0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:kn}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(ri);o||0!==i?o&&0!==i&&this.element.classList.remove(ri):this.element.classList.add(ri)}this.label_.style.transform=n}this.rotation_=i}},e}(Io);var Ao=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ko=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),target:n.target})||this;var o=void 0!==n.className?n.className:"ol-zoom",r=void 0!==n.delta?n.delta:1,s=void 0!==n.zoomInClassName?n.zoomInClassName:o+"-in",a=void 0!==n.zoomOutClassName?n.zoomOutClassName:o+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",h=void 0!==n.zoomOutLabel?n.zoomOutLabel:"−",u=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=u,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(_e,i.handleClick_.bind(i,r),!1);var f=document.createElement("button");f.className=a,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof h?document.createTextNode(h):h),f.addEventListener(_e,i.handleClick_.bind(i,-r),!1);var d=o+" ol-unselectable "+si,g=i.element;return g.className=d,g.appendChild(p),g.appendChild(f),i.duration_=void 0!==n.duration?n.duration:250,i}return Ao(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:kn})):e.setZoom(n)}}},e}(Io),Do="active";var jo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function zo(t,e,i,n){var o=t.getZoom();if(void 0!==o){var r=t.getConstrainedZoom(o+e),s=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==n?n:250,easing:kn})}}const Go=function(t){function e(e){var i=t.call(this)||this;return e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return jo(e,t),e.prototype.getActive=function(){return this.get(Do)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Do,t)},e.prototype.setMap=function(t){this.map_=t},e}(Me);var Wo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Xo=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return Wo(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==nn.DBLCLICK){var i=t.originalEvent,n=t.map,o=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;zo(n.getView(),r,o,this.duration_),i.preventDefault(),e=!0}return!e},e}(Go);var No=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Yo(t){for(var e=t.length,i=0,n=0,o=0;o0}}else if(t.type==nn.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==nn.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===nn.POINTERDOWN||e===nn.POINTERDRAG||e===nn.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==nn.POINTERUP?delete this.trackedPointers_[i]:(t.type==nn.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=ue(this.trackedPointers_)}},e}(Go);function Ko(t){var e=arguments;return function(t){for(var i=!0,n=0,o=e.length;n0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Zo);var nr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const or=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:Kt})||this).condition_=n.condition?n.condition:Bo,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return nr(e,t),e.prototype.handleDragEvent=function(t){if($o(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Mn){var n=e.getSize(),o=t.pixel,r=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=r-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!$o(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!(!$o(t)||!Ho(t)||!this.condition_(t)||(t.map.getView().beginInteraction(),this.lastAngle_=void 0,0))},e}(Zo);var rr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const sr=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return rr(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},e.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_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new yo([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(zt);var ar=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),lr=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.coordinate=i,o.mapBrowserEvent=n,o}return ar(e,t),e}(se);const hr=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.box_=new sr(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:Ho,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return ar(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new lr("boxdrag",t.coordinate,t))},e.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 lr(e?"boxend":"boxcancel",t.coordinate,t)),!1},e.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 lr("boxstart",t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Zo);var ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const cr=function(t){function e(e){var i=this,n=e||{},o=n.condition?n.condition:Jo;return(i=t.call(this,{condition:o,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return ur(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap(),i=e.getView(),n=e.getSize(),o=this.getGeometry().getExtent();if(this.out_){var r=i.calculateExtentInternal(n),s=function(t,e){return function(t,e){for(var i=0,n=e.length;i0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var o=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,o),this.initialVelocity_=Math.sqrt(o*o+r*r)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();var vr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yr="trackpad";const mr=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var o=n.condition?n.condition:Uo;return i.condition_=n.onFocusOnly?Ko(Vo,o):o,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return vr(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==we)return!0;var e,i=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==we&&(e=n.deltaY,ci&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=di),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?yr:"wheel");var r=i.getView();if(this.mode_===yr&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-h(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),zo(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Go);var xr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const wr=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Kt),(i=t.call(this,o)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return xr(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=o-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=o;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Mn){var l=s.getViewport().getBoundingClientRect(),h=Yo(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2&&(t.map.getView().endInteraction(this.duration_),1))},e.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}return!1},e}(Zo);var br=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Sr=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Kt),(i=t.call(this,o)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return br(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,r=i.clientY-n.clientY,s=Math.sqrt(o*o+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var h=a.getViewport().getBoundingClientRect(),u=Yo(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(u),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.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}return!1},e}(Zo);var Cr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Er=function(t){function e(e){return(e=le({},e)).controls||(e.controls=function(t){var e={},i=new Ui;return(void 0===e.zoom||e.zoom)&&i.push(new ko(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Lo(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Fo(e.attributionOptions)),i}()),e.interactions||(e.interactions=function(t){var e={onFocusOnly:!0}||{},i=new Ui,n=new _r(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new or),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Xo({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new ir({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new wr),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Sr({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new fr),i.push(new gr({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new mr({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new cr({duration:e.zoomDuration})),i}()),t.call(this,e)||this}return Cr(e,t),e.prototype.createRenderer=function(){return new Ni(this)},e}(Oo);var Tr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Or=function(t){function e(e,i,n){var o=t.call(this)||this,r=n||{};return o.tileCoord=e,o.state=i,o.interimTile=null,o.hifi=!0,o.key="",o.transition_=void 0===r.transition?250:r.transition,o.transitionStarts_={},o}return Tr(e,t),e.prototype.changed=function(){this.dispatchEvent(de)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(2==t.getState())return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(2==t.getState()){t.interimTile=null;break}1==t.getState()?e=t:0==t.getState()?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(3!==this.state&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){k()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:An(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(fe);var Rr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ir=function(t){function e(e,i,n,o){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=n,r.resolution=i,r.state=o,r}return Rr(e,t),e.prototype.changed=function(){this.dispatchEvent(de)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return k()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){k()},e}(fe);var Pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Fr(t,e,i){var n=t;if(n.src&&_i){var o=n.decode(),r=!0;return o.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var s=[Se(n,"load",e),Se(n,"error",i)];return function(){s.forEach(Ce)}}!function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,n,0)||this;return a.src_=o,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.state=0,a.imageLoadFunction_=s,a}Pr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=lt(this.extent)/this.image_.height),this.state=2,this.unlistenImage_(),this.changed()},e.prototype.load=function(){0!=this.state&&3!=this.state||(this.state=1,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Fr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Ir);var Mr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Lr=function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=o,a.src_=n,a.key=n,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.tileLoadFunction_=r,a}return Mr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){var t;this.state=3,this.unlistenImage_(),this.image_=((t=yi(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=2:this.state=4,this.unlistenImage_(),this.changed()},e.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Fr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Or),Ar=function(){function t(t,e,i,n,o,r){this.sourceProj_=t,this.targetProj_=e;var s={},a=Ot(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&pt(n)==pt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?pt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?pt(this.targetProj_.getExtent()):null;var l=ut(i),h=ct(i),u=ot(i),p=nt(i),f=this.transformInv_(l),d=this.transformInv_(h),g=this.transformInv_(u),_=this.transformInv_(p),v=10+(r?Math.max(0,Math.ceil(c(it(i)/(r*r*256*256)))):0);if(this.addQuad_(l,h,u,p,f,d,g,_,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,i){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i.5&&u<1,f=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(f=pt(X([t,e,i,n]))/this.targetWorldWidth_>.25||f),!p&&this.sourceProj_.isGlobal()&&u&&(f=u>.25||f)),!(!f&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||ft(h,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(o[0])&&isFinite(o[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var _=[(t[0]+i[0])/2,(t[1]+i[1])/2],v=this.transformInv_(_),y=void 0;y=p?(g(o[0],c)+g(s[0],c))/2-g(v[0],c):(o[0]+s[0])/2-v[0];var m=(o[1]+s[1])/2-v[1];f=y*y+m*m>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var x=[(e[0]+i[0])/2,(e[1]+i[1])/2],w=this.transformInv_(x),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],S=this.transformInv_(b);this.addQuad_(t,e,x,b,o,r,w,S,l-1),this.addQuad_(b,x,i,n,S,w,s,a,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(C),T=[(i[0]+n[0])/2,(i[1]+n[1])/2],O=this.transformInv_(T);this.addQuad_(t,C,T,n,o,E,O,a,l-1),this.addQuad_(C,e,i,T,E,r,s,O,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,i,n,o,s,a),0==(14&d)&&this.addTriangle_(t,i,e,o,s,r),d&&(0==(13&d)&&this.addTriangle_(e,n,t,r,a,o),0==(7&d)&&this.addTriangle_(e,n,i,r,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var o=e.source;Q(t,o[0]),Q(t,o[1]),Q(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();var kr,Dr={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function jr(t,e,i,n,o){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,o),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,o)),t.restore()}function zr(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Gr(t,e,i,n){var o=Rt(i,e,t),r=xt(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(r*=s);var a=t.getMetersPerUnit();void 0!==a&&(r/=a);var l=t.getExtent();if(!l||K(l,o)){var h=xt(t,r,o)/r;isFinite(h)&&h>0&&(r/=h)}return r}var Wr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Xr=function(t){function e(e,i,n,o,r,s,a,l,u,c,p,f){var d=t.call(this,r,0)||this;d.renderEdges_=void 0!==p&&p,d.contextOptions_=f,d.pixelRatio_=a,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=i,d.targetTileGrid_=o,d.wrappedTileCoord_=s||r,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var g=o.getTileCoordExtent(d.wrappedTileCoord_),_=d.targetTileGrid_.getExtent(),v=d.sourceTileGrid_.getExtent(),y=_?ht(g,_):g;if(0===it(y))return d.state=4,d;var m=e.getExtent();m&&(v=v?ht(v,m):m);var x=o.getResolution(d.wrappedTileCoord_[0]),w=function(t,e,i,n){var o=rt(i),r=Gr(t,e,o,n);return(!isFinite(r)||r<=0)&&et(i,(function(i){return r=Gr(t,e,i,n),isFinite(r)&&r>0})),r}(e,n,y,x);if(!isFinite(w)||w<=0)return d.state=4,d;var b=void 0!==c?c:.5;if(d.triangulation_=new Ar(e,n,y,v,w*b,x),0===d.triangulation_.getTriangles().length)return d.state=4,d;d.sourceZ_=i.getZForResolution(w);var S=d.triangulation_.calculateSourceExtent();if(v&&(e.canWrapX()?(S[1]=h(S[1],v[1],v[3]),S[3]=h(S[3],v[1],v[3])):S=ht(S,v)),it(S)){for(var C=i.getTileRangeForExtentAndZ(S,d.sourceZ_),E=C.minX;E<=C.maxX;E++)for(var T=C.minY;T<=C.maxY;T++){var O=u(d.sourceZ_,E,T,a);O&&d.sourceTiles_.push(O)}0===d.sourceTiles_.length&&(d.state=4)}else d.state=4;return d}return Wr(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&2==e.getState()&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=3;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],o="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=function(t,e,i,n,o,r,s,a,l,h,u,c){var p=yi(Math.round(i*t),Math.round(i*e));if(le(p,c),0===l.length)return p.canvas;function f(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){var n,o;n=d,(o=t.extent)[0]n[2]&&(n[2]=o[2]),o[1]n[3]&&(n[3]=o[3])}));var g=pt(d),_=lt(d),v=yi(Math.round(i*g/n),Math.round(i*_/n));le(v,c);var y=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-d[0],o=-(t.extent[3]-d[3]),r=pt(t.extent),s=lt(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*y,o*y,r*y,s*y)}));var m=ut(s);return a.getTriangles().forEach((function(t,e,o){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],g=s[1][1],_=s[2][0],y=s[2][1],x=f((a[0][0]-m[0])/r),w=f(-(a[0][1]-m[1])/r),b=f((a[1][0]-m[0])/r),S=f(-(a[1][1]-m[1])/r),C=f((a[2][0]-m[0])/r),E=f(-(a[2][1]-m[1])/r),T=l,O=h;l=0,h=0;var R=function(t){for(var e=t.length,i=0;io&&(o=s,n=r)}if(0===o)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[u-=T,g-=O,0,0,b-x],[_-=T,y-=O,0,0,C-x],[0,0,u,g,S-w],[0,0,_,y,E-w]]);if(R){if(p.save(),p.beginPath(),function(){if(void 0===kr){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",jr(t,4,5,4,0),jr(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;kr=zr(e,0)||zr(e,4)||zr(e,8)}return kr}()||c===Dr){p.moveTo(b,S);for(var I=x-b,P=w-S,F=0;F<4;F++)p.lineTo(b+f((F+1)*I/4),S+f(F*P/3)),3!=F&&p.lineTo(b+f((F+1)*I/4),S+f((F+1)*P/3));p.lineTo(C,E)}else p.moveTo(b,S),p.lineTo(x,w),p.lineTo(C,E);p.clip(),p.transform(R[0],R[2],R[1],R[3],x,w),p.translate(d[0]-T,d[3]-O),p.scale(n/i,-n/i),p.drawImage(v.canvas,0,0),p.restore()}})),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,o=(n[0][0]-m[0])/r,s=-(n[0][1]-m[1])/r,a=(n[1][0]-m[0])/r,l=-(n[1][1]-m[1])/r,h=(n[2][0]-m[0])/r,u=-(n[2][1]-m[1])/r;p.beginPath(),p.moveTo(a,l),p.lineTo(o,s),p.lineTo(h,u),p.closePath(),p.stroke()})),p.restore()),p.canvas}(n,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=2}this.changed()},e.prototype.load=function(){if(0==this.state){this.state=1,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var o=e.getState();if(0==o||1==o){t++;var r=be(e,de,(function(i){var n=e.getState();2!=n&&3!=n&&4!=n||(Ce(r),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,i){0==t.getState()&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ce),this.sourcesListenerKeys_=null},e}(Or),Nr=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return W(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return W(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){W(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Yr(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function Zr(t,e,i){return t+"/"+e+"/"+i}function Kr(t){return Zr(t[0],t[1],t[2])}var Br=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Vr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Br(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=(e=this.peekFirstKey(),e.split("/").map(Number))[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Kr(e.tileCoord)),e.release())}.bind(this))}var e},e}(Nr);var Ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Hr(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const qr=function(t){function e(e){var i=t.call(this)||this;return i.projection_=mt(e.projection),i.attributions_=Hr(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ve,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return Ur(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return k()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Hr(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Me);var Jr=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Qr(t,e,i,n,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=i,o.maxY=n,o):new Jr(t,e,i,n)}const $r=Jr;var ts=[0,0,0];const es=function(){function t(t){var e,i,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,W((e=this.resolutions_,!0,i=function(t,e){return e-t}||Gt,e.every((function(t,n){if(0===n)return!0;var o=i(e[n-1],t);return!(o>0||0===o)}))),17),!t.origins)for(var o=0,r=this.resolutions_.length-1;o=this.minZoom;){if(e(a,2===this.zoomFactor_?Qr(o=Math.floor(o/2),o,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]0?n:Math.max(s/a[0],r/a[1]),h=o+1,u=new Array(h),c=0;ci||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(n,o)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,n){},e}(qr),as=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return rs(e,t),e}(se);const ls=ss;function hs(t,e){var i=/\{z\}/g,n=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(o,s[2].toString()).replace(r,(function(){var t=s[0],i=e.getFullTileRange(t);return W(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}var us=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const cs=function(t){function e(i){var n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(n.tileUrlFunction=i.tileUrlFunction),n.urls=null,i.urls?n.setUrls(i.urls):i.url&&n.setUrl(i.url),n.tileLoadingKeys_={},n}return us(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=j(i),o=i.getState();1==o?(this.tileLoadingKeys_[n]=!0,e="tileloadstart"):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=3==o?"tileloaderror":2==o?"tileloadend":void 0),null!=e&&this.dispatchEvent(new as(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n=i[1].charCodeAt(0),o=i[2].charCodeAt(0),r=void 0;for(r=n;r<=o;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var i=t.length,n=new Array(i),o=0;oOpenStreetMap | © OpenTopoMap | Little Navmap '];const n=void 0!==e.crossOrigin?e.crossOrigin:void 0,o=[256,256],r=[256,300],s=void 0!==e.url?e.url+"api/map/image?format=png&quality=75&width="+o[0]+"&height="+o[1]:void 0;super({attributions:i,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:n,imageSmoothing:e.imageSmoothing,minZoom:void 0!==e.minZoom?e.minZoom:4,opaque:void 0===e.opaque||e.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:void 0,transition:e.transition,url:s,wrapX:e.wrapX,tileSize:[r[0],r[1]],projection:"EPSG:3857"}),this.setTileLoadFunction(this.defaultTileLoadFunction.bind(this))}defaultTileLoadFunction(t,e){const i=this.getTileGrid().getTileCoordExtent(t.getTileCoord()),n=Math.abs(i[2]-i[0])/6.6666,o=Ct([i[0]+n,i[1]+n],this.getProjection()),r=Ct([i[2]-n,i[3]-n],this.getProjection());t.getImage().src=e+"&leftlon="+o[0]+"&toplat="+o[1]+"&rightlon="+r[0]+"&bottomlat="+r[1]+"&reload="+Math.random()}getPixelRatio(){const t=this.tileGrid.getTileSize();return t[0]/t[1]}updateTileAtPixel(t,e){const i=e.getCoordinateFromPixel(t);this.updateTileAtLonLat(i,e)}updateTileAtLonLat(t,e){const i=this.tileGrid.getTileCoordForCoordAndZ(t,Math.round(e.getView().getZoom())),n=this.getTile(i[0],i[1],i[2],this.getPixelRatio(),this.getProjection());this.defaultTileLoadFunction(n,this.getUrls()[0]),setTimeout((()=>{e.renderSync()}),200)}}var ys=i(279),ms=i.n(ys);const xs=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Eo(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return k()},t.prototype.getImage=function(t){return k()},t.prototype.getHitDetectionImage=function(){return k()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return k()},t.prototype.getImageSize=function(){return k()},t.prototype.getHitDetectionImageSize=function(){return k()},t.prototype.getOrigin=function(){return k()},t.prototype.getSize=function(){return k()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Eo(t)},t.prototype.listenImageChange=function(t){k()},t.prototype.load=function(){k()},t.prototype.unlistenImageChange=function(t){k()},t}();function ws(t){return Array.isArray(t)?ne(t):t}var bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ss=function(t){function e(e){var i=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_={},i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.imageSize_=null,i.hitDetectionImageSize_=null,i.render(),i}return bs(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionCanvas_){var t=this.createRenderOptions();this.createHitDetectionCanvas_(t)}return this.hitDetectionCanvas_},e.prototype.getImage=function(t){if(!this.canvas_[t||1]){var e=this.createRenderOptions(),i=yi(e.size*t||1,e.size*t||1);this.draw_(e,i,0,0,t||1),this.canvas_[t||1]=i.canvas}return this.canvas_[t||1]},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return 2},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.createRenderOptions=function(){var t,e=Si,i=Ei,n=0,o=null,r=0,s=0;return this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Ti),t=ws(t),void 0===(s=this.stroke_.getWidth())&&(s=1),o=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),void 0===(i=this.stroke_.getLineJoin())&&(i=Ei),void 0===(e=this.stroke_.getLineCap())&&(e=Si),void 0===(n=this.stroke_.getMiterLimit())&&(n=10)),{strokeStyle:t,strokeWidth:s,size:2*(this.radius_+s)+1,lineCap:e,lineDash:o,lineDashOffset:r,lineJoin:i,miterLimit:n}},e.prototype.render=function(){var t=this.createRenderOptions(),e=yi(t.size,t.size);this.draw_(t,e,0,0,1),this.canvas_={},this.canvas_[1]=e.canvas;var i=e.canvas.width,n=i,o=this.getDisplacement();this.hitDetectionImageSize_=[t.size,t.size],this.createHitDetectionCanvas_(t),this.anchor_=[i/2-o[0],i/2+o[1]],this.size_=[i,i],this.imageSize_=[n,n]},e.prototype.draw_=function(t,e,i,n,o){var r,s,a;e.setTransform(o,0,0,o,0,0),e.translate(i,n),e.beginPath();var l=this.points_;if(l===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(l*=2),r=0;r<=l;r++)s=2*r*Math.PI/l-Math.PI/2+this.angle_,a=r%2==0?this.radius_:h,e.lineTo(t.size/2+a*Math.cos(s),t.size/2+a*Math.sin(s))}if(this.fill_){var u=this.fill_.getColor();null===u&&(u=bi),e.fillStyle=ws(u),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionCanvas_=this.getImage(1),this.fill_){var e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=ee(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var n=yi(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n,0,0)}}},e.prototype.drawHitDetectionCanvas_=function(t,e,i,n){e.translate(i,n),e.beginPath();var o=this.points_;if(o===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var r=void 0!==this.radius2_?this.radius2_:this.radius_;r!==this.radius_&&(o*=2);var s=void 0,a=void 0,l=void 0;for(s=0;s<=o;s++)l=2*s*Math.PI/o-Math.PI/2+this.angle_,a=s%2==0?this.radius_:r,e.lineTo(t.size/2+a*Math.cos(l),t.size/2+a*Math.sin(l))}e.fillStyle=bi,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e}(xs);var Cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Es=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return Cs(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Ss),Ts=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Os=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();var Rs=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Fs,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Fs,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}(),Is=null;function Ps(t,e){if(!Is){var i=new Ts({color:"rgba(255,255,255,0.4)"}),n=new Os({color:"#3399CC",width:1.25});Is=[new Rs({image:new Es({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return Is}function Fs(t){return t.getGeometry()}const Ms=Rs,Ls="fraction",As="pixels",ks="bottom-left",Ds="bottom-right",js="top-left",zs="top-right";var Gs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ws=null,Xs=function(t){function e(e,i,n,o,r,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==o&&(a.image_.crossOrigin=o),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=r,a.size_=n,a.src_=i,a.tainted_,a}return Gs(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&2===this.imageState_){Ws||(Ws=yi(1,1)),Ws.drawImage(this.image_,0,0);try{Ws.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Ws=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(de)},e.prototype.handleImageError_=function(){this.imageState_=3,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=2,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_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=yi(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(0==this.imageState_){this.imageState_=1;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Fr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){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 i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=$t(this.color_),i.fillRect(0,0,e.width,e.height),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var n=i.getImageData(0,0,e.width,e.height),o=n.data,r=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],h=0,u=o.length;h0,6);var c=void 0!==n.src?0:2;return i.color_=void 0!==n.color?ee(n.color):null,i.iconImage_=function(t,e,i,n,o,r){var s=re.get(e,n,r);return s||(s=new Xs(t,e,i,n,o,r),re.set(e,n,r,s)),s}(l,u,h,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:js,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return Ns(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Ls||this.anchorYUnits_==Ls){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Ls&&(t[0]*=e[0]),this.anchorYUnits_==Ls&&(t[1]*=e[1])}if(this.anchorOrigin_!=js){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=zs&&this.anchorOrigin_!=Ds||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=ks&&this.anchorOrigin_!=Ds||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=js){var i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;t=t.slice(),this.offsetOrigin_!=zs&&this.offsetOrigin_!=Ds||(t[0]=n[0]-i[0]-t[0]),this.offsetOrigin_!=ks&&this.offsetOrigin_!=Ds||(t[1]=n[1]-i[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(de,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(de,t)},e}(xs),Zs="preload",Ks="useInterimTilesOnError";var Bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Vs=function(t){function e(e){var i=this,n=e||{},o=le({},n);return delete o.preload,delete o.useInterimTilesOnError,(i=t.call(this,o)||this).setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return Bs(e,t),e.prototype.getPreload=function(){return this.get(Zs)},e.prototype.setPreload=function(t){this.set(Zs,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Ks)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Ks,t)},e}(qe);var Us=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Hs=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Us(e,t),e.prototype.getFeatures=function(t){return k()},e.prototype.prepareFrame=function(t){return k()},e.prototype.renderFrame=function(t,e){return k()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,o){var r=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,o,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){},e.prototype.getDataAtPixel=function(t,e,i){return k()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return 2!=e&&3!=e&&t.addEventListener(de,this.boundHandleImageChange_),0==e&&(t.load(),e=t.getState()),2==e},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ve&&t.changed()},e}(Te);var qs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Js=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return qs(e,t),e.prototype.useContainer=function(t,e,i){var n,o,r=this.getLayer().getClassName();if(t&&""===t.style.opacity&&t.className===r&&(a=t.firstElementChild)instanceof HTMLCanvasElement&&(o=a.getContext("2d")),!o||0!==o.canvas.width&&o.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=o,this.containerReused=!0),!this.container){(n=document.createElement("div")).className=r;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(o=yi()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=o}},e.prototype.clip=function(t,e,i){var n=e.pixelRatio,o=e.size[0]*n/2,r=e.size[1]*n/2,s=e.viewState.rotation,a=ut(i),l=ct(i),h=ot(i),u=nt(i);Vt(e.coordinateToPixelTransform,a),Vt(e.coordinateToPixelTransform,l),Vt(e.coordinateToPixelTransform,h),Vt(e.coordinateToPixelTransform,u),t.save(),Gi(t,-s,o,r),t.beginPath(),t.moveTo(a[0]*n,a[1]*n),t.lineTo(l[0]*n,l[1]*n),t.lineTo(h[0]*n,h[1]*n),t.lineTo(u[0]*n,u[1]*n),t.clip(),Gi(t,s,o,r)},e.prototype.clipUnrotated=function(t,e,i){var n=ut(i),o=ct(i),r=ot(i),s=nt(i);Vt(e.coordinateToPixelTransform,n),Vt(e.coordinateToPixelTransform,o),Vt(e.coordinateToPixelTransform,r),Vt(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;Vt(a,n),Vt(a,o),Vt(a,r),Vt(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var o=new oi(t,this.inversePixelTransform,i,e);n.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_("prerender",t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_("postrender",t,e)},e.prototype.getRenderTransform=function(t,e,i,n,o,r,s){var a=o/2,l=r/2,h=n/e,u=-h,c=-t[0]+s,p=-t[1];return Ut(this.tempTransform,a,l,h,u,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n,o=Vt(this.inversePixelTransform,t.slice()),r=this.context,s=this.getLayer().getExtent();if(s&&!K(s,Vt(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(o[0]),l=Math.round(o[1]),h=document.createElement("canvas"),u=h.getContext("2d");h.width=1,h.height=1,u.clearRect(0,0,1,1),u.drawImage(r.canvas,a,l,1,1,0,0,1,1),n=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:n}return 0===n[3]?null:n},e}(Hs);var Qs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),$s=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new $r(0,0,0,0),i}return Qs(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return 2==i||4==i||3==i&&!n},e.prototype.getTile=function(t,e,i,n){var o=n.pixelRatio,r=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,o,r);return 3==a.getState()&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(2)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,o=n.projection,r=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),p=u.getTileGridForProjection(o),f=p.getZForResolution(r,u.zDirection),d=p.getResolution(f),g=t.extent,_=i.extent&&jt(i.extent);_&&(g=ht(g,jt(i.extent)));var v=u.getTilePixelRatio(l),y=Math.round(t.size[0]*v),m=Math.round(t.size[1]*v);if(a){var x=Math.round(Math.sqrt(y*y+m*m));y=x,m=x}var w=d*y/2/v,b=d*m/2/v,S=[s[0]-w,s[1]-b,s[0]+w,s[1]+b],C=p.getTileRangeForExtentAndZ(g,f),E={};E[f]={};var T=this.createLoadedTileFinder(u,o,E),O=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(var I=C.minX;I<=C.maxX;++I)for(var P=C.minY;P<=C.maxY;++P){var F=this.getTile(f,I,P,t);if(this.isDrawableTile(F)){var M=j(this);if(2==F.getState()){E[f][F.tileCoord.toString()]=F;var L=F.inTransition(M);this.newTiles_||!L&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(M,t.time))continue}var A=p.getTileCoordChildTileRange(F.tileCoord,R,O),k=!1;A&&(k=T(f+1,A)),k||p.forEachTileCoordParentTileRange(F.tileCoord,T,R,O)}var D=d/r;Ut(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,a,-y/2,-m/2);var z=function(t){return gi?qt(t):(Wi||(Wi=yi(1,1).canvas),Wi.style.transform=qt(t),Wi.style.transform)}(this.pixelTransform);this.useContainer(e,z,i.opacity);var G=this.context,W=G.canvas;Ht(this.inversePixelTransform,this.pixelTransform),Ut(this.tempTransform,y/2,m/2,D,D,0,-y/2,-m/2),W.width!=y||W.height!=m?(W.width=y,W.height=m):this.containerReused||G.clearRect(0,0,y,m),_&&this.clipUnrotated(G,t,_),le(G,u.getContextOptions()),this.preRender(G,t),this.renderedTiles.length=0;var X,N,Y,Z=Object.keys(E).map(Number);Z.sort(Gt),1!==i.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(X=[],N=[]):Z=Z.reverse();for(var K=Z.length-1;K>=0;--K){var B=Z[K],V=u.getTilePixelSize(B,l,o),U=p.getResolution(B)/d,H=V[0]*U*D,q=V[1]*U*D,Q=p.getTileCoordForCoordAndZ(ut(S),B),$=p.getTileCoordExtent(Q),tt=Vt(this.tempTransform,[v*($[0]-S[0])/d,v*(S[3]-$[3])/d]),et=v*u.getGutterForProjection(o),it=E[B];for(var nt in it){var ot=(F=it[nt]).tileCoord,rt=tt[0]-(Q[1]-ot[1])*H,st=Math.round(rt+H),at=tt[1]-(Q[2]-ot[2])*q,lt=Math.round(at+q),ct=st-(I=Math.round(rt)),pt=lt-(P=Math.round(at)),ft=f===B;if(!(L=ft&&1!==F.getAlpha(j(this),t.time)))if(X){G.save(),Y=[I,P,I+ct,P,I+ct,P+pt,I,P+pt];for(var dt=0,gt=X.length;dtu&&this.instructions.push([fa.CUSTOM,u,o,t,i,to])):l==_n&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),o=this.coordinates.length,this.instructions.push([fa.CUSTOM,u,o,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[fa.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[fa.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,n,o=e.length,r=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[fa.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[fa.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,o=t.lineDash,r=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!Yt(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=r,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[fa.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Y(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;N(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(da);var va=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ya=function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return va(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([fa.DRAW_IMAGE,o,r,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([fa.DRAW_IMAGE,o,r,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)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([fa.DRAW_IMAGE,o,r,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([fa.DRAW_IMAGE,o,r,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)}},e.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,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),o=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=o,this.image_=r,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(_a);var ma=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const xa=function(t){function e(e,i,n,o){return t.call(this,e,i,n,o)||this}return ma(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var o=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[fa.MOVE_TO_LINE_TO,o,r];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([fa.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ca);var r=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(r,0,r.length,s),this.hitDetectionInstructions.push(ua),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([fa.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ca);for(var r=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,h=0,u=r.length;ht&&(v>_&&(_=v,d=y,g=r),v=0,y=r-o)),s=a,u=p,c=f),l=m,h=x}return(v+=a)>_?[y,r]:[d,g]}var Ca=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ea={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Ta={Circle:ba,Default:_a,Image:ya,LineString:xa,Polygon:ba,Text:function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Ca(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(i||n)){var r=this.coordinates,s=r.length,a=t.getType(),l=null,h=t.getStride();if("line"!==o.placement||a!=vn&&a!=xn&&a!=yn&&a!=wn){var u=o.overflow?null:[];switch(a){case _n:case mn:l=t.getFlatCoordinates();break;case vn:l=t.getFlatMidpoint();break;case Sn:l=t.getCenter();break;case xn:l=t.getFlatMidpoints(),h=2;break;case yn:l=t.getFlatInteriorPoint(),o.overflow||u.push(l[2]/this.resolution),h=3;break;case wn:var c=t.getFlatInteriorPoints();for(l=[],w=0,b=c.length;wI[2]}else T=w>O;var P,F=Math.PI,M=[],L=S+n===e;if(v=0,y=C,p=t[e=S],f=t[e+1],L){m();var A=Math.atan2(f-g,p-d);T&&(A+=A>0?-F:F);var k=(O+w)/2,D=(R+b)/2;return M[0]=[k,D,(E-r)/2,A,o],M}for(var j=0,z=o.length;j0?-F:F),void 0!==P){var W=G-P;if(W+=W>F?-2*F:W<-F?2*F:0,Math.abs(W)>s)return null}P=G;for(var X=j,N=0;jt?t-l:o,x=r+h>e?e-h:r,w=f[3]+m*c[0]+f[1],b=f[0]+x*c[1]+f[2],S=v-f[3],C=y-f[0];return(d||0!==u)&&(ja[0]=S,Wa[0]=S,ja[1]=C,za[1]=C,za[0]=S+w,Ga[0]=za[0],Ga[1]=C+b,Wa[1]=Ga[1]),0!==u?(Vt(_=Ut([1,0,0,1,0,0],i,n,1,1,u,-i,-n),ja),Vt(_,za),Vt(_,Ga),Vt(_,Wa),H(Math.min(ja[0],za[0],Ga[0],Wa[0]),Math.min(ja[1],za[1],Ga[1],Wa[1]),Math.max(ja[0],za[0],Ga[0],Wa[0]),Math.max(ja[1],za[1],Ga[1],Wa[1]),Da)):H(Math.min(S,S+w),Math.min(C,C+b),Math.max(S,S+w),Math.max(C,C+b),Da),p&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:m,drawImageH:x,originX:l,originY:h,declutterBox:{minX:Da[0],minY:Da[1],maxX:Da[2],maxY:Da[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,o,r,s){var a=!(!r&&!s),l=n.declutterBox,h=t.canvas,u=s?s[2]*n.scale[0]/2:0;return l.minX-u<=h.width/e&&l.maxX+u>=0&&l.minY-u<=h.height/e&&l.maxY+u>=0&&(a&&this.replayTextBackground_(t,ja,za,Ga,Wa,r,s),function(t,e,i,n,o,r,s,a,l,h,u){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(u[0],u[1]),function(t,e){for(var i=t.contextInstructions,n=0,o=i.length;nz&&(this.fill_(t),P=0),F>z&&(t.stroke(),F=0),P||F||(t.beginPath(),d=NaN,g=NaN),++O;break;case fa.CIRCLE:var W=l[I=G[1]],X=l[I+1],N=l[I+2]-W,Y=l[I+3]-X,Z=Math.sqrt(N*N+Y*Y);t.moveTo(W+Z,X),t.arc(W,X,Z,0,2*Math.PI,!0),++O;break;case fa.CLOSE_PATH:t.closePath(),++O;break;case fa.CUSTOM:I=G[1],c=G[2];var K=G[3],B=G[4],V=6==G.length?G[5]:void 0;j.geometry=K,j.feature=S,O in A||(A[O]=[]);var U=A[O];V?V(l,I,c,2,U):(U[0]=l[I],U[1]=l[I+1],U.length=2),B(U,j),++O;break;case fa.DRAW_IMAGE:I=G[1],c=G[2],y=G[3],p=G[4],f=G[5];var H=G[6],q=G[7],J=G[8],Q=G[9],$=G[10],tt=G[11],et=G[12],it=G[13],nt=G[14];if(!y&&G.length>=19){m=G[18],x=G[19],w=G[20],b=G[21];var ot=this.drawLabelWithPointPlacement_(m,x,w,b);y=ot.label,G[3]=y;var rt=G[22];p=(ot.anchorX-rt)*this.pixelRatio,G[4]=p;var st=G[23];f=(ot.anchorY-st)*this.pixelRatio,G[5]=f,H=y.height,G[6]=H,it=y.width,G[13]=it}var at=void 0;G.length>24&&(at=G[24]);var lt=void 0,ht=void 0,ut=void 0;G.length>16?(lt=G[15],ht=G[16],ut=G[17]):(lt=Ii,ht=!1,ut=!1),$&&D?tt+=k:$||D||(tt-=k);for(var ct=0;Ii)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+o)*e+(t+r))+3),o>0&&a.push(4*((t-o)*e+(t+r))+3),r>0&&(a.push(4*((t+o)*e+(t-r))+3),o>0&&a.push(4*((t-o)*e+(t-r))+3))}for(var l=[],h=(o=0,n.length);o0){if(!r||c!==Pa&&c!==La||-1!==r.indexOf(t)){var h=(p[a]-3)/4,f=n-h%s,d=n-(h/s|0),g=o(t,e,f*f+d*d);if(g)return g}u.clearRect(0,0,s,s);break}}var d,g,_,v,y,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(Gt),d=m.length-1;d>=0;--d){var x=m[d].toString();for(_=this.executorsByZIndex_[x],g=Ka.length-1;g>=0;--g)if(void 0!==(v=_[c=Ka[g]])&&(y=v.executeHitDetection(u,a,i,f,h)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],o=e[2],r=e[3],s=[i,n,i,r,o,r,o,n];return Wn(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return ce(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,o,r,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(Gt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,h,u,c,p,f,d=r||Ka;for(s&&a.reverse(),l=0,h=a.length;l0&&(s.width=0),this.container;var h=Math.round(t.size[0]*i),u=Math.round(t.size[1]*i);s.width!=h||s.height!=u?(s.width=h,s.height=u,s.style.transform!==o&&(s.style.transform=o)):this.containerReused||r.clearRect(0,0,h,u),this.preRender(r,t);var c=t.viewState,p=(c.projection,!1);if(n.extent&&this.clipping){var f=jt(n.extent);(p=!B(f,t.extent)&&ft(f,t.extent))&&this.clipUnrotated(r,t,f)}this.renderWorlds(a,t),p&&r.restore(),this.postRender(r,t);var d=n.opacity,g=this.container;return d!==parseFloat(g.style.opacity)&&(g.style.opacity=1===d?"":String(d)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];Vt(this.pixelTransform,i);var n=this.renderedCenter_,o=this.renderedResolution_,r=this.renderedRotation_,s=this.renderedProjection_,a=this.renderedExtent_,l=this.getLayer(),h=[],u=i[0]/2,c=i[1]/2;h.push(this.getRenderTransform(n,o,r,.5,u,c,0).slice());var p=l.getSource(),f=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!B(f,a)){for(var d=a[0],g=pt(f),_=0,v=void 0;df[2];)v=g*++_,h.push(this.getRenderTransform(n,o,r,.5,u,c,v).slice()),d-=g}this.hitDetectionImageData_=function(t,e,i,n,o,r,s){var a=yi(t[0]/2,t[1]/2);a.imageSmoothingEnabled=!1;for(var l=a.canvas,h=new qa(a,.5,o,null,s),u=i.length,c=Math.floor(16777215/u),p={},f=1;f<=u;++f){var d=i[f-1],g=d.getStyleFunction()||n;if(n){var _=g(d,r);if(_){Array.isArray(_)||(_=[_]);for(var v="#"+("000000"+(f*c).toString(16)).slice(-6),y=0,m=_.length;y=i[2])){var o=pt(i),r=Math.floor((n[0]-i[0])/o)*o;t[0]-=r,t[2]-=r}return t}(v[0],h);w[0]y[0]&&w[2]>y[2]&&v.push([w[0]-m,w[1],w[2]-m,w[3]])}if(!this.dirty_&&this.renderedResolution_==u&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&B(this.renderedExtent_,_))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var b,S=new Oa($a(u,c),_,u,c);this.getLayer().getDeclutter()&&(b=new Oa($a(u,c),_,u,c));var C,E=Lt();if(E){for(var T=0,O=v.length;T=200&&a.status<300){var n=e.getType(),l=void 0;"json"==n||"text"==n?l=a.responseText:"xml"==n?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):n==pl&&(l=a.response),l?r(e.readFeatures(l,{extent:i,featureProjection:o}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(t,e,i,n,o,(function(t,e){void 0!==r&&r(t),a.addFeatures(t)}),s||Bt)}}var dl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gl=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.feature=i,o.features=n,o}return dl(e,t),e}(se);const _l=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:Ve,wrapX:void 0===n.wrapX||n.wrapX})||this).loader_=Bt,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&(W(i.format_,7),i.loader_=fl(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:cl;var o,r,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new ll:null,i.loadedExtentsRtree_=new ll,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?r=n.features:n.features&&(r=(o=n.features).getArray()),s||void 0!==o||(o=new Ui(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==o&&i.bindFeaturesCollection_(o),i}return dl(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=j(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new gl(hl,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[be(e,de,this.handleFeatureChange_,this),be(e,ae,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(W(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],o=0,r=t.length;o',n.className="follow-control on ol-unselectable ol-control",n.appendChild(r),t.call(this,{element:n,target:o.target}),r.addEventListener("click",this.handleFollow.bind(this),!1)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.handleFollow=function(){i=!i,n.className=i?"follow-control on ol-unselectable ol-control":"follow-control off ol-unselectable ol-control",e()},o}(Io);var yl=i(441),ml=i.n(yl);const xl=function(t){var e,i=document.createElement("div");function n(n){var o=n||{};e=n.handleRefresh;var r=document.createElement("button");r.innerHTML='',i.className="refresh-control on ol-unselectable ol-control",i.appendChild(r),t.call(this,{element:i,target:o.target}),r.addEventListener("click",this.handleRefresh.bind(this),!1)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.handleRefresh=function(){e()},n}(Io);var wl="/";console.log("Starting production mode:",wl);var bl=new class{constructor(t,e){this.url=t,this.target=e,this.refreshInterval=1e3,this.sources=[new vs({url:this.url})],this.activesource=0,this.layers=[new ia({source:this.sources[0],className:"lnm-layer-0",visible:!0})],this.following=!0,this.initMap()}initMap(){const t=[new vl({handleFollow:()=>{this.following=!this.following}}),new xl({handleRefresh:()=>{this.sources.forEach((t=>{t.refresh()}))}}),new Fo({collapsible:!1})];this.setupAircraftFeature(),this.map=new Er({controls:t,layers:this.layers,target:this.target,view:new Co({minZoom:4})})}setupAircraftFeature(){this.aircraftFeature=new al({geometry:new ao([0,0])}),this.aircraftFeatureStyle=new Ms({image:new Ys({anchor:[.5,.5],anchorXUnits:"fraction",anchorYUnits:"fraction",src:ms(),scale:.5,opacity:0})}),this.aircraftFeature.setStyle(this.aircraftFeatureStyle);const t=new _l({features:[this.aircraftFeature]}),e=new rl({source:t});this.layers.push(e)}fetch(t,e,i){fetch(t).then((t=>t.text())).then((t=>e(t))).catch((t=>{i(t)}))}getAircraftPosition(t){this.fetch(this.url+"api/sim/info",(e=>{try{const i=JSON.parse(e);i.active?(this.setAircraftFeatureVisibility(!0),t([i.position.lon,i.position.lat],i.heading)):this.setAircraftFeatureVisibility(!1)}catch(t){console.log(t)}}),(t=>{console.log(t)}))}setAircraftFeatureVisibility(t){t&&0==this.aircraftFeature.getStyle().getImage().getOpacity()?this.aircraftFeature.getStyle().getImage().setOpacity(1):t||1!=this.aircraftFeature.getStyle().getImage().getOpacity()||this.aircraftFeature.getStyle().getImage().setOpacity(0)}ParseDMS(t){var e=t.split(/[^\d\w!.]+/),i=this.ConvertDMSToDD(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),e[3]);return[this.ConvertDMSToDD(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),e[7]),i]}ConvertDMSToDD(t,e,i,n){var o=t+e/60+i/3600;return"S"!=n&&"W"!=n||(o*=-1),o}startRefreshLoop(){setTimeout(this.refreshLoop.bind(this),this.refreshInterval)}refreshLoop(){this.getAircraftPosition(((t,e)=>{const i=St(t);this.aircraftFeature.setGeometry(new ao(i)),this.aircraftFeatureStyle.getImage().setRotation(this.degreesToRadians(e)),this.following&&this.map.getView().animate({center:i,duration:200})})),setTimeout(this.refreshLoop.bind(this),this.refreshInterval)}degreesToRadians(t){return t*(Math.PI/180)}toggleActiveSource(){this.activesource<1?(this.activesource=1,this.layers[1].setVisible(!0),this.layers[0].setVisible(!1)):(this.activesource=0,this.layers[0].setVisible(!0),this.layers[1].setVisible(!1))}}(wl,"map");window.onload=()=>{(t=>{var e=t.getView(),i=1,n=null,o=!1;document.body.onmousedown=function(){o=!0},document.body.onmouseup=function(){n=null,o=!1};var r=document.createElement("div");r.classList.add("pointer_overlay");var s="50px";r.style.position="absolute",r.style.left=s,r.style.right=s,r.style.top=s,r.style.bottom=s,document.body.append(r),r.addEventListener("mousemove",(function(i){if(o){if(n){var r=[n[0]-i.clientX,n[1]-i.clientY],s=t.getCoordinateFromPixel([i.clientX,i.clientY]),a=t.getCoordinateFromPixel([i.clientX-r[0],i.clientY-r[1]]);e.adjustCenter([s[0]-a[0],s[1]-a[1]])}n=[i.clientX,i.clientY]}})),r.addEventListener("wheel",(function(t){t.deltaY>0&&ie.getMinZoom()&&(i-=1),e.animate({zoom:i,duration:200})}))})(bl.map),bl.map.getView().setZoom(2),bl.map.getView().setCenter(St([0,0])),bl.startRefreshLoop()}})()})(); \ No newline at end of file +(()=>{var t={788:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(645),o=i.n(n)()((function(t){return t[1]}));o.push([t.id,'.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 2px solid blue;\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: rgba(0,60,136,0.3);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n.ol-scale-line-inner {\n border: 1px solid #eee;\n border-top: none;\n color: #eee;\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: #000000;\n float: right;\n z-Index: 10;\n}\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 12px;\n z-Index: 11;\n color: #000000;\n text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;\n}\n.ol-scale-text {\n position: absolute;\n font-size: 14px;\n text-align: center;\n bottom: 25px;\n color: #000000;\n text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;\n}\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-Index: 9;\n box-sizing: border-box;\n border: 1px solid black;\n}\n\n.ol-unsupported {\n display: none;\n}\n.ol-viewport, .ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n}\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n.ol-control {\n position: absolute;\n background-color: rgba(255,255,255,0.4);\n border-radius: 4px;\n padding: 2px;\n}\n.ol-control:hover {\n background-color: rgba(255,255,255,0.6);\n}\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: white;\n font-size: 1.14em;\n font-weight: bold;\n text-decoration: none;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: rgba(0,60,136,0.5);\n border: none;\n border-radius: 2px;\n}\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n.ol-compass {\n display: block;\n font-weight: normal;\n font-size: 1.2em;\n will-change: transform;\n}\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n background-color: rgba(0,60,136,0.7);\n}\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 0 .5em;\n color: #000;\n text-shadow: 0 0 2px #fff;\n}\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n.ol-attribution ul, .ol-attribution button {\n display: inline-block;\n}\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n.ol-attribution:not(.ol-collapsed) {\n background: rgba(255,255,255,0.8);\n}\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: inline-block;\n}\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid #7b98bc;\n height: 150px;\n margin: 2px;\n width: 150px;\n}\n.ol-overviewmap:not(.ol-collapsed) button{\n bottom: 1px;\n left: 2px;\n position: absolute;\n}\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n.ol-overviewmap:not(.ol-collapsed) {\n background: rgba(255,255,255,0.8);\n}\n.ol-overviewmap-box {\n border: 2px dotted rgba(0,60,136,0.7);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n',""]);const r=o},424:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(645),o=i.n(n)()((function(t){return t[1]}));o.push([t.id," #debug {\n display: none;\n position: absolute;\n width: 100px;\n height: 100px;\n left: 0;\n top: 0;\n background-color: rgba(255, 0, 0, 0.5);\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n }\n\n .map {\n width: 100%;\n height: 100%;\n }\n\n .ol-control button img {\n width: 25px;\n height: 25px;\n }\n\n .follow-control {\n top: 10px;\n right: .5em;\n }\n\n .follow-control.on {\n background-color: #639684;\n }\n\n .follow-control.off {}\n\n .refresh-control {\n top: 60px;\n right: .5em;\n }",""]);const r=o},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(n)for(var r=0;ro;){if(r-o>600){var a=r-o+1,l=n-o+1,h=Math.log(a),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(a-u)/a)*(l-a/2<0?-1:1);t(i,n,Math.max(o,Math.floor(n-l*u/a+c)),Math.min(r,Math.floor(n+(a-l)*u/a+c)),s)}var p=i[n],d=o,f=r;for(e(i,o,n),s(i[r],p)>0&&e(i,o,r);d0;)f--}0===s(i[o],p)?e(i,o,f):e(i,++f,r),f<=n&&(o=f+1),n<=f&&(r=f-1)}}(t,n,o||0,r||t.length-1,s||i)}function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,i,n,o,r){for(var s=[i,n];s.length;)if(!((n=s.pop())-(i=s.pop())<=o)){var a=i+Math.ceil((n-i)/o/2)*o;t(e,a,i,n,r),s.push(i,a,a,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,i=[];if(!d(t,e))return i;for(var n=this.toBBox,o=[];e;){for(var r=0;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)},n.prototype._split=function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),a=f(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},n.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,i){for(var n,o,r,a,l,h,c,p=1/0,d=1/0,f=e;f<=i-e;f++){var g=s(t,0,f,this.toBBox),_=s(t,f,i,this.toBBox),y=(o=g,r=_,void 0,void 0,void 0,void 0,a=Math.max(o.minX,r.minX),l=Math.max(o.minY,r.minY),h=Math.min(o.maxX,r.maxX),c=Math.min(o.maxY,r.maxY),Math.max(0,h-a)*Math.max(0,c-l)),v=u(g)+u(_);y=e;d--){var f=t.children[d];a(l,t.leaf?o(f):f),h+=c(l)}return h},n.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)a(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():r(t[e],this.toBBox)},n}()},379:(t,e,i)=>{"use strict";var n,o=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),r=[];function s(t){for(var e=-1,i=0;i{t.exports="data:image/svg+xml,%3csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' version='1.0' width='128' height='128' id='svg2' sodipodi:version='0.32' inkscape:version='0.91 r13725' sodipodi:docname='aircraft_small_user.svg' inkscape:output_extension='org.inkscape.output.svg.inkscape'%3e %3cmetadata id='metadata16'%3e %3crdf:RDF%3e %3ccc:Work rdf:about=''%3e %3cdc:format%3eimage/svg+xml%3c/dc:format%3e %3cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/%3e %3cdc:title/%3e %3c/cc:Work%3e %3c/rdf:RDF%3e %3c/metadata%3e %3csodipodi:namedview inkscape:window-height='735' inkscape:window-width='1073' inkscape:pageshadow='2' inkscape:pageopacity='0.0' guidetolerance='10.0' gridtolerance='10.0' objecttolerance='10.0' borderopacity='1.0' bordercolor='%23666666' pagecolor='%23ffffff' id='base' showgrid='false' inkscape:zoom='2.8875' inkscape:cx='1.0476778' inkscape:cy='65.135002' inkscape:window-x='515' inkscape:window-y='154' inkscape:current-layer='svg2' inkscape:window-maximized='0'/%3e %3cdefs id='defs4'%3e %3cinkscape:perspective sodipodi:type='inkscape:persp3d' inkscape:vp_x='0 : 10 : 1' inkscape:vp_y='0 : 1000 : 0' inkscape:vp_z='20 : 10 : 1' inkscape:persp3d-origin='10 : 6.6666667 : 1' id='perspective18'/%3e %3cfilter id='filter'%3e %3cfeGaussianBlur stdDeviation='0.4858' id='feGaussianBlur7'/%3e %3c/filter%3e %3c/defs%3e %3cpath style='fill:%23ffff00;fill-opacity:1;stroke:%23000000;stroke-width:5.2827301;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1' id='path13' d='m 64.321061,9.894986 c -3.403927,4.904341 -3.31629,4.79328 -4.848773,6.787338 -0.930048,1.631215 -2.329857,10.573931 -2.296198,14.687238 0.02089,2.552583 -0.165767,4.084366 -0.535967,4.397075 -0.312521,0.264032 -1.955246,1.083861 -3.645501,1.815777 -2.982352,1.291403 -3.732027,1.373484 -25.370713,2.81941 -17.135838,1.145053 -22.5286969,1.658918 -23.3310019,2.216614 -2.2245336,1.546326 -2.3121808,5.07125 -0.2901467,11.719857 l 1.043267,3.430023 52.8477186,8.884048 0.692335,29.494054 0.01971,6.40165 c -0.64265,0.19749 -2.132128,0.0181 -6.776943,0.4953 -4.644847,0.47728 -8.706195,1.10109 -9.025144,1.39052 -1.282344,1.16362 -0.192953,10.22934 1.22744,10.21594 2.24188,-0.0211 10.540611,1.09775 10.978887,1.4781 0.314502,0.2698 7.444817,1.235 10.190318,1.20909 2.745474,-0.0259 9.860468,-1.12385 10.168921,-1.40131 0.43221,-0.38854 8.711114,-1.66393 10.953002,-1.68511 1.420428,-0.0134 2.361236,-9.09834 1.060089,-10.23754 -0.325507,-0.28141 -4.394571,-0.8304 -9.046518,-1.21992 -4.651923,-0.38948 -6.789901,-0.12812 -7.435885,-0.31367 l -0.809377,-0.15912 1.585705,-35.798139 52.694174,-9.880328 0.98695,-3.449201 c 1.91291,-6.685769 1.7676,-10.208475 -0.48192,-11.712547 -0.8113,-0.542434 -6.21172,-0.954425 -23.36365,-1.775805 C 79.85281,38.667127 79.101952,38.599221 76.098902,37.364315 74.396938,36.664429 72.740928,35.875571 72.424256,35.61761 72.048971,35.311973 71.837318,33.783955 71.816418,31.231364 71.782757,27.118061 70.236785,18.203162 69.280184,16.589721 67.782945,14.906516 67.646504,14.859152 64.320983,9.895079 Z' inkscape:connector-curvature='0' sodipodi:nodetypes='ccscssscccccccscccscsccccccsscsccc'/%3e %3c/svg%3e"},441:t=>{t.exports="data:image/svg+xml,%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg width='100%25' height='100%25' viewBox='0 0 64 64' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cpath d='M52,36c0,11 -9,20 -20,20c-11,0 -20,-9 -20,-20c0,-9.7 6.9,-17.7 16,-19.6l0,7.6l14,-12l-14,-12l0,8.3c-13.6,1.9 -24,13.6 -24,27.7c0,15.4 12.6,28 28,28c15.4,0 28,-12.6 28,-28l-8,0Z' style='fill:%23fff;fill-rule:nonzero;'/%3e%3c/svg%3e"},964:t=>{t.exports="data:image/svg+xml,%3c!-- Created with Inkscape (http://www.inkscape.org/) --%3e %3csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' height='20' width='20' viewBox='0 0 20 20' id='svg2' version='1.1' inkscape:version='0.91 r13725' sodipodi:docname='windpointer.svg'%3e %3cdefs id='defs8' /%3e %3csodipodi:namedview pagecolor='%23ffffff' bordercolor='%23666666' borderopacity='1' objecttolerance='10' gridtolerance='10' guidetolerance='10' inkscape:pageopacity='0' inkscape:pageshadow='2' inkscape:window-width='1469' inkscape:window-height='961' id='namedview6' showgrid='true' units='px' showguides='false' inkscape:zoom='20.297462' inkscape:cx='7.2677431' inkscape:cy='13.60907' inkscape:window-x='38' inkscape:window-y='24' inkscape:window-maximized='0' inkscape:current-layer='svg2'%3e %3cinkscape:grid type='xygrid' id='grid3199' /%3e %3c/sodipodi:namedview%3e %3cmetadata id='metadata4'%3e %3crdf:RDF%3e %3ccc:Work rdf:about=''%3e %3cdc:format%3eimage/svg+xml%3c/dc:format%3e %3cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage' /%3e %3cdc:title%3e%3c/dc:title%3e %3c/cc:Work%3e %3c/rdf:RDF%3e %3c/metadata%3e %3cpath style='fill:%23ffff00;fill-rule:evenodd;stroke:%23000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;fill-opacity:1' d='M 10,0 15.043965,19.950733 10,15 4.9560346,19.950733 Z' id='path3241' inkscape:connector-curvature='0' sodipodi:nodetypes='ccccc' /%3e %3c/svg%3e"}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={id:n,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(379),e=i.n(t),n=i(788);e()(n.Z,{insert:"head",singleton:!1}),n.Z.locals;var o=i(424);e()(o.Z,{insert:"head",singleton:!1}),o.Z.locals;var r={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},s={};s[r.DEGREES]=2*Math.PI*6370997/360,s[r.FEET]=.3048,s[r.METERS]=1,s[r.USFEET]=1200/3937;const a=r,l=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||s[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function h(t,e,i){return Math.min(Math.max(t,e),i)}var u="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},c="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function p(t,e,i,n,o,r){var s=o-i,a=r-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=o,n=r):l>0&&(i+=s*l,n+=a*l)}return d(t,e,i,n)}function d(t,e,i,n){var o=i-t,r=n-e;return o*o+r*r}function f(t){return t*Math.PI/180}function g(t,e){var i=t%e;return i*e<0?i+e:i}function _(t,e,i){return t+i*(e-t)}var y,v=(y=function(t,e){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),m=6378137,x=Math.PI*m,w=[-x,-x,x,x],b=[-180,-85,180,85],S=m*Math.log(Math.tan(Math.PI/2)),C=function(t){function e(e){return t.call(this,{code:e,units:a.METERS,extent:w,global:!0,worldExtent:b,getPointResolution:function(t,e){return t/u(e[1]/m)}})||this}return v(e,t),e}(l),E=[new C("EPSG:3857"),new C("EPSG:102100"),new C("EPSG:102113"),new C("EPSG:900913"),new C("http://www.opengis.net/gml/srs/epsg.xml#3857")];var T=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),O=[-180,-90,180,90],I=6378137*Math.PI/180,R=function(t){function e(e,i){return t.call(this,{code:e,units:a.DEGREES,extent:O,axisOrientation:i,global:!0,metersPerUnit:I,worldExtent:O})||this}return T(e,t),e}(l),P=[new R("CRS:84"),new R("EPSG:4326","neu"),new R("urn:ogc:def:crs:OGC:1.3:CRS84"),new R("urn:ogc:def:crs:OGC:2:84"),new R("http://www.opengis.net/gml/srs/epsg.xml#4326","neu")],F={},M={};function k(t,e,i){var n=t.getCode(),o=e.getCode();n in M||(M[n]={}),M[n][o]=i}const L="top-left";function A(){return function(){throw new Error("Unimplemented abstract method.")}()}var D=0;function j(t){return t.ol_uid||(t.ol_uid=String(++D))}var z=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const G=function(t){function e(e){var i=this,n="Assertion failed. See https://openlayers.org/en/v"+"6.5.0".split("-")[0]+"/doc/errors/#"+e+" for details.";return(i=t.call(this,n)||this).code=e,i.name="AssertionError",i.message=n,i}return z(e,t),e}(Error);function W(t,e){if(!t)throw new G(e)}function X(t){for(var e=[1/0,1/0,-1/0,-1/0],i=0,n=t.length;io&&(l|=4),ar&&(l|=2),0===l&&(l=1),l}function H(t,e,i,n,o){return o?(o[0]=t,o[1]=e,o[2]=i,o[3]=n,o):[t,e,i,n]}function q(t){return H(1/0,1/0,-1/0,-1/0,t)}function J(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Q(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function $(t,e,i,n,o){for(;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ft(t){return t[2]180)&&(i[0]=g(n+180,360)-180),i}function Et(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||Tt(t,e)===_t)&&i}function Tt(t,e){var i=function(t,e){var i;return t in M&&e in M[t]&&(i=M[t][e]),i}(t.getCode(),e.getCode());return i||(i=yt),i}function Ot(t,e){return Tt(mt(t),mt(e))}function It(t,e,i){return Ot(e,i)(t,void 0,t.length)}var Rt,Pt,Ft,Mt=null;function kt(){return Mt}function Lt(t,e){return t}function At(t,e){return t}function Dt(t,e){return t}function jt(t,e){return t}wt(E),wt(P),Rt=E,Pt=function(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;sS?a=S:a<-S&&(a=-S),r[s+1]=a}return r},Ft=function(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;se?1:t0){for(o=1;o=1024){var o=0;for(var r in t)0==(3&o++)&&(delete t[r],--e)}n=function(t){var e,i,n,o,r;if(Qt.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),Jt.exec(t)){var s,a=t.length-1;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),o=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(o=(o<<4)+o)),r=[e,i,n,o/255]}else 0==t.indexOf("rgba(")?ie(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),ie(r)):W(!1,14);return r}(i),t[i]=n,++e}return n}}();function ee(t){return Array.isArray(t)?t:te(t)}function ie(t){return t[0]=h(t[0]+.5|0,0,255),t[1]=h(t[1]+.5|0,0,255),t[2]=h(t[2]+.5|0,0,255),t[3]=h(t[3],0,1),t}function ne(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function oe(t,e,i){return e+":"+t+":"+(i?$t(i):"null")}var re=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var n=oe(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var o=oe(t,e,i);this.cache_[o]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}());const se=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),ae="propertychange";var le="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1,o=arguments.length;n0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=Kt,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(zt),fe="change",ge="contextmenu",_e="click",ye="keydown",ve="keypress",me="resize",xe="touchmove",we="wheel";function be(t,e,i,n,o){if(n&&n!==t&&(i=i.bind(n)),o){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function Se(t,e,i,n){return be(t,e,i,n,!0)}function Ce(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),he(t))}var Ee=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Te=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return Ee(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(fe)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}const qe=function(t){function e(e){var i=this,n=le({},e);delete n.source,(i=t.call(this,n)||this).mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addEventListener(Fe(Xe),i.handleSourcePropertyChange_);var o=e.source?e.source:null;return i.setSource(o),i}return Ue(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Xe)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Ke},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ce(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=be(t,fe,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ce(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ce(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=be(t,Ze,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);W(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=be(this,fe,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Xe,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Ne);function Je(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Qe(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function $e(t,e){var i=Math.cos(e),n=Math.sin(e),o=t[0]*i-t[1]*n,r=t[1]*i+t[0]*n;return t[0]=o,t[1]=r,t}function ti(t,e){if(e.canWrapX()){var i=pt(e.getExtent()),n=function(t,e,i){var n=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]n[2])){var r=i||pt(n);o=Math.floor((t[0]-n[0])/r)}return o}(t,e,i);n&&(t[0]-=n*i)}return t}var ei=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function ii(t,e){re.expire()}const ni=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return ei(e,t),e.prototype.dispatchRenderEvent=function(t,e){A()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Ut(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ht(n,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,r,s,a){var l,h=e.viewState;function u(t,e,i,n){return o.call(r,e,t?i:null,n)}var c=h.projection,p=ti(t.slice(),c),d=[[0,0]];if(c.canWrapX()&&n){var f=pt(c.getExtent());d.push([-f,0],[f,0])}for(var g=e.layerStatesArray,_=g.length,y=[],v=[],m=0;m=0;--x){var w=g[x],b=w.layer;if(b.hasRenderer()&&He(w,h)&&s.call(a,b)){var S=b.getRenderer(),C=b.getSource();if(S&&C){var E=C.getWrapX()?p:t,T=u.bind(null,w.managed);v[0]=E[0]+d[m][0],v[1]=E[1]+d[m][1],l=S.forEachFeatureAtCoordinate(v,e,i,T,y)}if(l)return l}}if(0!==y.length){var O=1/y.length;return y.forEach((function(t,e){return t.distanceSq+=e*O})),y.sort((function(t,e){return t.distanceSq-e.distanceSq})),y.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){return A()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,o,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,Zt,this,o,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){A()},e.prototype.scheduleExpireIconCache=function(t){re.canExpireCache()&&t.postRenderFunctions.push(ii)},e}(zt);var oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ri=function(t){function e(e,i,n,o){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=n,r.context=o,r}return oi(e,t),e}(se);var si="ol-hidden",ai="ol-control",li=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"),hi=["style","variant","weight","size","lineHeight","family"],ui=function(t){var e=t.match(li);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,o=hi.length;n=0;--r)n[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,n=0;;++n){var o=i[n],r=e[n];if(!o&&!r)break;o!==r&&(o?r?t.insertBefore(r,o):(t.removeChild(o),--n):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent("postcompose",t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){for(var r=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],h=l.layer;if(h.hasRenderer()&&He(l,r)&&o(h)){var u=h.getRenderer().getDataAtPixel(t,e,i);if(u){var c=n(h,u);if(c)return c}}}},e}(ni),Zi="add",Bi="remove";var Ki=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vi="length",Ui=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.element=i,o.index=n,o}return Ki(e,t),e}(se);const Hi=function(t){function e(e,i){var n=t.call(this)||this,o=i||{};if(n.unique_=!!o.unique,n.array_=e||[],n.unique_)for(var r=0,s=n.array_.length;r0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Ce(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(xe,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ce(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ce),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(de),ln="postrender",hn="layergroup",un="size",cn="target",pn="view";var dn=1/0;const fn=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,he(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){W(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=dn&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,o=e[t],r=i[t],s=t;t>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),h=lt;){var s=this.getParentIndex_(e);if(!(n[s]>r))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=o,n[e]=r},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,o=this.elements_,r=this.priorities_,s=0,a=o.length;for(e=0;e0;)n=(i=this.dequeue()[0]).getKey(),0!==i.getState()||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++o,i.load())},e}(fn),yn="Point",vn="LineString",mn="Polygon",xn="MultiPoint",wn="MultiLineString",bn="MultiPolygon",Sn="GeometryCollection",Cn="Circle",En="center",Tn="resolution",On="rotation";function In(t,e,i){return function(n,o,r,s,a){if(n){var l=e?0:r[0]*o,u=e?0:r[1]*o,c=a?a[0]:0,p=a?a[1]:0,d=t[0]+l/2+c,f=t[2]-l/2+c,g=t[1]+u/2+p,_=t[3]-u/2+p;d>f&&(f=d=(f+d)/2),g>_&&(_=g=(_+g)/2);var y=h(n[0],d,f),v=h(n[1],g,_),m=30*o;return s&&i&&(y+=-m*Math.log(1+Math.max(0,d-n[0])/m)+m*Math.log(1+Math.max(0,n[0]-f)/m),v+=-m*Math.log(1+Math.max(0,g-n[1])/m)+m*Math.log(1+Math.max(0,n[1]-_)/m)),[y,v]}}}function Rn(t){return t}function Pn(t,e,i,n){var o=pt(e)/i[0],r=lt(e)/i[1];return n?Math.min(t,Math.max(o,r)):Math.min(t,Math.min(o,r))}function Fn(t,e,i){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),h(n,i/2,2*e)}function Mn(t,e,i,n,o){return function(r,s,a,l){if(void 0!==r){var u=n?Pn(t,n,a,o):t;return(void 0===i||i)&&l?Fn(r,u,e):h(r,e,u)}}}function kn(t){return void 0!==t?0:void 0}function Ln(t){return void 0!==t?t:void 0}function An(t){return Math.pow(t,3)}function Dn(t){return 1-An(1-t)}function jn(t){return 3*t*t-2*t*t*t}function zn(t){return t}const Gn="XY",Wn="XYZM";function Xn(t,e,i,n,o,r){for(var s=r||[],a=0,l=e;l1)a=i;else{if(p>0){for(var d=0;do&&(o=h),r=a,s=l}return o}function Jn(t,e,i,n,o,r,s,a,l,h,u){if(e==i)return h;var c,p;if(0===o){if((p=d(s,a,t[e],t[e+1]))0&&g>d)&&(f<0&&_0&&_>f)?(a=c,l=p):(r[s++]=a,r[s++]=l,h=a,u=l,a=c,l=p)}}return r[s++]=a,r[s++]=l,s}function eo(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=e;a0;){for(var c=h.pop(),d=h.pop(),f=0,g=t[d],_=t[d+1],y=t[c],v=t[c+1],m=d+n;mf&&(u=m,f=x)}f>o&&(l[(u-e)/n]=1,d+nr&&(h-a)*(r-l)-(o-a)*(u-l)>0&&s++:u<=r&&(h-a)*(r-l)-(o-a)*(u-l)<0&&s--,a=h,l=u}return 0!==s}function co(t,e,i,n,o,r){if(0===i.length)return!1;if(!uo(t,e,i[0],n,o,r))return!1;for(var s=1,a=i.length;s=o[0]&&r[2]<=o[2]||r[1]>=o[1]&&r[3]<=o[3]||function(t,e,i,n,o){for(var r,s=[t[e],t[e+1]],a=[];e+n=s&&g<=l),n||!(4&r)||4&o||(n=(_=d-(p-l)*f)>=a&&_<=h),n||!(8&r)||8&o||(n=(g=p-(d-a)/f)>=s&&g<=l),n||!(16&r)||16&o||(n=(_=d-(p-s)*f)>=a&&_<=h)}return n}(o,t,e)})))}function fo(t,e,i,n){for(;e0}function _o(t,e,i,n,o){for(var r=void 0!==o&&o,s=0,a=i.length;sx&&co(t,e,i,n,h=(u+c)/2,f)&&(m=h,x=w),u=c}return isNaN(m)&&(m=o[r]),s?(s.push(m,f,x),s):[m,f,x]}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new lo(this.getFlatInteriorPoint(),"XYM")},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new so(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],o=0,r=0,s=i.length;rc&&d1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i),!this.isDef()){var n=arguments[i-1];return n.center&&this.setCenterInternal(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&bo(e,!0))}for(var o=Date.now(),r=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,l=[],h=0;h0},e.prototype.getInteracting=function(){return this.hints_[1]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(0,-this.hints_[0]);for(var e=0,i=this.animations_.length;e=0;--i){for(var n=this.animations_[i],o=!0,r=0,s=n.length;r0?l/a.duration:1;h>=1?(a.complete=!0,h=1):o=!1;var u=a.easing(h);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],d=c+u*(a.targetCenter[0]-c),f=p+u*(a.targetCenter[1]-p);this.targetCenter_=[d,f]}if(a.sourceResolution&&a.targetResolution){var _=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){var y=this.getViewportSize_(this.getRotation()),v=this.constraints_.resolution(_,0,y,!0);this.targetCenter_=this.calculateCenterZoom(v,a.anchor)}this.targetResolution_=_,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var m=1===u?g(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){var x=this.constraints_.rotation(m,!0);this.targetCenter_=this.calculateCenterRotate(x,a.anchor)}this.targetRotation_=m}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(o){this.animations_[i]=null,this.setHint(0,-1);var w=n[0].callback;w&&bo(w,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,n=this.getCenterInternal();return void 0!==n&&($e(i=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),Je(i,e)),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenterInternal(),o=this.getResolution();return void 0!==n&&void 0!==o&&(i=[e[0]-t*(e[0]-n[0])/o,e[1]-t*(e[1]-n[1])/o]),i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Lt(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(En)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Dt(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),i=this.getCenterInternal();W(i,1);var n=this.getResolution();W(void 0!==n,2);var o=this.getRotation();return W(void 0!==o,3),at(i,n,o,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Tn)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(jt(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSize_(),n=pt(t)/i[0],o=lt(t)/i[1];return Math.max(n,o)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*o)}},e.prototype.getRotation=function(){return this.get(On)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/o}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),n=this.getCenterInternal(),o=this.padding;if(o){var r=this.getViewportSizeMinusPadding_();n=Co(n,this.getViewportSize_(),[r[0]/2+o[3],r[1]/2+o[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var o=Wt(this.resolutions_,t,1);n=o,e=this.resolutions_[o],i=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=h(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,h(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(W(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))W(!ft(t),25),i=xo(n=jt(t,this.getProjection()));else if(t.getType()===Cn){var n;(i=xo(n=jt(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),rt(n))}else{var o=kt();i=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(i,e)},e.prototype.fitInternal=function(t,e){var i=e||{},n=i.size;n||(n=this.getViewportSizeMinusPadding_());var o,r=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;o=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;for(var a=t.getFlatCoordinates(),l=this.getRotation(),h=Math.cos(-l),u=Math.sin(-l),c=1/0,p=1/0,d=-1/0,f=-1/0,g=t.getStride(),_=0,y=a.length;_=0;a--){var l=s[a];if(l.getMap()===this&&l.getActive()&&this.getTargetElement()&&(!l.handleEvent(t)||t.propagationStopped))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var o=t.viewHints;if(o[0]||o[1]){var r=!yi&&Date.now()-t.time>8;i=r?0:8,n=r?0:2}}e.getTilesLoading()0&&t[1]>0}(i)&&n&&n.isDef()){var s=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:at(a.center,a.resolution,a.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{}}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),o&&(!this.previousExtent_||!ft(this.previousExtent_)&&!J(r.extent,this.previousExtent_))&&(this.dispatchEvent(new tn("movestart",this,o)),this.previousExtent_=q(this.previousExtent_)),this.previousExtent_&&!r.viewHints[0]&&!r.viewHints[1]&&!J(r.extent,this.previousExtent_)&&(this.dispatchEvent(new tn("moveend",this,r)),N(r.extent,this.previousExtent_))),this.dispatchEvent(new tn(ln,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(hn,t)},e.prototype.setSize=function(t){this.set(un,t)},e.prototype.setTarget=function(t){this.set(cn,t)},e.prototype.setView=function(t){this.set(pn,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(Me);var Ro=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Po=function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return Ro(e,t),e.prototype.disposeInternal=function(){wi(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&wi(this.element);for(var e=0,i=this.listenerKeys.length;e0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Nt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,o=e.length;n0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:Dn}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(si);o||0!==i?o&&0!==i&&this.element.classList.remove(si):this.element.classList.add(si)}this.label_.style.transform=n}this.rotation_=i}},e}(Po);var Ao=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Do=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),target:n.target})||this;var o=void 0!==n.className?n.className:"ol-zoom",r=void 0!==n.delta?n.delta:1,s=void 0!==n.zoomInClassName?n.zoomInClassName:o+"-in",a=void 0!==n.zoomOutClassName?n.zoomOutClassName:o+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",h=void 0!==n.zoomOutLabel?n.zoomOutLabel:"−",u=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=u,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(_e,i.handleClick_.bind(i,r),!1);var d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof h?document.createTextNode(h):h),d.addEventListener(_e,i.handleClick_.bind(i,-r),!1);var f=o+" ol-unselectable "+ai,g=i.element;return g.className=f,g.appendChild(p),g.appendChild(d),i.duration_=void 0!==n.duration?n.duration:250,i}return Ao(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:Dn})):e.setZoom(n)}}},e}(Po),jo="active";var zo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Go(t,e,i,n){var o=t.getZoom();if(void 0!==o){var r=t.getConstrainedZoom(o+e),s=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==n?n:250,easing:Dn})}}const Wo=function(t){function e(e){var i=t.call(this)||this;return e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return zo(e,t),e.prototype.getActive=function(){return this.get(jo)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(jo,t)},e.prototype.setMap=function(t){this.map_=t},e}(Me);var Xo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Yo=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return Xo(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==on.DBLCLICK){var i=t.originalEvent,n=t.map,o=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;Go(n.getView(),r,o,this.duration_),i.preventDefault(),e=!0}return!e},e}(Wo);var No=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Zo(t){for(var e=t.length,i=0,n=0,o=0;o0}}else if(t.type==on.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==on.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===on.POINTERDOWN||e===on.POINTERDRAG||e===on.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==on.POINTERUP?delete this.trackedPointers_[i]:(t.type==on.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=ue(this.trackedPointers_)}},e}(Wo);function Ko(t){var e=arguments;return function(t){for(var i=!0,n=0,o=e.length;n0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Bo);var or=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const rr=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:Bt})||this).condition_=n.condition?n.condition:Vo,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return or(e,t),e.prototype.handleDragEvent=function(t){if(tr(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==kn){var n=e.getSize(),o=t.pixel,r=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=r-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!tr(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!(!tr(t)||!qo(t)||!this.condition_(t)||(t.map.getView().beginInteraction(),this.lastAngle_=void 0,0))},e}(Bo);var sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ar=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return sr(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},e.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_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new mo([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(zt);var lr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),hr=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.coordinate=i,o.mapBrowserEvent=n,o}return lr(e,t),e}(se);const ur=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.box_=new ar(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:qo,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return lr(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new hr("boxdrag",t.coordinate,t))},e.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 hr(e?"boxend":"boxcancel",t.coordinate,t)),!1},e.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 hr("boxstart",t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Bo);var cr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const pr=function(t){function e(e){var i=this,n=e||{},o=n.condition?n.condition:Qo;return(i=t.call(this,{condition:o,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return cr(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap(),i=e.getView(),n=e.getSize(),o=this.getGeometry().getExtent();if(this.out_){var r=i.calculateExtentInternal(n),s=function(t,e){return function(t,e){for(var i=0,n=e.length;i0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var o=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,o),this.initialVelocity_=Math.sqrt(o*o+r*r)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();var vr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),mr="trackpad";const xr=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var o=n.condition?n.condition:Ho;return i.condition_=n.onFocusOnly?Ko(Uo,o):o,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return vr(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==we)return!0;var e,i=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==we&&(e=n.deltaY,pi&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=gi),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?mr:"wheel");var r=i.getView();if(this.mode_===mr&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-h(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Go(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Wo);var wr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const br=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Bt),(i=t.call(this,o)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return wr(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=o-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=o;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==kn){var l=s.getViewport().getBoundingClientRect(),h=Zo(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2&&(t.map.getView().endInteraction(this.duration_),1))},e.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}return!1},e}(Bo);var Sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Cr=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Bt),(i=t.call(this,o)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Sr(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,r=i.clientY-n.clientY,s=Math.sqrt(o*o+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var h=a.getViewport().getBoundingClientRect(),u=Zo(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(u),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.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}return!1},e}(Bo);function Er(t){var e=t||{},i=new Hi,n=new yr(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new rr),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Yo({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new nr({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new br),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Cr({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new fr),i.push(new _r({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new xr({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new pr({duration:e.zoomDuration})),i}var Tr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Or=function(t){function e(e){return(e=le({},e)).controls||(e.controls=function(t){var e={},i=new Hi;return(void 0===e.zoom||e.zoom)&&i.push(new Do(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Lo(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Mo(e.attributionOptions)),i}()),e.interactions||(e.interactions=Er({onFocusOnly:!0})),t.call(this,e)||this}return Tr(e,t),e.prototype.createRenderer=function(){return new Ni(this)},e}(Io);var Ir=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Rr=function(t){function e(e,i,n){var o=t.call(this)||this,r=n||{};return o.tileCoord=e,o.state=i,o.interimTile=null,o.hifi=!0,o.key="",o.transition_=void 0===r.transition?250:r.transition,o.transitionStarts_={},o}return Ir(e,t),e.prototype.changed=function(){this.dispatchEvent(fe)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(2==t.getState())return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(2==t.getState()){t.interimTile=null;break}1==t.getState()?e=t:0==t.getState()?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(3!==this.state&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){A()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:An(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(de);var Pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Fr=function(t){function e(e,i,n,o){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=n,r.resolution=i,r.state=o,r}return Pr(e,t),e.prototype.changed=function(){this.dispatchEvent(fe)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return A()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){A()},e}(de);var Mr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function kr(t,e,i){var n=t;if(n.src&&yi){var o=n.decode(),r=!0;return o.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var s=[Se(n,"load",e),Se(n,"error",i)];return function(){s.forEach(Ce)}}!function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,n,0)||this;return a.src_=o,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.state=0,a.imageLoadFunction_=s,a}Mr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=lt(this.extent)/this.image_.height),this.state=2,this.unlistenImage_(),this.changed()},e.prototype.load=function(){0!=this.state&&3!=this.state||(this.state=1,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=kr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Fr);var Lr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ar=function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=o,a.src_=n,a.key=n,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.tileLoadFunction_=r,a}return Lr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){var t;this.state=3,this.unlistenImage_(),this.image_=((t=mi(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=2:this.state=4,this.unlistenImage_(),this.changed()},e.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=kr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Rr),Dr=function(){function t(t,e,i,n,o,r){this.sourceProj_=t,this.targetProj_=e;var s={},a=Ot(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&pt(n)==pt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?pt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?pt(this.targetProj_.getExtent()):null;var l=ut(i),h=ct(i),u=ot(i),p=nt(i),d=this.transformInv_(l),f=this.transformInv_(h),g=this.transformInv_(u),_=this.transformInv_(p),y=10+(r?Math.max(0,Math.ceil(c(it(i)/(r*r*256*256)))):0);if(this.addQuad_(l,h,u,p,d,f,g,_,y),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i.5&&u<1,d=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(d=pt(X([t,e,i,n]))/this.targetWorldWidth_>.25||d),!p&&this.sourceProj_.isGlobal()&&u&&(d=u>.25||d)),!(!d&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||dt(h,this.maxSourceExtent_)){var f=0;if(!(d||isFinite(o[0])&&isFinite(o[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)d=!0;else if(1!=(f=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!d){var _=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.transformInv_(_),v=void 0;v=p?(g(o[0],c)+g(s[0],c))/2-g(y[0],c):(o[0]+s[0])/2-y[0];var m=(o[1]+s[1])/2-y[1];d=v*v+m*m>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var x=[(e[0]+i[0])/2,(e[1]+i[1])/2],w=this.transformInv_(x),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],S=this.transformInv_(b);this.addQuad_(t,e,x,b,o,r,w,S,l-1),this.addQuad_(b,x,i,n,S,w,s,a,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(C),T=[(i[0]+n[0])/2,(i[1]+n[1])/2],O=this.transformInv_(T);this.addQuad_(t,C,T,n,o,E,O,a,l-1),this.addQuad_(C,e,i,T,E,r,s,O,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,n,o,s,a),0==(14&f)&&this.addTriangle_(t,i,e,o,s,r),f&&(0==(13&f)&&this.addTriangle_(e,n,t,r,a,o),0==(7&f)&&this.addTriangle_(e,n,i,r,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var o=e.source;Q(t,o[0]),Q(t,o[1]),Q(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();var jr,zr={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function Gr(t,e,i,n,o){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,o),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,o)),t.restore()}function Wr(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Xr(t,e,i,n){var o=It(i,e,t),r=xt(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(r*=s);var a=t.getMetersPerUnit();void 0!==a&&(r/=a);var l=t.getExtent();if(!l||B(l,o)){var h=xt(t,r,o)/r;isFinite(h)&&h>0&&(r/=h)}return r}var Yr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Nr=function(t){function e(e,i,n,o,r,s,a,l,u,c,p,d){var f=t.call(this,r,0)||this;f.renderEdges_=void 0!==p&&p,f.contextOptions_=d,f.pixelRatio_=a,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=i,f.targetTileGrid_=o,f.wrappedTileCoord_=s||r,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var g=o.getTileCoordExtent(f.wrappedTileCoord_),_=f.targetTileGrid_.getExtent(),y=f.sourceTileGrid_.getExtent(),v=_?ht(g,_):g;if(0===it(v))return f.state=4,f;var m=e.getExtent();m&&(y=y?ht(y,m):m);var x=o.getResolution(f.wrappedTileCoord_[0]),w=function(t,e,i,n){var o=rt(i),r=Xr(t,e,o,n);return(!isFinite(r)||r<=0)&&et(i,(function(i){return r=Xr(t,e,i,n),isFinite(r)&&r>0})),r}(e,n,v,x);if(!isFinite(w)||w<=0)return f.state=4,f;var b=void 0!==c?c:.5;if(f.triangulation_=new Dr(e,n,v,y,w*b,x),0===f.triangulation_.getTriangles().length)return f.state=4,f;f.sourceZ_=i.getZForResolution(w);var S=f.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(S[1]=h(S[1],y[1],y[3]),S[3]=h(S[3],y[1],y[3])):S=ht(S,y)),it(S)){for(var C=i.getTileRangeForExtentAndZ(S,f.sourceZ_),E=C.minX;E<=C.maxX;E++)for(var T=C.minY;T<=C.maxY;T++){var O=u(f.sourceZ_,E,T,a);O&&f.sourceTiles_.push(O)}0===f.sourceTiles_.length&&(f.state=4)}else f.state=4;return f}return Yr(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&2==e.getState()&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=3;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],o="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=function(t,e,i,n,o,r,s,a,l,h,u,c){var p=mi(Math.round(i*t),Math.round(i*e));if(le(p,c),0===l.length)return p.canvas;function d(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){var n,o;n=f,(o=t.extent)[0]n[2]&&(n[2]=o[2]),o[1]n[3]&&(n[3]=o[3])}));var g=pt(f),_=lt(f),y=mi(Math.round(i*g/n),Math.round(i*_/n));le(y,c);var v=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-f[0],o=-(t.extent[3]-f[3]),r=pt(t.extent),s=lt(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*v,o*v,r*v,s*v)}));var m=ut(s);return a.getTriangles().forEach((function(t,e,o){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],g=s[1][1],_=s[2][0],v=s[2][1],x=d((a[0][0]-m[0])/r),w=d(-(a[0][1]-m[1])/r),b=d((a[1][0]-m[0])/r),S=d(-(a[1][1]-m[1])/r),C=d((a[2][0]-m[0])/r),E=d(-(a[2][1]-m[1])/r),T=l,O=h;l=0,h=0;var I=function(t){for(var e=t.length,i=0;io&&(o=s,n=r)}if(0===o)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[u-=T,g-=O,0,0,b-x],[_-=T,v-=O,0,0,C-x],[0,0,u,g,S-w],[0,0,_,v,E-w]]);if(I){if(p.save(),p.beginPath(),function(){if(void 0===jr){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Gr(t,4,5,4,0),Gr(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;jr=Wr(e,0)||Wr(e,4)||Wr(e,8)}return jr}()||c===zr){p.moveTo(b,S);for(var R=x-b,P=w-S,F=0;F<4;F++)p.lineTo(b+d((F+1)*R/4),S+d(F*P/3)),3!=F&&p.lineTo(b+d((F+1)*R/4),S+d((F+1)*P/3));p.lineTo(C,E)}else p.moveTo(b,S),p.lineTo(x,w),p.lineTo(C,E);p.clip(),p.transform(I[0],I[2],I[1],I[3],x,w),p.translate(f[0]-T,f[3]-O),p.scale(n/i,-n/i),p.drawImage(y.canvas,0,0),p.restore()}})),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,o=(n[0][0]-m[0])/r,s=-(n[0][1]-m[1])/r,a=(n[1][0]-m[0])/r,l=-(n[1][1]-m[1])/r,h=(n[2][0]-m[0])/r,u=-(n[2][1]-m[1])/r;p.beginPath(),p.moveTo(a,l),p.lineTo(o,s),p.lineTo(h,u),p.closePath(),p.stroke()})),p.restore()),p.canvas}(n,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=2}this.changed()},e.prototype.load=function(){if(0==this.state){this.state=1,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var o=e.getState();if(0==o||1==o){t++;var r=be(e,fe,(function(i){var n=e.getState();2!=n&&3!=n&&4!=n||(Ce(r),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,i){0==t.getState()&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ce),this.sourcesListenerKeys_=null},e}(Rr),Zr=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return W(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return W(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){W(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Br(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function Kr(t,e,i){return t+"/"+e+"/"+i}function Vr(t){return Kr(t[0],t[1],t[2])}var Ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Hr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ur(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=(e=this.peekFirstKey(),e.split("/").map(Number))[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Vr(e.tileCoord)),e.release())}.bind(this))}var e},e}(Zr);var qr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Jr(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const Qr=function(t){function e(e){var i=t.call(this)||this;return i.projection_=mt(e.projection),i.attributions_=Jr(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ve,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return qr(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return A()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Jr(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Me);var $r=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function ts(t,e,i,n,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=i,o.maxY=n,o):new $r(t,e,i,n)}const es=$r;var is=[0,0,0];const ns=function(){function t(t){var e,i,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,W((e=this.resolutions_,!0,i=function(t,e){return e-t}||Gt,e.every((function(t,n){if(0===n)return!0;var o=i(e[n-1],t);return!(o>0||0===o)}))),17),!t.origins)for(var o=0,r=this.resolutions_.length-1;o=this.minZoom;){if(e(a,2===this.zoomFactor_?ts(o=Math.floor(o/2),o,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]0?n:Math.max(s/a[0],r/a[1]),h=o+1,u=new Array(h),c=0;ci||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(n,o)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,n){},e}(Qr),hs=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return as(e,t),e}(se);const us=ls;function cs(t,e){var i=/\{z\}/g,n=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(o,s[2].toString()).replace(r,(function(){var t=s[0],i=e.getFullTileRange(t);return W(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}var ps=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ds=function(t){function e(i){var n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(n.tileUrlFunction=i.tileUrlFunction),n.urls=null,i.urls?n.setUrls(i.urls):i.url&&n.setUrl(i.url),n.tileLoadingKeys_={},n}return ps(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=j(i),o=i.getState();1==o?(this.tileLoadingKeys_[n]=!0,e="tileloadstart"):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=3==o?"tileloaderror":2==o?"tileloadend":void 0),null!=e&&this.dispatchEvent(new hs(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n=i[1].charCodeAt(0),o=i[2].charCodeAt(0),r=void 0;for(r=n;r<=o;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var i=t.length,n=new Array(i),o=0;oOpenStreetMap | © OpenTopoMap | Little Navmap '];const n=void 0!==e.crossOrigin?e.crossOrigin:void 0,o=[256,256],r=[256,300],s=void 0!==e.url?e.url+"api/map/image?format=png&quality=75&width="+o[0]+"&height="+o[1]:void 0;super({attributions:i,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:n,imageSmoothing:e.imageSmoothing,maxZoom:void 0!==e.maxZoom?e.maxZoom:19,minZoom:void 0!==e.minZoom?e.minZoom:4,opaque:void 0===e.opaque||e.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:void 0,transition:e.transition,url:s,wrapX:e.wrapX,tileSize:[r[0],r[1]],projection:"EPSG:3857"}),this.setTileLoadFunction(this.defaultTileLoadFunction.bind(this))}defaultTileLoadFunction(t,e){const i=this.getTileGrid().getTileCoordExtent(t.getTileCoord()),n=Math.abs(i[2]-i[0])/6.6666,o=Ct([i[0]+n,i[1]+n],this.getProjection()),r=Ct([i[2]-n,i[3]-n],this.getProjection());t.getImage().src=e+"&leftlon="+o[0]+"&toplat="+o[1]+"&rightlon="+r[0]+"&bottomlat="+r[1]+"&detailfactor=10&reload="+Math.random()}getPixelRatio(){const t=this.tileGrid.getTileSize();return t[0]/t[1]}updateTileAtPixel(t,e){const i=e.getCoordinateFromPixel(t);this.updateTileAtLonLat(i,e)}updateTileAtLonLat(t,e){const i=this.tileGrid.getTileCoordForCoordAndZ(t,Math.round(e.getView().getZoom())),n=this.getTile(i[0],i[1],i[2],this.getPixelRatio(),this.getProjection());this.defaultTileLoadFunction(n,this.getUrls()[0]),setTimeout((()=>{e.renderSync()}),200)}}const xs="preload",ws="useInterimTilesOnError";var bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ss=function(t){function e(e){var i=this,n=e||{},o=le({},n);return delete o.preload,delete o.useInterimTilesOnError,(i=t.call(this,o)||this).setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return bs(e,t),e.prototype.getPreload=function(){return this.get(xs)},e.prototype.setPreload=function(t){this.set(xs,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(ws)},e.prototype.setUseInterimTilesOnError=function(t){this.set(ws,t)},e}(qe);var Cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Es=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Cs(e,t),e.prototype.getFeatures=function(t){return A()},e.prototype.prepareFrame=function(t){return A()},e.prototype.renderFrame=function(t,e){return A()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,o){var r=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,o,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){},e.prototype.getDataAtPixel=function(t,e,i){return A()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return 2!=e&&3!=e&&t.addEventListener(fe,this.boundHandleImageChange_),0==e&&(t.load(),e=t.getState()),2==e},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ve&&t.changed()},e}(Te);var Ts=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Os=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Ts(e,t),e.prototype.useContainer=function(t,e,i){var n,o,r=this.getLayer().getClassName();if(t&&""===t.style.opacity&&t.className===r&&(a=t.firstElementChild)instanceof HTMLCanvasElement&&(o=a.getContext("2d")),!o||0!==o.canvas.width&&o.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=o,this.containerReused=!0),!this.container){(n=document.createElement("div")).className=r;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(o=mi()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=o}},e.prototype.clip=function(t,e,i){var n=e.pixelRatio,o=e.size[0]*n/2,r=e.size[1]*n/2,s=e.viewState.rotation,a=ut(i),l=ct(i),h=ot(i),u=nt(i);Vt(e.coordinateToPixelTransform,a),Vt(e.coordinateToPixelTransform,l),Vt(e.coordinateToPixelTransform,h),Vt(e.coordinateToPixelTransform,u),t.save(),Wi(t,-s,o,r),t.beginPath(),t.moveTo(a[0]*n,a[1]*n),t.lineTo(l[0]*n,l[1]*n),t.lineTo(h[0]*n,h[1]*n),t.lineTo(u[0]*n,u[1]*n),t.clip(),Wi(t,s,o,r)},e.prototype.clipUnrotated=function(t,e,i){var n=ut(i),o=ct(i),r=ot(i),s=nt(i);Vt(e.coordinateToPixelTransform,n),Vt(e.coordinateToPixelTransform,o),Vt(e.coordinateToPixelTransform,r),Vt(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;Vt(a,n),Vt(a,o),Vt(a,r),Vt(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var o=new ri(t,this.inversePixelTransform,i,e);n.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_("prerender",t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_("postrender",t,e)},e.prototype.getRenderTransform=function(t,e,i,n,o,r,s){var a=o/2,l=r/2,h=n/e,u=-h,c=-t[0]+s,p=-t[1];return Ut(this.tempTransform,a,l,h,u,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n,o=Vt(this.inversePixelTransform,t.slice()),r=this.context,s=this.getLayer().getExtent();if(s&&!B(s,Vt(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(o[0]),l=Math.round(o[1]),h=document.createElement("canvas"),u=h.getContext("2d");h.width=1,h.height=1,u.clearRect(0,0,1,1),u.drawImage(r.canvas,a,l,1,1,0,0,1,1),n=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:n}return 0===n[3]?null:n},e}(Es);var Is=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Rs=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new es(0,0,0,0),i}return Is(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return 2==i||4==i||3==i&&!n},e.prototype.getTile=function(t,e,i,n){var o=n.pixelRatio,r=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,o,r);return 3==a.getState()&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(2)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,o=n.projection,r=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),p=u.getTileGridForProjection(o),d=p.getZForResolution(r,u.zDirection),f=p.getResolution(d),g=t.extent,_=i.extent&&jt(i.extent);_&&(g=ht(g,jt(i.extent)));var y=u.getTilePixelRatio(l),v=Math.round(t.size[0]*y),m=Math.round(t.size[1]*y);if(a){var x=Math.round(Math.sqrt(v*v+m*m));v=x,m=x}var w=f*v/2/y,b=f*m/2/y,S=[s[0]-w,s[1]-b,s[0]+w,s[1]+b],C=p.getTileRangeForExtentAndZ(g,d),E={};E[d]={};var T=this.createLoadedTileFinder(u,o,E),O=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var R=C.minX;R<=C.maxX;++R)for(var P=C.minY;P<=C.maxY;++P){var F=this.getTile(d,R,P,t);if(this.isDrawableTile(F)){var M=j(this);if(2==F.getState()){E[d][F.tileCoord.toString()]=F;var k=F.inTransition(M);this.newTiles_||!k&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(M,t.time))continue}var L=p.getTileCoordChildTileRange(F.tileCoord,I,O),A=!1;L&&(A=T(d+1,L)),A||p.forEachTileCoordParentTileRange(F.tileCoord,T,I,O)}var D=f/r;Ut(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,a,-v/2,-m/2);var z=function(t){return _i?qt(t):(Xi||(Xi=mi(1,1).canvas),Xi.style.transform=qt(t),Xi.style.transform)}(this.pixelTransform);this.useContainer(e,z,i.opacity);var G=this.context,W=G.canvas;Ht(this.inversePixelTransform,this.pixelTransform),Ut(this.tempTransform,v/2,m/2,D,D,0,-v/2,-m/2),W.width!=v||W.height!=m?(W.width=v,W.height=m):this.containerReused||G.clearRect(0,0,v,m),_&&this.clipUnrotated(G,t,_),le(G,u.getContextOptions()),this.preRender(G,t),this.renderedTiles.length=0;var X,Y,N,Z=Object.keys(E).map(Number);Z.sort(Gt),1!==i.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(X=[],Y=[]):Z=Z.reverse();for(var B=Z.length-1;B>=0;--B){var K=Z[B],V=u.getTilePixelSize(K,l,o),U=p.getResolution(K)/f,H=V[0]*U*D,q=V[1]*U*D,Q=p.getTileCoordForCoordAndZ(ut(S),K),$=p.getTileCoordExtent(Q),tt=Vt(this.tempTransform,[y*($[0]-S[0])/f,y*(S[3]-$[3])/f]),et=y*u.getGutterForProjection(o),it=E[K];for(var nt in it){var ot=(F=it[nt]).tileCoord,rt=tt[0]-(Q[1]-ot[1])*H,st=Math.round(rt+H),at=tt[1]-(Q[2]-ot[2])*q,lt=Math.round(at+q),ct=st-(R=Math.round(rt)),pt=lt-(P=Math.round(at)),dt=d===K;if(!(k=dt&&1!==F.getAlpha(j(this),t.time)))if(X){G.save(),N=[R,P,R+ct,P,R+ct,P+pt,R,P+pt];for(var ft=0,gt=X.length;ftu&&this.instructions.push([ia.CUSTOM,u,o,t,i,eo])):l==yn&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),o=this.coordinates.length,this.instructions.push([ia.CUSTOM,u,o,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[ia.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ia.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,n,o=e.length,r=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[ia.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[ia.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,o=t.lineDash,r=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!Nt(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=r,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[ia.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=N(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Y(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(na);var sa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const aa=function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return sa(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([ia.DRAW_IMAGE,o,r,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([ia.DRAW_IMAGE,o,r,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)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([ia.DRAW_IMAGE,o,r,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([ia.DRAW_IMAGE,o,r,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)}},e.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,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),o=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=o,this.image_=r,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(ra);var la=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ha=function(t){function e(e,i,n,o){return t.call(this,e,i,n,o)||this}return la(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var o=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[ia.MOVE_TO_LINE_TO,o,r];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ia.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ta);var r=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(r,0,r.length,s),this.hitDetectionInstructions.push($s),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ia.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ta);for(var r=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,h=0,u=r.length;ht&&(y>_&&(_=y,f=v,g=r),y=0,v=r-o)),s=a,u=p,c=d),l=m,h=x}return(y+=a)>_?[v,r]:[f,g]}var da=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fa={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},ga={Circle:ca,Default:ra,Image:aa,LineString:ha,Polygon:ca,Text:function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return da(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(i||n)){var r=this.coordinates,s=r.length,a=t.getType(),l=null,h=t.getStride();if("line"!==o.placement||a!=vn&&a!=wn&&a!=mn&&a!=bn){var u=o.overflow?null:[];switch(a){case yn:case xn:l=t.getFlatCoordinates();break;case vn:l=t.getFlatMidpoint();break;case Cn:l=t.getCenter();break;case wn:l=t.getFlatMidpoints(),h=2;break;case mn:l=t.getFlatInteriorPoint(),o.overflow||u.push(l[2]/this.resolution),h=3;break;case bn:var c=t.getFlatInteriorPoints();for(l=[],w=0,b=c.length;wR[2]}else T=w>O;var P,F=Math.PI,M=[],k=S+n===e;if(y=0,v=C,p=t[e=S],d=t[e+1],k){m();var L=Math.atan2(d-g,p-f);T&&(L+=L>0?-F:F);var A=(O+w)/2,D=(I+b)/2;return M[0]=[A,D,(E-r)/2,L,o],M}for(var j=0,z=o.length;j0?-F:F),void 0!==P){var W=G-P;if(W+=W>F?-2*F:W<-F?2*F:0,Math.abs(W)>s)return null}P=G;for(var X=j,Y=0;jt?t-l:o,x=r+h>e?e-h:r,w=d[3]+m*c[0]+d[1],b=d[0]+x*c[1]+d[2],S=y-d[3],C=v-d[0];return(f||0!==u)&&(Ta[0]=S,Ra[0]=S,Ta[1]=C,Oa[1]=C,Oa[0]=S+w,Ia[0]=Oa[0],Ia[1]=C+b,Ra[1]=Ia[1]),0!==u?(Vt(_=Ut([1,0,0,1,0,0],i,n,1,1,u,-i,-n),Ta),Vt(_,Oa),Vt(_,Ia),Vt(_,Ra),H(Math.min(Ta[0],Oa[0],Ia[0],Ra[0]),Math.min(Ta[1],Oa[1],Ia[1],Ra[1]),Math.max(Ta[0],Oa[0],Ia[0],Ra[0]),Math.max(Ta[1],Oa[1],Ia[1],Ra[1]),Ea)):H(Math.min(S,S+w),Math.min(C,C+b),Math.max(S,S+w),Math.max(C,C+b),Ea),p&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:h,declutterBox:{minX:Ea[0],minY:Ea[1],maxX:Ea[2],maxY:Ea[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,o,r,s){var a=!(!r&&!s),l=n.declutterBox,h=t.canvas,u=s?s[2]*n.scale[0]/2:0;return l.minX-u<=h.width/e&&l.maxX+u>=0&&l.minY-u<=h.height/e&&l.maxY+u>=0&&(a&&this.replayTextBackground_(t,Ta,Oa,Ia,Ra,r,s),function(t,e,i,n,o,r,s,a,l,h,u){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(u[0],u[1]),function(t,e){for(var i=t.contextInstructions,n=0,o=i.length;nz&&(this.fill_(t),P=0),F>z&&(t.stroke(),F=0),P||F||(t.beginPath(),f=NaN,g=NaN),++O;break;case ia.CIRCLE:var W=l[R=G[1]],X=l[R+1],Y=l[R+2]-W,N=l[R+3]-X,Z=Math.sqrt(Y*Y+N*N);t.moveTo(W+Z,X),t.arc(W,X,Z,0,2*Math.PI,!0),++O;break;case ia.CLOSE_PATH:t.closePath(),++O;break;case ia.CUSTOM:R=G[1],c=G[2];var B=G[3],K=G[4],V=6==G.length?G[5]:void 0;j.geometry=B,j.feature=S,O in L||(L[O]=[]);var U=L[O];V?V(l,R,c,2,U):(U[0]=l[R],U[1]=l[R+1],U.length=2),K(U,j),++O;break;case ia.DRAW_IMAGE:R=G[1],c=G[2],v=G[3],p=G[4],d=G[5];var H=G[6],q=G[7],J=G[8],Q=G[9],$=G[10],tt=G[11],et=G[12],it=G[13],nt=G[14];if(!v&&G.length>=19){m=G[18],x=G[19],w=G[20],b=G[21];var ot=this.drawLabelWithPointPlacement_(m,x,w,b);v=ot.label,G[3]=v;var rt=G[22];p=(ot.anchorX-rt)*this.pixelRatio,G[4]=p;var st=G[23];d=(ot.anchorY-st)*this.pixelRatio,G[5]=d,H=v.height,G[6]=H,it=v.width,G[13]=it}var at=void 0;G.length>24&&(at=G[24]);var lt=void 0,ht=void 0,ut=void 0;G.length>16?(lt=G[15],ht=G[16],ut=G[17]):(lt=Pi,ht=!1,ut=!1),$&&D?tt+=A:$||D||(tt-=A);for(var ct=0;Ri)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+o)*e+(t+r))+3),o>0&&a.push(4*((t-o)*e+(t+r))+3),r>0&&(a.push(4*((t+o)*e+(t-r))+3),o>0&&a.push(4*((t-o)*e+(t-r))+3))}for(var l=[],h=(o=0,n.length);o0){if(!r||c!==ma&&c!==ba||-1!==r.indexOf(t)){var h=(p[a]-3)/4,d=n-h%s,f=n-(h/s|0),g=o(t,e,d*d+f*f);if(g)return g}u.clearRect(0,0,s,s);break}}var f,g,_,y,v,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(Gt),f=m.length-1;f>=0;--f){var x=m[f].toString();for(_=this.executorsByZIndex_[x],g=La.length-1;g>=0;--g)if(void 0!==(y=_[c=La[g]])&&(v=y.executeHitDetection(u,a,i,d,h)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],o=e[2],r=e[3],s=[i,n,i,r,o,r,o,n];return Xn(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return ce(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,o,r,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(Gt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,h,u,c,p,d,f=r||La;for(s&&a.reverse(),l=0,h=a.length;l0,6);var c=void 0!==n.src?0:2;return i.color_=void 0!==n.color?ee(n.color):null,i.iconImage_=function(t,e,i,n,o,r){var s=re.get(e,n,r);return s||(s=new Ua(t,e,i,n,o,r),re.set(e,n,r,s)),s}(l,u,h,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:Za,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return Ha(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Wa||this.anchorYUnits_==Wa){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Wa&&(t[0]*=e[0]),this.anchorYUnits_==Wa&&(t[1]*=e[1])}if(this.anchorOrigin_!=Za){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Ba&&this.anchorOrigin_!=Na||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ya&&this.anchorOrigin_!=Na||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=Za){var i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;t=t.slice(),this.offsetOrigin_!=Ba&&this.offsetOrigin_!=Na||(t[0]=n[0]-i[0]-t[0]),this.offsetOrigin_!=Ya&&this.offsetOrigin_!=Na||(t[1]=n[1]-i[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(fe,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(fe,t)},e}(As);var Ja={Point:function(t,e,i,n,o){var r,s=i.getImage(),a=i.getText();if(o&&(t=o,r=s&&a&&a.getText()?{}:void 0),s){if(2!=s.getImageState())return;var l=t.getBuilder(i.getZIndex(),ma);l.setImageStyle(s,r),l.drawPoint(e,n)}if(a&&a.getText()){var h=t.getBuilder(i.getZIndex(),ba);h.setTextStyle(a,r),h.drawText(e,n)}},LineString:function(t,e,i,n,o){var r=i.getStroke();if(r){var s=t.getBuilder(i.getZIndex(),xa);s.setFillStrokeStyle(null,r),s.drawLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(o||t).getBuilder(i.getZIndex(),ba);l.setTextStyle(a),l.drawText(e,n)}},Polygon:function(t,e,i,n,o){var r=i.getFill(),s=i.getStroke();if(r||s){var a=t.getBuilder(i.getZIndex(),wa);a.setFillStrokeStyle(r,s),a.drawPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),ba);h.setTextStyle(l),h.drawText(e,n)}},MultiPoint:function(t,e,i,n,o){var r,s=i.getImage(),a=i.getText();if(o&&(t=o,r=s&&a&&a.getText()?{}:void 0),s){if(2!=s.getImageState())return;var l=t.getBuilder(i.getZIndex(),ma);l.setImageStyle(s,r),l.drawMultiPoint(e,n)}if(a&&a.getText()){var h=(o||t).getBuilder(i.getZIndex(),ba);h.setTextStyle(a,r),h.drawText(e,n)}},MultiLineString:function(t,e,i,n,o){var r=i.getStroke();if(r){var s=t.getBuilder(i.getZIndex(),xa);s.setFillStrokeStyle(null,r),s.drawMultiLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(o||t).getBuilder(i.getZIndex(),ba);l.setTextStyle(a),l.drawText(e,n)}},MultiPolygon:function(t,e,i,n,o){var r=i.getFill(),s=i.getStroke();if(s||r){var a=t.getBuilder(i.getZIndex(),wa);a.setFillStrokeStyle(r,s),a.drawMultiPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),ba);h.setTextStyle(l),h.drawText(e,n)}},GeometryCollection:function(t,e,i,n,o){var r,s,a=e.getGeometriesArray();for(r=0,s=a.length;r0&&(s.width=0),this.container;var h=Math.round(t.size[0]*i),u=Math.round(t.size[1]*i);s.width!=h||s.height!=u?(s.width=h,s.height=u,s.style.transform!==o&&(s.style.transform=o)):this.containerReused||r.clearRect(0,0,h,u),this.preRender(r,t);var c=t.viewState,p=(c.projection,!1);if(n.extent&&this.clipping){var d=jt(n.extent);(p=!K(d,t.extent)&&dt(d,t.extent))&&this.clipUnrotated(r,t,d)}this.renderWorlds(a,t),p&&r.restore(),this.postRender(r,t);var f=n.opacity,g=this.container;return f!==parseFloat(g.style.opacity)&&(g.style.opacity=1===f?"":String(f)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];Vt(this.pixelTransform,i);var n=this.renderedCenter_,o=this.renderedResolution_,r=this.renderedRotation_,s=this.renderedProjection_,a=this.renderedExtent_,l=this.getLayer(),h=[],u=i[0]/2,c=i[1]/2;h.push(this.getRenderTransform(n,o,r,.5,u,c,0).slice());var p=l.getSource(),d=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!K(d,a)){for(var f=a[0],g=pt(d),_=0,y=void 0;fd[2];)y=g*++_,h.push(this.getRenderTransform(n,o,r,.5,u,c,y).slice()),f-=g}this.hitDetectionImageData_=function(t,e,i,n,o,r,s){var a=mi(t[0]/2,t[1]/2);a.imageSmoothingEnabled=!1;for(var l=a.canvas,h=new Ga(a,.5,o,null,s),u=i.length,c=Math.floor(16777215/u),p={},d=1;d<=u;++d){var f=i[d-1],g=f.getStyleFunction()||n;if(n){var _=g(f,r);if(_){Array.isArray(_)||(_=[_]);for(var y="#"+("000000"+(d*c).toString(16)).slice(-6),v=0,m=_.length;v=i[2])){var o=pt(i),r=Math.floor((n[0]-i[0])/o)*o;t[0]-=r,t[2]-=r}return t}(y[0],h);w[0]v[0]&&w[2]>v[2]&&y.push([w[0]-m,w[1],w[2]-m,w[3]])}if(!this.dirty_&&this.renderedResolution_==u&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&K(this.renderedExtent_,_))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var b,S=new _a($a(u,c),_,u,c);this.getLayer().getDeclutter()&&(b=new _a($a(u,c),_,u,c));var C,E=kt();if(E){for(var T=0,O=y.length;T=200&&a.status<300){var n=e.getType(),l=void 0;"json"==n||"text"==n?l=a.responseText:"xml"==n?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):n==ul&&(l=a.response),l?r(e.readFeatures(l,{extent:i,featureProjection:o}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(t,e,i,n,o,(function(t,e){void 0!==r&&r(t),a.addFeatures(t)}),s||Kt)}}var pl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dl=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.feature=i,o.features=n,o}return pl(e,t),e}(se);const fl=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:Ve,wrapX:void 0===n.wrapX||n.wrapX})||this).loader_=Kt,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&(W(i.format_,7),i.loader_=cl(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:hl;var o,r,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new sl:null,i.loadedExtentsRtree_=new sl,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?r=n.features:n.features&&(r=(o=n.features).getArray()),s||void 0!==o||(o=new Hi(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==o&&i.bindFeaturesCollection_(o),i}return pl(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=j(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new dl(al,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[be(e,fe,this.handleFeatureChange_,this),be(e,ae,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(W(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],o=0,r=t.length;o',n.className="follow-control on ol-unselectable ol-control",n.appendChild(r),t.call(this,{element:n,target:o.target}),r.addEventListener("click",this.handleFollow.bind(this),!1)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.handleFollow=function(){i=!i,n.className=i?"follow-control on ol-unselectable ol-control":"follow-control off ol-unselectable ol-control",e()},o}(Po);var vl=i(441),ml=i.n(vl);const xl=function(t){var e,i=document.createElement("div");function n(n){var o=n||{};e=n.handleRefresh;var r=document.createElement("button");r.innerHTML='',i.className="refresh-control on ol-unselectable ol-control",i.appendChild(r),t.call(this,{element:i,target:o.target}),r.addEventListener("click",this.handleRefresh.bind(this),!1)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.handleRefresh=function(){e()},n}(Po),wl=(t,e,i)=>{fetch(t).then((t=>t.text())).then((t=>e(t))).catch((t=>{i(t)}))};var bl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Sl=function(t){function e(e){var i=t.call(this)||this;if(i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addEventListener(Fe(i.geometryName_),i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;i.setGeometry(n)}else{var o=e;i.setProperties(o)}return i}return bl(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Ce(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=be(t,fe,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){var e,i;this.style_=t,this.styleFunction_=t?"function"==typeof(e=t)?e:(Array.isArray(e)?i=e:(W("function"==typeof e.getZIndex,41),i=[e]),function(){return i}):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeEventListener(Fe(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=t,this.addEventListener(Fe(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(Me),Cl=class extends Wo{constructor(t={layer:void 0,url:void 0}){super(t),t.layer&&(this.layer=t.layer,this.source=this.layer.getSource()),this.url=t.url}handleEvent(t){switch(t.type){case"click":return this.layer||(this.source=new fl,this.layer=new rl({source:this.source}),this.getMap().addLayer(this.layer)),this.getFeaturesAtPixelListener(t),!1;default:return!0}}getFeaturesAtPixelListener(t){return this.getFeaturesAtPixel(t.pixel)}getFeaturesAtPixel(t){return this.getFeaturesAtCoordinates(this.getMap().getCoordinateFromPixel(t))}getFeaturesAtCoordinates(t,e=1){this.source.clear();let i=[];i.push(Je(t.map((t=>t)),[-1*e,-1*e])),i.push(Je(t.map((t=>t)),[1*e,-1*e])),i.push(Je(t.map((t=>t)),[1*e,1*e])),i.push(Je(t.map((t=>t)),[-1*e,1*e]));const n=X(i),o=this.getMap().getView().getProjection(),r=Ct([n[0],n[1]],o),s=Ct([n[0],n[3]],o),a=this.url+"api/map/features?leftlon="+r[0]+"&toplat="+r[1]+"&rightlon="+s[0]+"&bottomlat="+s[1]+"&detailfactor=13";wl(a,(t=>{try{const e=JSON.parse(t);this.getMap().littlenavmap.dispatch("map/features",e);let i=[],n=0;e.airports.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});i.push(e),++n}));let r=[];e.ndbs.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});r.push(e),++n}));let s=[];e.vors.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});s.push(e),++n}));let a=[];e.markers.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});a.push(e),++n}));let l=[];e.waypoints.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});l.push(e)})),this.source.addFeatures(i),this.source.addFeatures(r),this.source.addFeatures(s),this.source.addFeatures(a),this.source.addFeatures(l)}catch(t){console.log(t)}}),(t=>{console.log("error")}))}},El=class extends Sl{constructor(t={}){super(t),this.defaultStyle=new Vs({image:new qa({anchor:[.5,.5],anchorXUnits:"fraction",anchorYUnits:"fraction",src:_l(),scale:.5})}),this.setStyle(this.defaultStyle)}isVisible(){return null!=this.getStyle()}hide(){this.setStyle(null)}show(){this.setStyle(this.defaultStyle)}rotateImage(t){this.getStyle().getImage().setRotation(t)}},Tl=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=To(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Xs({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=To(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),Ol=class extends Sl{constructor(t={}){super(t),this.defaultStyle=new Vs({fill:new Xs({color:"rgba(255,255,255,0.4)"}),stroke:new Ys({color:"#3399CC",width:1.25}),text:new Tl({text:"1",textAlign:"left",fill:new Xs({color:"#000000"}),stroke:new Ys({color:"#FFFF99",width:3.5})})}),this.setStyle(this.defaultStyle)}updateText(t){this.getStyle().getText().setText(t)}isVisible(){return null!=this.getStyle()}hide(){this.setStyle(null)}show(){this.setStyle(this.defaultStyle)}};var Il=i(964),Rl=i.n(Il),Pl="/";console.log("Starting production mode:",Pl);const Fl=new class{constructor(t,e){this.fetch=wl,this.url=t,this.target=e,this.refreshInterval=1e3,this.sources=[new ms({url:this.url})],this.activesource=0,this.layers=[new Ms({source:this.sources[0],className:"lnm-layer-0",visible:!0})],this.following=!0,this.initMap()}initMap(){const t=[new yl({handleFollow:()=>{this.following=!this.following}}),new xl({handleRefresh:()=>{this.sources.forEach((t=>{t.refresh()}))}}),new Mo({collapsible:!1})];this.setupAircraftFeature(),this.setupWindIndicator(),this.map=new Or({controls:t,interactions:Er().extend([new Cl({url:this.url})]),layers:this.layers,target:this.target,view:new Eo({maxZoom:19,minZoom:4})}),this.map.littlenavmap=this}setupAircraftFeature(){this.aircraftFeature=new El,this.aircraftLabelFeature=new Ol;const t=new fl({features:[this.aircraftFeature,this.aircraftLabelFeature]}),e=new rl({source:t});this.layers.push(e)}setupWindIndicator(){this.windIndicator=document.createElement("div");var t=document.createElement("div"),e=document.createElement("div");t.style.float="left",t.style.position="relative",t.style.marginRight="5px",e.style.float="left",e.style.position="relative",e.style.backgroundColor="#FFFF99",this.windIndicator.style.position="absolute",this.windIndicator.style.top="2%",this.windIndicator.style.left="48%",this.windIndicatorPointer=document.createElement("img"),this.windIndicatorPointer.src=Rl(),this.windIndicatorPointer.style.width="40px",this.windIndicatorTextDirection=document.createElement("span"),this.windIndicatorTextDirection.innerHTML="";var i=document.createElement("br");this.windIndicatorTextSpeed=document.createElement("span"),this.windIndicatorTextSpeed.innerHTML="",t.appendChild(this.windIndicatorPointer),e.appendChild(this.windIndicatorTextDirection),e.appendChild(i),e.appendChild(this.windIndicatorTextSpeed),this.windIndicator.appendChild(t),this.windIndicator.appendChild(e),this.windIndicator.style.visibility="hidden",document.body.appendChild(this.windIndicator)}getAircraftPosition(t){this.fetch(this.url+"api/sim/info",(e=>{try{const i=JSON.parse(e);i.active?(this.simInfo=i,this.dispatch("sim/info",i),this.setAircraftFeatureVisibility(!0),this.setWindIndicatorVisibility(!0),t([i.position.lon,i.position.lat],i.heading)):(this.simInfo=null,this.setAircraftFeatureVisibility(!1),this.setWindIndicatorVisibility(!1))}catch(t){console.log(t)}}),(t=>{console.log(t)}))}setAircraftFeatureVisibility(t){t&&!this.aircraftFeature.isVisible()?(this.aircraftFeature.show(),this.aircraftLabelFeature.show()):!t&&this.aircraftFeature.isVisible()&&(this.aircraftFeature.hide(),this.aircraftLabelFeature.hide())}setWindIndicatorVisibility(t){t&&"hidden"==this.windIndicator.style.visibility?this.windIndicator.style.visibility="visible":t||"visible"!=this.windIndicator.style.visibility||(this.windIndicator.style.visibility="hidden",this.windIndicatorTextDirection.innerHTML="",this.windIndicatorTextSpeed.innerHTML="")}ParseDMS(t){var e=t.split(/[^\d\w!.]+/),i=this.ConvertDMSToDD(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),e[3]);return[this.ConvertDMSToDD(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),e[7]),i]}ConvertDMSToDD(t,e,i,n){var o=t+e/60+i/3600;return"S"!=n&&"W"!=n||(o*=-1),o}startRefreshLoop(){setTimeout(this.refreshLoop.bind(this),this.refreshInterval)}refreshLoop(){this.getAircraftPosition(((t,e)=>{const i=St(t);this.aircraftFeature.setGeometry(new lo(i)),this.aircraftFeature.rotateImage(this.degreesToRadians(e)),this.aircraftLabelFeature.setGeometry(new lo(i)),this.aircraftLabelFeature.updateText("GS "+this.simInfo.ground_speed.toFixed(0)+"kts\nALT "+this.simInfo.indicated_altitude.toFixed(0)+"ft"),this.windIndicatorPointer.style.transform="rotate("+(this.simInfo.wind_direction-180)+"deg)",this.windIndicatorTextDirection.innerHTML=this.simInfo.wind_direction.toFixed(0)+" °M",this.windIndicatorTextSpeed.innerHTML=this.simInfo.wind_speed.toFixed(0)+" kts",this.following&&this.map.getView().animate({center:i,duration:200})})),setTimeout(this.refreshLoop.bind(this),this.refreshInterval)}degreesToRadians(t){return t*(Math.PI/180)}toggleActiveSource(){this.activesource<1?(this.activesource=1,this.layers[1].setVisible(!0),this.layers[0].setVisible(!1)):(this.activesource=0,this.layers[0].setVisible(!0),this.layers[1].setVisible(!1))}dispatch(t,e){const i=new CustomEvent(t,{detail:e});window.dispatchEvent(i)}}(Pl,"map");window.littlenavmap=Fl,window.onload=()=>{Fl.map.getView().setZoom(9),Fl.map.getView().setCenter(St([0,0])),Fl.startRefreshLoop()}})()})(); \ No newline at end of file From 87e1650e1ef0099867ce8cf3051103e5c006c9b5 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Tue, 8 Mar 2022 10:42:45 +0100 Subject: [PATCH 26/29] Create initial ol-map plugin --- web/plugins/ol-map/index.html | 88 +++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 web/plugins/ol-map/index.html diff --git a/web/plugins/ol-map/index.html b/web/plugins/ol-map/index.html new file mode 100644 index 000000000..fd560c73e --- /dev/null +++ b/web/plugins/ol-map/index.html @@ -0,0 +1,88 @@ + + + + + + OpenLayers Map + + + + + + + + \ No newline at end of file From b4fe9b2b3b030ee9f3f6e2f0a521f1867cf61b0c Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Tue, 8 Mar 2022 16:04:14 +0100 Subject: [PATCH 27/29] Implement airport quicksearch via map toolbar --- web/ol/index.bundle.js | 2 +- web/plugins/ol-map/index.html | 41 +++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/web/ol/index.bundle.js b/web/ol/index.bundle.js index 68fa52e5a..b2fa8132c 100644 --- a/web/ol/index.bundle.js +++ b/web/ol/index.bundle.js @@ -1 +1 @@ -(()=>{var t={788:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(645),o=i.n(n)()((function(t){return t[1]}));o.push([t.id,'.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 2px solid blue;\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: rgba(0,60,136,0.3);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n.ol-scale-line-inner {\n border: 1px solid #eee;\n border-top: none;\n color: #eee;\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: #000000;\n float: right;\n z-Index: 10;\n}\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 12px;\n z-Index: 11;\n color: #000000;\n text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;\n}\n.ol-scale-text {\n position: absolute;\n font-size: 14px;\n text-align: center;\n bottom: 25px;\n color: #000000;\n text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;\n}\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-Index: 9;\n box-sizing: border-box;\n border: 1px solid black;\n}\n\n.ol-unsupported {\n display: none;\n}\n.ol-viewport, .ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n}\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n.ol-control {\n position: absolute;\n background-color: rgba(255,255,255,0.4);\n border-radius: 4px;\n padding: 2px;\n}\n.ol-control:hover {\n background-color: rgba(255,255,255,0.6);\n}\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: white;\n font-size: 1.14em;\n font-weight: bold;\n text-decoration: none;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: rgba(0,60,136,0.5);\n border: none;\n border-radius: 2px;\n}\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n.ol-compass {\n display: block;\n font-weight: normal;\n font-size: 1.2em;\n will-change: transform;\n}\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n background-color: rgba(0,60,136,0.7);\n}\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 0 .5em;\n color: #000;\n text-shadow: 0 0 2px #fff;\n}\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n.ol-attribution ul, .ol-attribution button {\n display: inline-block;\n}\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n.ol-attribution:not(.ol-collapsed) {\n background: rgba(255,255,255,0.8);\n}\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: inline-block;\n}\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid #7b98bc;\n height: 150px;\n margin: 2px;\n width: 150px;\n}\n.ol-overviewmap:not(.ol-collapsed) button{\n bottom: 1px;\n left: 2px;\n position: absolute;\n}\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n.ol-overviewmap:not(.ol-collapsed) {\n background: rgba(255,255,255,0.8);\n}\n.ol-overviewmap-box {\n border: 2px dotted rgba(0,60,136,0.7);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n',""]);const r=o},424:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(645),o=i.n(n)()((function(t){return t[1]}));o.push([t.id," #debug {\n display: none;\n position: absolute;\n width: 100px;\n height: 100px;\n left: 0;\n top: 0;\n background-color: rgba(255, 0, 0, 0.5);\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n }\n\n .map {\n width: 100%;\n height: 100%;\n }\n\n .ol-control button img {\n width: 25px;\n height: 25px;\n }\n\n .follow-control {\n top: 10px;\n right: .5em;\n }\n\n .follow-control.on {\n background-color: #639684;\n }\n\n .follow-control.off {}\n\n .refresh-control {\n top: 60px;\n right: .5em;\n }",""]);const r=o},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(n)for(var r=0;ro;){if(r-o>600){var a=r-o+1,l=n-o+1,h=Math.log(a),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(a-u)/a)*(l-a/2<0?-1:1);t(i,n,Math.max(o,Math.floor(n-l*u/a+c)),Math.min(r,Math.floor(n+(a-l)*u/a+c)),s)}var p=i[n],d=o,f=r;for(e(i,o,n),s(i[r],p)>0&&e(i,o,r);d0;)f--}0===s(i[o],p)?e(i,o,f):e(i,++f,r),f<=n&&(o=f+1),n<=f&&(r=f-1)}}(t,n,o||0,r||t.length-1,s||i)}function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,i,n,o,r){for(var s=[i,n];s.length;)if(!((n=s.pop())-(i=s.pop())<=o)){var a=i+Math.ceil((n-i)/o/2)*o;t(e,a,i,n,r),s.push(i,a,a,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,i=[];if(!d(t,e))return i;for(var n=this.toBBox,o=[];e;){for(var r=0;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)},n.prototype._split=function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),a=f(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},n.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,i){for(var n,o,r,a,l,h,c,p=1/0,d=1/0,f=e;f<=i-e;f++){var g=s(t,0,f,this.toBBox),_=s(t,f,i,this.toBBox),y=(o=g,r=_,void 0,void 0,void 0,void 0,a=Math.max(o.minX,r.minX),l=Math.max(o.minY,r.minY),h=Math.min(o.maxX,r.maxX),c=Math.min(o.maxY,r.maxY),Math.max(0,h-a)*Math.max(0,c-l)),v=u(g)+u(_);y=e;d--){var f=t.children[d];a(l,t.leaf?o(f):f),h+=c(l)}return h},n.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)a(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():r(t[e],this.toBBox)},n}()},379:(t,e,i)=>{"use strict";var n,o=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),r=[];function s(t){for(var e=-1,i=0;i{t.exports="data:image/svg+xml,%3csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' version='1.0' width='128' height='128' id='svg2' sodipodi:version='0.32' inkscape:version='0.91 r13725' sodipodi:docname='aircraft_small_user.svg' inkscape:output_extension='org.inkscape.output.svg.inkscape'%3e %3cmetadata id='metadata16'%3e %3crdf:RDF%3e %3ccc:Work rdf:about=''%3e %3cdc:format%3eimage/svg+xml%3c/dc:format%3e %3cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/%3e %3cdc:title/%3e %3c/cc:Work%3e %3c/rdf:RDF%3e %3c/metadata%3e %3csodipodi:namedview inkscape:window-height='735' inkscape:window-width='1073' inkscape:pageshadow='2' inkscape:pageopacity='0.0' guidetolerance='10.0' gridtolerance='10.0' objecttolerance='10.0' borderopacity='1.0' bordercolor='%23666666' pagecolor='%23ffffff' id='base' showgrid='false' inkscape:zoom='2.8875' inkscape:cx='1.0476778' inkscape:cy='65.135002' inkscape:window-x='515' inkscape:window-y='154' inkscape:current-layer='svg2' inkscape:window-maximized='0'/%3e %3cdefs id='defs4'%3e %3cinkscape:perspective sodipodi:type='inkscape:persp3d' inkscape:vp_x='0 : 10 : 1' inkscape:vp_y='0 : 1000 : 0' inkscape:vp_z='20 : 10 : 1' inkscape:persp3d-origin='10 : 6.6666667 : 1' id='perspective18'/%3e %3cfilter id='filter'%3e %3cfeGaussianBlur stdDeviation='0.4858' id='feGaussianBlur7'/%3e %3c/filter%3e %3c/defs%3e %3cpath style='fill:%23ffff00;fill-opacity:1;stroke:%23000000;stroke-width:5.2827301;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1' id='path13' d='m 64.321061,9.894986 c -3.403927,4.904341 -3.31629,4.79328 -4.848773,6.787338 -0.930048,1.631215 -2.329857,10.573931 -2.296198,14.687238 0.02089,2.552583 -0.165767,4.084366 -0.535967,4.397075 -0.312521,0.264032 -1.955246,1.083861 -3.645501,1.815777 -2.982352,1.291403 -3.732027,1.373484 -25.370713,2.81941 -17.135838,1.145053 -22.5286969,1.658918 -23.3310019,2.216614 -2.2245336,1.546326 -2.3121808,5.07125 -0.2901467,11.719857 l 1.043267,3.430023 52.8477186,8.884048 0.692335,29.494054 0.01971,6.40165 c -0.64265,0.19749 -2.132128,0.0181 -6.776943,0.4953 -4.644847,0.47728 -8.706195,1.10109 -9.025144,1.39052 -1.282344,1.16362 -0.192953,10.22934 1.22744,10.21594 2.24188,-0.0211 10.540611,1.09775 10.978887,1.4781 0.314502,0.2698 7.444817,1.235 10.190318,1.20909 2.745474,-0.0259 9.860468,-1.12385 10.168921,-1.40131 0.43221,-0.38854 8.711114,-1.66393 10.953002,-1.68511 1.420428,-0.0134 2.361236,-9.09834 1.060089,-10.23754 -0.325507,-0.28141 -4.394571,-0.8304 -9.046518,-1.21992 -4.651923,-0.38948 -6.789901,-0.12812 -7.435885,-0.31367 l -0.809377,-0.15912 1.585705,-35.798139 52.694174,-9.880328 0.98695,-3.449201 c 1.91291,-6.685769 1.7676,-10.208475 -0.48192,-11.712547 -0.8113,-0.542434 -6.21172,-0.954425 -23.36365,-1.775805 C 79.85281,38.667127 79.101952,38.599221 76.098902,37.364315 74.396938,36.664429 72.740928,35.875571 72.424256,35.61761 72.048971,35.311973 71.837318,33.783955 71.816418,31.231364 71.782757,27.118061 70.236785,18.203162 69.280184,16.589721 67.782945,14.906516 67.646504,14.859152 64.320983,9.895079 Z' inkscape:connector-curvature='0' sodipodi:nodetypes='ccscssscccccccscccscsccccccsscsccc'/%3e %3c/svg%3e"},441:t=>{t.exports="data:image/svg+xml,%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg width='100%25' height='100%25' viewBox='0 0 64 64' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cpath d='M52,36c0,11 -9,20 -20,20c-11,0 -20,-9 -20,-20c0,-9.7 6.9,-17.7 16,-19.6l0,7.6l14,-12l-14,-12l0,8.3c-13.6,1.9 -24,13.6 -24,27.7c0,15.4 12.6,28 28,28c15.4,0 28,-12.6 28,-28l-8,0Z' style='fill:%23fff;fill-rule:nonzero;'/%3e%3c/svg%3e"},964:t=>{t.exports="data:image/svg+xml,%3c!-- Created with Inkscape (http://www.inkscape.org/) --%3e %3csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' height='20' width='20' viewBox='0 0 20 20' id='svg2' version='1.1' inkscape:version='0.91 r13725' sodipodi:docname='windpointer.svg'%3e %3cdefs id='defs8' /%3e %3csodipodi:namedview pagecolor='%23ffffff' bordercolor='%23666666' borderopacity='1' objecttolerance='10' gridtolerance='10' guidetolerance='10' inkscape:pageopacity='0' inkscape:pageshadow='2' inkscape:window-width='1469' inkscape:window-height='961' id='namedview6' showgrid='true' units='px' showguides='false' inkscape:zoom='20.297462' inkscape:cx='7.2677431' inkscape:cy='13.60907' inkscape:window-x='38' inkscape:window-y='24' inkscape:window-maximized='0' inkscape:current-layer='svg2'%3e %3cinkscape:grid type='xygrid' id='grid3199' /%3e %3c/sodipodi:namedview%3e %3cmetadata id='metadata4'%3e %3crdf:RDF%3e %3ccc:Work rdf:about=''%3e %3cdc:format%3eimage/svg+xml%3c/dc:format%3e %3cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage' /%3e %3cdc:title%3e%3c/dc:title%3e %3c/cc:Work%3e %3c/rdf:RDF%3e %3c/metadata%3e %3cpath style='fill:%23ffff00;fill-rule:evenodd;stroke:%23000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;fill-opacity:1' d='M 10,0 15.043965,19.950733 10,15 4.9560346,19.950733 Z' id='path3241' inkscape:connector-curvature='0' sodipodi:nodetypes='ccccc' /%3e %3c/svg%3e"}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={id:n,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(379),e=i.n(t),n=i(788);e()(n.Z,{insert:"head",singleton:!1}),n.Z.locals;var o=i(424);e()(o.Z,{insert:"head",singleton:!1}),o.Z.locals;var r={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},s={};s[r.DEGREES]=2*Math.PI*6370997/360,s[r.FEET]=.3048,s[r.METERS]=1,s[r.USFEET]=1200/3937;const a=r,l=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||s[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function h(t,e,i){return Math.min(Math.max(t,e),i)}var u="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},c="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function p(t,e,i,n,o,r){var s=o-i,a=r-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=o,n=r):l>0&&(i+=s*l,n+=a*l)}return d(t,e,i,n)}function d(t,e,i,n){var o=i-t,r=n-e;return o*o+r*r}function f(t){return t*Math.PI/180}function g(t,e){var i=t%e;return i*e<0?i+e:i}function _(t,e,i){return t+i*(e-t)}var y,v=(y=function(t,e){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),m=6378137,x=Math.PI*m,w=[-x,-x,x,x],b=[-180,-85,180,85],S=m*Math.log(Math.tan(Math.PI/2)),C=function(t){function e(e){return t.call(this,{code:e,units:a.METERS,extent:w,global:!0,worldExtent:b,getPointResolution:function(t,e){return t/u(e[1]/m)}})||this}return v(e,t),e}(l),E=[new C("EPSG:3857"),new C("EPSG:102100"),new C("EPSG:102113"),new C("EPSG:900913"),new C("http://www.opengis.net/gml/srs/epsg.xml#3857")];var T=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),O=[-180,-90,180,90],I=6378137*Math.PI/180,R=function(t){function e(e,i){return t.call(this,{code:e,units:a.DEGREES,extent:O,axisOrientation:i,global:!0,metersPerUnit:I,worldExtent:O})||this}return T(e,t),e}(l),P=[new R("CRS:84"),new R("EPSG:4326","neu"),new R("urn:ogc:def:crs:OGC:1.3:CRS84"),new R("urn:ogc:def:crs:OGC:2:84"),new R("http://www.opengis.net/gml/srs/epsg.xml#4326","neu")],F={},M={};function k(t,e,i){var n=t.getCode(),o=e.getCode();n in M||(M[n]={}),M[n][o]=i}const L="top-left";function A(){return function(){throw new Error("Unimplemented abstract method.")}()}var D=0;function j(t){return t.ol_uid||(t.ol_uid=String(++D))}var z=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const G=function(t){function e(e){var i=this,n="Assertion failed. See https://openlayers.org/en/v"+"6.5.0".split("-")[0]+"/doc/errors/#"+e+" for details.";return(i=t.call(this,n)||this).code=e,i.name="AssertionError",i.message=n,i}return z(e,t),e}(Error);function W(t,e){if(!t)throw new G(e)}function X(t){for(var e=[1/0,1/0,-1/0,-1/0],i=0,n=t.length;io&&(l|=4),ar&&(l|=2),0===l&&(l=1),l}function H(t,e,i,n,o){return o?(o[0]=t,o[1]=e,o[2]=i,o[3]=n,o):[t,e,i,n]}function q(t){return H(1/0,1/0,-1/0,-1/0,t)}function J(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Q(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function $(t,e,i,n,o){for(;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ft(t){return t[2]180)&&(i[0]=g(n+180,360)-180),i}function Et(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||Tt(t,e)===_t)&&i}function Tt(t,e){var i=function(t,e){var i;return t in M&&e in M[t]&&(i=M[t][e]),i}(t.getCode(),e.getCode());return i||(i=yt),i}function Ot(t,e){return Tt(mt(t),mt(e))}function It(t,e,i){return Ot(e,i)(t,void 0,t.length)}var Rt,Pt,Ft,Mt=null;function kt(){return Mt}function Lt(t,e){return t}function At(t,e){return t}function Dt(t,e){return t}function jt(t,e){return t}wt(E),wt(P),Rt=E,Pt=function(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;sS?a=S:a<-S&&(a=-S),r[s+1]=a}return r},Ft=function(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;se?1:t0){for(o=1;o=1024){var o=0;for(var r in t)0==(3&o++)&&(delete t[r],--e)}n=function(t){var e,i,n,o,r;if(Qt.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),Jt.exec(t)){var s,a=t.length-1;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),o=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(o=(o<<4)+o)),r=[e,i,n,o/255]}else 0==t.indexOf("rgba(")?ie(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),ie(r)):W(!1,14);return r}(i),t[i]=n,++e}return n}}();function ee(t){return Array.isArray(t)?t:te(t)}function ie(t){return t[0]=h(t[0]+.5|0,0,255),t[1]=h(t[1]+.5|0,0,255),t[2]=h(t[2]+.5|0,0,255),t[3]=h(t[3],0,1),t}function ne(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function oe(t,e,i){return e+":"+t+":"+(i?$t(i):"null")}var re=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var n=oe(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var o=oe(t,e,i);this.cache_[o]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}());const se=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),ae="propertychange";var le="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1,o=arguments.length;n0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=Kt,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(zt),fe="change",ge="contextmenu",_e="click",ye="keydown",ve="keypress",me="resize",xe="touchmove",we="wheel";function be(t,e,i,n,o){if(n&&n!==t&&(i=i.bind(n)),o){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function Se(t,e,i,n){return be(t,e,i,n,!0)}function Ce(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),he(t))}var Ee=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Te=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return Ee(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(fe)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}const qe=function(t){function e(e){var i=this,n=le({},e);delete n.source,(i=t.call(this,n)||this).mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addEventListener(Fe(Xe),i.handleSourcePropertyChange_);var o=e.source?e.source:null;return i.setSource(o),i}return Ue(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Xe)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Ke},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ce(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=be(t,fe,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ce(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ce(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=be(t,Ze,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);W(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=be(this,fe,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Xe,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Ne);function Je(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Qe(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function $e(t,e){var i=Math.cos(e),n=Math.sin(e),o=t[0]*i-t[1]*n,r=t[1]*i+t[0]*n;return t[0]=o,t[1]=r,t}function ti(t,e){if(e.canWrapX()){var i=pt(e.getExtent()),n=function(t,e,i){var n=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]n[2])){var r=i||pt(n);o=Math.floor((t[0]-n[0])/r)}return o}(t,e,i);n&&(t[0]-=n*i)}return t}var ei=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function ii(t,e){re.expire()}const ni=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return ei(e,t),e.prototype.dispatchRenderEvent=function(t,e){A()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Ut(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ht(n,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,r,s,a){var l,h=e.viewState;function u(t,e,i,n){return o.call(r,e,t?i:null,n)}var c=h.projection,p=ti(t.slice(),c),d=[[0,0]];if(c.canWrapX()&&n){var f=pt(c.getExtent());d.push([-f,0],[f,0])}for(var g=e.layerStatesArray,_=g.length,y=[],v=[],m=0;m=0;--x){var w=g[x],b=w.layer;if(b.hasRenderer()&&He(w,h)&&s.call(a,b)){var S=b.getRenderer(),C=b.getSource();if(S&&C){var E=C.getWrapX()?p:t,T=u.bind(null,w.managed);v[0]=E[0]+d[m][0],v[1]=E[1]+d[m][1],l=S.forEachFeatureAtCoordinate(v,e,i,T,y)}if(l)return l}}if(0!==y.length){var O=1/y.length;return y.forEach((function(t,e){return t.distanceSq+=e*O})),y.sort((function(t,e){return t.distanceSq-e.distanceSq})),y.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){return A()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,o,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,Zt,this,o,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){A()},e.prototype.scheduleExpireIconCache=function(t){re.canExpireCache()&&t.postRenderFunctions.push(ii)},e}(zt);var oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ri=function(t){function e(e,i,n,o){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=n,r.context=o,r}return oi(e,t),e}(se);var si="ol-hidden",ai="ol-control",li=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"),hi=["style","variant","weight","size","lineHeight","family"],ui=function(t){var e=t.match(li);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,o=hi.length;n=0;--r)n[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,n=0;;++n){var o=i[n],r=e[n];if(!o&&!r)break;o!==r&&(o?r?t.insertBefore(r,o):(t.removeChild(o),--n):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent("postcompose",t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){for(var r=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],h=l.layer;if(h.hasRenderer()&&He(l,r)&&o(h)){var u=h.getRenderer().getDataAtPixel(t,e,i);if(u){var c=n(h,u);if(c)return c}}}},e}(ni),Zi="add",Bi="remove";var Ki=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vi="length",Ui=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.element=i,o.index=n,o}return Ki(e,t),e}(se);const Hi=function(t){function e(e,i){var n=t.call(this)||this,o=i||{};if(n.unique_=!!o.unique,n.array_=e||[],n.unique_)for(var r=0,s=n.array_.length;r0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Ce(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(xe,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ce(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ce),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(de),ln="postrender",hn="layergroup",un="size",cn="target",pn="view";var dn=1/0;const fn=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,he(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){W(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=dn&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,o=e[t],r=i[t],s=t;t>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),h=lt;){var s=this.getParentIndex_(e);if(!(n[s]>r))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=o,n[e]=r},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,o=this.elements_,r=this.priorities_,s=0,a=o.length;for(e=0;e0;)n=(i=this.dequeue()[0]).getKey(),0!==i.getState()||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++o,i.load())},e}(fn),yn="Point",vn="LineString",mn="Polygon",xn="MultiPoint",wn="MultiLineString",bn="MultiPolygon",Sn="GeometryCollection",Cn="Circle",En="center",Tn="resolution",On="rotation";function In(t,e,i){return function(n,o,r,s,a){if(n){var l=e?0:r[0]*o,u=e?0:r[1]*o,c=a?a[0]:0,p=a?a[1]:0,d=t[0]+l/2+c,f=t[2]-l/2+c,g=t[1]+u/2+p,_=t[3]-u/2+p;d>f&&(f=d=(f+d)/2),g>_&&(_=g=(_+g)/2);var y=h(n[0],d,f),v=h(n[1],g,_),m=30*o;return s&&i&&(y+=-m*Math.log(1+Math.max(0,d-n[0])/m)+m*Math.log(1+Math.max(0,n[0]-f)/m),v+=-m*Math.log(1+Math.max(0,g-n[1])/m)+m*Math.log(1+Math.max(0,n[1]-_)/m)),[y,v]}}}function Rn(t){return t}function Pn(t,e,i,n){var o=pt(e)/i[0],r=lt(e)/i[1];return n?Math.min(t,Math.max(o,r)):Math.min(t,Math.min(o,r))}function Fn(t,e,i){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),h(n,i/2,2*e)}function Mn(t,e,i,n,o){return function(r,s,a,l){if(void 0!==r){var u=n?Pn(t,n,a,o):t;return(void 0===i||i)&&l?Fn(r,u,e):h(r,e,u)}}}function kn(t){return void 0!==t?0:void 0}function Ln(t){return void 0!==t?t:void 0}function An(t){return Math.pow(t,3)}function Dn(t){return 1-An(1-t)}function jn(t){return 3*t*t-2*t*t*t}function zn(t){return t}const Gn="XY",Wn="XYZM";function Xn(t,e,i,n,o,r){for(var s=r||[],a=0,l=e;l1)a=i;else{if(p>0){for(var d=0;do&&(o=h),r=a,s=l}return o}function Jn(t,e,i,n,o,r,s,a,l,h,u){if(e==i)return h;var c,p;if(0===o){if((p=d(s,a,t[e],t[e+1]))0&&g>d)&&(f<0&&_0&&_>f)?(a=c,l=p):(r[s++]=a,r[s++]=l,h=a,u=l,a=c,l=p)}}return r[s++]=a,r[s++]=l,s}function eo(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=e;a0;){for(var c=h.pop(),d=h.pop(),f=0,g=t[d],_=t[d+1],y=t[c],v=t[c+1],m=d+n;mf&&(u=m,f=x)}f>o&&(l[(u-e)/n]=1,d+nr&&(h-a)*(r-l)-(o-a)*(u-l)>0&&s++:u<=r&&(h-a)*(r-l)-(o-a)*(u-l)<0&&s--,a=h,l=u}return 0!==s}function co(t,e,i,n,o,r){if(0===i.length)return!1;if(!uo(t,e,i[0],n,o,r))return!1;for(var s=1,a=i.length;s=o[0]&&r[2]<=o[2]||r[1]>=o[1]&&r[3]<=o[3]||function(t,e,i,n,o){for(var r,s=[t[e],t[e+1]],a=[];e+n=s&&g<=l),n||!(4&r)||4&o||(n=(_=d-(p-l)*f)>=a&&_<=h),n||!(8&r)||8&o||(n=(g=p-(d-a)/f)>=s&&g<=l),n||!(16&r)||16&o||(n=(_=d-(p-s)*f)>=a&&_<=h)}return n}(o,t,e)})))}function fo(t,e,i,n){for(;e0}function _o(t,e,i,n,o){for(var r=void 0!==o&&o,s=0,a=i.length;sx&&co(t,e,i,n,h=(u+c)/2,f)&&(m=h,x=w),u=c}return isNaN(m)&&(m=o[r]),s?(s.push(m,f,x),s):[m,f,x]}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new lo(this.getFlatInteriorPoint(),"XYM")},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new so(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],o=0,r=0,s=i.length;rc&&d1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i),!this.isDef()){var n=arguments[i-1];return n.center&&this.setCenterInternal(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&bo(e,!0))}for(var o=Date.now(),r=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,l=[],h=0;h0},e.prototype.getInteracting=function(){return this.hints_[1]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(0,-this.hints_[0]);for(var e=0,i=this.animations_.length;e=0;--i){for(var n=this.animations_[i],o=!0,r=0,s=n.length;r0?l/a.duration:1;h>=1?(a.complete=!0,h=1):o=!1;var u=a.easing(h);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],d=c+u*(a.targetCenter[0]-c),f=p+u*(a.targetCenter[1]-p);this.targetCenter_=[d,f]}if(a.sourceResolution&&a.targetResolution){var _=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){var y=this.getViewportSize_(this.getRotation()),v=this.constraints_.resolution(_,0,y,!0);this.targetCenter_=this.calculateCenterZoom(v,a.anchor)}this.targetResolution_=_,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var m=1===u?g(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){var x=this.constraints_.rotation(m,!0);this.targetCenter_=this.calculateCenterRotate(x,a.anchor)}this.targetRotation_=m}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(o){this.animations_[i]=null,this.setHint(0,-1);var w=n[0].callback;w&&bo(w,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,n=this.getCenterInternal();return void 0!==n&&($e(i=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),Je(i,e)),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenterInternal(),o=this.getResolution();return void 0!==n&&void 0!==o&&(i=[e[0]-t*(e[0]-n[0])/o,e[1]-t*(e[1]-n[1])/o]),i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Lt(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(En)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Dt(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),i=this.getCenterInternal();W(i,1);var n=this.getResolution();W(void 0!==n,2);var o=this.getRotation();return W(void 0!==o,3),at(i,n,o,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Tn)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(jt(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSize_(),n=pt(t)/i[0],o=lt(t)/i[1];return Math.max(n,o)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*o)}},e.prototype.getRotation=function(){return this.get(On)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/o}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),n=this.getCenterInternal(),o=this.padding;if(o){var r=this.getViewportSizeMinusPadding_();n=Co(n,this.getViewportSize_(),[r[0]/2+o[3],r[1]/2+o[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var o=Wt(this.resolutions_,t,1);n=o,e=this.resolutions_[o],i=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=h(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,h(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(W(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))W(!ft(t),25),i=xo(n=jt(t,this.getProjection()));else if(t.getType()===Cn){var n;(i=xo(n=jt(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),rt(n))}else{var o=kt();i=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(i,e)},e.prototype.fitInternal=function(t,e){var i=e||{},n=i.size;n||(n=this.getViewportSizeMinusPadding_());var o,r=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;o=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;for(var a=t.getFlatCoordinates(),l=this.getRotation(),h=Math.cos(-l),u=Math.sin(-l),c=1/0,p=1/0,d=-1/0,f=-1/0,g=t.getStride(),_=0,y=a.length;_=0;a--){var l=s[a];if(l.getMap()===this&&l.getActive()&&this.getTargetElement()&&(!l.handleEvent(t)||t.propagationStopped))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var o=t.viewHints;if(o[0]||o[1]){var r=!yi&&Date.now()-t.time>8;i=r?0:8,n=r?0:2}}e.getTilesLoading()0&&t[1]>0}(i)&&n&&n.isDef()){var s=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:at(a.center,a.resolution,a.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{}}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),o&&(!this.previousExtent_||!ft(this.previousExtent_)&&!J(r.extent,this.previousExtent_))&&(this.dispatchEvent(new tn("movestart",this,o)),this.previousExtent_=q(this.previousExtent_)),this.previousExtent_&&!r.viewHints[0]&&!r.viewHints[1]&&!J(r.extent,this.previousExtent_)&&(this.dispatchEvent(new tn("moveend",this,r)),N(r.extent,this.previousExtent_))),this.dispatchEvent(new tn(ln,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(hn,t)},e.prototype.setSize=function(t){this.set(un,t)},e.prototype.setTarget=function(t){this.set(cn,t)},e.prototype.setView=function(t){this.set(pn,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(Me);var Ro=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Po=function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return Ro(e,t),e.prototype.disposeInternal=function(){wi(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&wi(this.element);for(var e=0,i=this.listenerKeys.length;e0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Nt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,o=e.length;n0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:Dn}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(si);o||0!==i?o&&0!==i&&this.element.classList.remove(si):this.element.classList.add(si)}this.label_.style.transform=n}this.rotation_=i}},e}(Po);var Ao=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Do=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),target:n.target})||this;var o=void 0!==n.className?n.className:"ol-zoom",r=void 0!==n.delta?n.delta:1,s=void 0!==n.zoomInClassName?n.zoomInClassName:o+"-in",a=void 0!==n.zoomOutClassName?n.zoomOutClassName:o+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",h=void 0!==n.zoomOutLabel?n.zoomOutLabel:"−",u=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=u,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(_e,i.handleClick_.bind(i,r),!1);var d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof h?document.createTextNode(h):h),d.addEventListener(_e,i.handleClick_.bind(i,-r),!1);var f=o+" ol-unselectable "+ai,g=i.element;return g.className=f,g.appendChild(p),g.appendChild(d),i.duration_=void 0!==n.duration?n.duration:250,i}return Ao(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:Dn})):e.setZoom(n)}}},e}(Po),jo="active";var zo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Go(t,e,i,n){var o=t.getZoom();if(void 0!==o){var r=t.getConstrainedZoom(o+e),s=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==n?n:250,easing:Dn})}}const Wo=function(t){function e(e){var i=t.call(this)||this;return e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return zo(e,t),e.prototype.getActive=function(){return this.get(jo)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(jo,t)},e.prototype.setMap=function(t){this.map_=t},e}(Me);var Xo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Yo=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return Xo(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==on.DBLCLICK){var i=t.originalEvent,n=t.map,o=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;Go(n.getView(),r,o,this.duration_),i.preventDefault(),e=!0}return!e},e}(Wo);var No=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Zo(t){for(var e=t.length,i=0,n=0,o=0;o0}}else if(t.type==on.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==on.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===on.POINTERDOWN||e===on.POINTERDRAG||e===on.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==on.POINTERUP?delete this.trackedPointers_[i]:(t.type==on.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=ue(this.trackedPointers_)}},e}(Wo);function Ko(t){var e=arguments;return function(t){for(var i=!0,n=0,o=e.length;n0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Bo);var or=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const rr=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:Bt})||this).condition_=n.condition?n.condition:Vo,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return or(e,t),e.prototype.handleDragEvent=function(t){if(tr(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==kn){var n=e.getSize(),o=t.pixel,r=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=r-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!tr(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!(!tr(t)||!qo(t)||!this.condition_(t)||(t.map.getView().beginInteraction(),this.lastAngle_=void 0,0))},e}(Bo);var sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ar=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return sr(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},e.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_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new mo([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(zt);var lr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),hr=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.coordinate=i,o.mapBrowserEvent=n,o}return lr(e,t),e}(se);const ur=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.box_=new ar(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:qo,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return lr(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new hr("boxdrag",t.coordinate,t))},e.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 hr(e?"boxend":"boxcancel",t.coordinate,t)),!1},e.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 hr("boxstart",t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Bo);var cr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const pr=function(t){function e(e){var i=this,n=e||{},o=n.condition?n.condition:Qo;return(i=t.call(this,{condition:o,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return cr(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap(),i=e.getView(),n=e.getSize(),o=this.getGeometry().getExtent();if(this.out_){var r=i.calculateExtentInternal(n),s=function(t,e){return function(t,e){for(var i=0,n=e.length;i0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var o=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,o),this.initialVelocity_=Math.sqrt(o*o+r*r)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();var vr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),mr="trackpad";const xr=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var o=n.condition?n.condition:Ho;return i.condition_=n.onFocusOnly?Ko(Uo,o):o,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return vr(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==we)return!0;var e,i=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==we&&(e=n.deltaY,pi&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=gi),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?mr:"wheel");var r=i.getView();if(this.mode_===mr&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-h(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Go(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Wo);var wr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const br=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Bt),(i=t.call(this,o)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return wr(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=o-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=o;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==kn){var l=s.getViewport().getBoundingClientRect(),h=Zo(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2&&(t.map.getView().endInteraction(this.duration_),1))},e.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}return!1},e}(Bo);var Sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Cr=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Bt),(i=t.call(this,o)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Sr(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,r=i.clientY-n.clientY,s=Math.sqrt(o*o+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var h=a.getViewport().getBoundingClientRect(),u=Zo(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(u),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.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}return!1},e}(Bo);function Er(t){var e=t||{},i=new Hi,n=new yr(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new rr),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Yo({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new nr({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new br),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Cr({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new fr),i.push(new _r({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new xr({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new pr({duration:e.zoomDuration})),i}var Tr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Or=function(t){function e(e){return(e=le({},e)).controls||(e.controls=function(t){var e={},i=new Hi;return(void 0===e.zoom||e.zoom)&&i.push(new Do(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Lo(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Mo(e.attributionOptions)),i}()),e.interactions||(e.interactions=Er({onFocusOnly:!0})),t.call(this,e)||this}return Tr(e,t),e.prototype.createRenderer=function(){return new Ni(this)},e}(Io);var Ir=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Rr=function(t){function e(e,i,n){var o=t.call(this)||this,r=n||{};return o.tileCoord=e,o.state=i,o.interimTile=null,o.hifi=!0,o.key="",o.transition_=void 0===r.transition?250:r.transition,o.transitionStarts_={},o}return Ir(e,t),e.prototype.changed=function(){this.dispatchEvent(fe)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(2==t.getState())return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(2==t.getState()){t.interimTile=null;break}1==t.getState()?e=t:0==t.getState()?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(3!==this.state&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){A()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:An(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(de);var Pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Fr=function(t){function e(e,i,n,o){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=n,r.resolution=i,r.state=o,r}return Pr(e,t),e.prototype.changed=function(){this.dispatchEvent(fe)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return A()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){A()},e}(de);var Mr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function kr(t,e,i){var n=t;if(n.src&&yi){var o=n.decode(),r=!0;return o.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var s=[Se(n,"load",e),Se(n,"error",i)];return function(){s.forEach(Ce)}}!function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,n,0)||this;return a.src_=o,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.state=0,a.imageLoadFunction_=s,a}Mr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=lt(this.extent)/this.image_.height),this.state=2,this.unlistenImage_(),this.changed()},e.prototype.load=function(){0!=this.state&&3!=this.state||(this.state=1,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=kr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Fr);var Lr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ar=function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=o,a.src_=n,a.key=n,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.tileLoadFunction_=r,a}return Lr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){var t;this.state=3,this.unlistenImage_(),this.image_=((t=mi(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=2:this.state=4,this.unlistenImage_(),this.changed()},e.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=kr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Rr),Dr=function(){function t(t,e,i,n,o,r){this.sourceProj_=t,this.targetProj_=e;var s={},a=Ot(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&pt(n)==pt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?pt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?pt(this.targetProj_.getExtent()):null;var l=ut(i),h=ct(i),u=ot(i),p=nt(i),d=this.transformInv_(l),f=this.transformInv_(h),g=this.transformInv_(u),_=this.transformInv_(p),y=10+(r?Math.max(0,Math.ceil(c(it(i)/(r*r*256*256)))):0);if(this.addQuad_(l,h,u,p,d,f,g,_,y),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i.5&&u<1,d=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(d=pt(X([t,e,i,n]))/this.targetWorldWidth_>.25||d),!p&&this.sourceProj_.isGlobal()&&u&&(d=u>.25||d)),!(!d&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||dt(h,this.maxSourceExtent_)){var f=0;if(!(d||isFinite(o[0])&&isFinite(o[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)d=!0;else if(1!=(f=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!d){var _=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.transformInv_(_),v=void 0;v=p?(g(o[0],c)+g(s[0],c))/2-g(y[0],c):(o[0]+s[0])/2-y[0];var m=(o[1]+s[1])/2-y[1];d=v*v+m*m>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var x=[(e[0]+i[0])/2,(e[1]+i[1])/2],w=this.transformInv_(x),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],S=this.transformInv_(b);this.addQuad_(t,e,x,b,o,r,w,S,l-1),this.addQuad_(b,x,i,n,S,w,s,a,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(C),T=[(i[0]+n[0])/2,(i[1]+n[1])/2],O=this.transformInv_(T);this.addQuad_(t,C,T,n,o,E,O,a,l-1),this.addQuad_(C,e,i,T,E,r,s,O,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,n,o,s,a),0==(14&f)&&this.addTriangle_(t,i,e,o,s,r),f&&(0==(13&f)&&this.addTriangle_(e,n,t,r,a,o),0==(7&f)&&this.addTriangle_(e,n,i,r,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var o=e.source;Q(t,o[0]),Q(t,o[1]),Q(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();var jr,zr={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function Gr(t,e,i,n,o){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,o),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,o)),t.restore()}function Wr(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Xr(t,e,i,n){var o=It(i,e,t),r=xt(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(r*=s);var a=t.getMetersPerUnit();void 0!==a&&(r/=a);var l=t.getExtent();if(!l||B(l,o)){var h=xt(t,r,o)/r;isFinite(h)&&h>0&&(r/=h)}return r}var Yr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Nr=function(t){function e(e,i,n,o,r,s,a,l,u,c,p,d){var f=t.call(this,r,0)||this;f.renderEdges_=void 0!==p&&p,f.contextOptions_=d,f.pixelRatio_=a,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=i,f.targetTileGrid_=o,f.wrappedTileCoord_=s||r,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var g=o.getTileCoordExtent(f.wrappedTileCoord_),_=f.targetTileGrid_.getExtent(),y=f.sourceTileGrid_.getExtent(),v=_?ht(g,_):g;if(0===it(v))return f.state=4,f;var m=e.getExtent();m&&(y=y?ht(y,m):m);var x=o.getResolution(f.wrappedTileCoord_[0]),w=function(t,e,i,n){var o=rt(i),r=Xr(t,e,o,n);return(!isFinite(r)||r<=0)&&et(i,(function(i){return r=Xr(t,e,i,n),isFinite(r)&&r>0})),r}(e,n,v,x);if(!isFinite(w)||w<=0)return f.state=4,f;var b=void 0!==c?c:.5;if(f.triangulation_=new Dr(e,n,v,y,w*b,x),0===f.triangulation_.getTriangles().length)return f.state=4,f;f.sourceZ_=i.getZForResolution(w);var S=f.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(S[1]=h(S[1],y[1],y[3]),S[3]=h(S[3],y[1],y[3])):S=ht(S,y)),it(S)){for(var C=i.getTileRangeForExtentAndZ(S,f.sourceZ_),E=C.minX;E<=C.maxX;E++)for(var T=C.minY;T<=C.maxY;T++){var O=u(f.sourceZ_,E,T,a);O&&f.sourceTiles_.push(O)}0===f.sourceTiles_.length&&(f.state=4)}else f.state=4;return f}return Yr(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&2==e.getState()&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=3;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],o="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=function(t,e,i,n,o,r,s,a,l,h,u,c){var p=mi(Math.round(i*t),Math.round(i*e));if(le(p,c),0===l.length)return p.canvas;function d(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){var n,o;n=f,(o=t.extent)[0]n[2]&&(n[2]=o[2]),o[1]n[3]&&(n[3]=o[3])}));var g=pt(f),_=lt(f),y=mi(Math.round(i*g/n),Math.round(i*_/n));le(y,c);var v=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-f[0],o=-(t.extent[3]-f[3]),r=pt(t.extent),s=lt(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*v,o*v,r*v,s*v)}));var m=ut(s);return a.getTriangles().forEach((function(t,e,o){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],g=s[1][1],_=s[2][0],v=s[2][1],x=d((a[0][0]-m[0])/r),w=d(-(a[0][1]-m[1])/r),b=d((a[1][0]-m[0])/r),S=d(-(a[1][1]-m[1])/r),C=d((a[2][0]-m[0])/r),E=d(-(a[2][1]-m[1])/r),T=l,O=h;l=0,h=0;var I=function(t){for(var e=t.length,i=0;io&&(o=s,n=r)}if(0===o)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[u-=T,g-=O,0,0,b-x],[_-=T,v-=O,0,0,C-x],[0,0,u,g,S-w],[0,0,_,v,E-w]]);if(I){if(p.save(),p.beginPath(),function(){if(void 0===jr){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Gr(t,4,5,4,0),Gr(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;jr=Wr(e,0)||Wr(e,4)||Wr(e,8)}return jr}()||c===zr){p.moveTo(b,S);for(var R=x-b,P=w-S,F=0;F<4;F++)p.lineTo(b+d((F+1)*R/4),S+d(F*P/3)),3!=F&&p.lineTo(b+d((F+1)*R/4),S+d((F+1)*P/3));p.lineTo(C,E)}else p.moveTo(b,S),p.lineTo(x,w),p.lineTo(C,E);p.clip(),p.transform(I[0],I[2],I[1],I[3],x,w),p.translate(f[0]-T,f[3]-O),p.scale(n/i,-n/i),p.drawImage(y.canvas,0,0),p.restore()}})),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,o=(n[0][0]-m[0])/r,s=-(n[0][1]-m[1])/r,a=(n[1][0]-m[0])/r,l=-(n[1][1]-m[1])/r,h=(n[2][0]-m[0])/r,u=-(n[2][1]-m[1])/r;p.beginPath(),p.moveTo(a,l),p.lineTo(o,s),p.lineTo(h,u),p.closePath(),p.stroke()})),p.restore()),p.canvas}(n,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=2}this.changed()},e.prototype.load=function(){if(0==this.state){this.state=1,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var o=e.getState();if(0==o||1==o){t++;var r=be(e,fe,(function(i){var n=e.getState();2!=n&&3!=n&&4!=n||(Ce(r),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,i){0==t.getState()&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ce),this.sourcesListenerKeys_=null},e}(Rr),Zr=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return W(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return W(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){W(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Br(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function Kr(t,e,i){return t+"/"+e+"/"+i}function Vr(t){return Kr(t[0],t[1],t[2])}var Ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Hr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ur(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=(e=this.peekFirstKey(),e.split("/").map(Number))[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Vr(e.tileCoord)),e.release())}.bind(this))}var e},e}(Zr);var qr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Jr(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const Qr=function(t){function e(e){var i=t.call(this)||this;return i.projection_=mt(e.projection),i.attributions_=Jr(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ve,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return qr(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return A()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Jr(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Me);var $r=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function ts(t,e,i,n,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=i,o.maxY=n,o):new $r(t,e,i,n)}const es=$r;var is=[0,0,0];const ns=function(){function t(t){var e,i,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,W((e=this.resolutions_,!0,i=function(t,e){return e-t}||Gt,e.every((function(t,n){if(0===n)return!0;var o=i(e[n-1],t);return!(o>0||0===o)}))),17),!t.origins)for(var o=0,r=this.resolutions_.length-1;o=this.minZoom;){if(e(a,2===this.zoomFactor_?ts(o=Math.floor(o/2),o,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]0?n:Math.max(s/a[0],r/a[1]),h=o+1,u=new Array(h),c=0;ci||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(n,o)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,n){},e}(Qr),hs=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return as(e,t),e}(se);const us=ls;function cs(t,e){var i=/\{z\}/g,n=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(o,s[2].toString()).replace(r,(function(){var t=s[0],i=e.getFullTileRange(t);return W(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}var ps=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ds=function(t){function e(i){var n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(n.tileUrlFunction=i.tileUrlFunction),n.urls=null,i.urls?n.setUrls(i.urls):i.url&&n.setUrl(i.url),n.tileLoadingKeys_={},n}return ps(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=j(i),o=i.getState();1==o?(this.tileLoadingKeys_[n]=!0,e="tileloadstart"):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=3==o?"tileloaderror":2==o?"tileloadend":void 0),null!=e&&this.dispatchEvent(new hs(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n=i[1].charCodeAt(0),o=i[2].charCodeAt(0),r=void 0;for(r=n;r<=o;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var i=t.length,n=new Array(i),o=0;oOpenStreetMap | © OpenTopoMap | Little Navmap '];const n=void 0!==e.crossOrigin?e.crossOrigin:void 0,o=[256,256],r=[256,300],s=void 0!==e.url?e.url+"api/map/image?format=png&quality=75&width="+o[0]+"&height="+o[1]:void 0;super({attributions:i,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:n,imageSmoothing:e.imageSmoothing,maxZoom:void 0!==e.maxZoom?e.maxZoom:19,minZoom:void 0!==e.minZoom?e.minZoom:4,opaque:void 0===e.opaque||e.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:void 0,transition:e.transition,url:s,wrapX:e.wrapX,tileSize:[r[0],r[1]],projection:"EPSG:3857"}),this.setTileLoadFunction(this.defaultTileLoadFunction.bind(this))}defaultTileLoadFunction(t,e){const i=this.getTileGrid().getTileCoordExtent(t.getTileCoord()),n=Math.abs(i[2]-i[0])/6.6666,o=Ct([i[0]+n,i[1]+n],this.getProjection()),r=Ct([i[2]-n,i[3]-n],this.getProjection());t.getImage().src=e+"&leftlon="+o[0]+"&toplat="+o[1]+"&rightlon="+r[0]+"&bottomlat="+r[1]+"&detailfactor=10&reload="+Math.random()}getPixelRatio(){const t=this.tileGrid.getTileSize();return t[0]/t[1]}updateTileAtPixel(t,e){const i=e.getCoordinateFromPixel(t);this.updateTileAtLonLat(i,e)}updateTileAtLonLat(t,e){const i=this.tileGrid.getTileCoordForCoordAndZ(t,Math.round(e.getView().getZoom())),n=this.getTile(i[0],i[1],i[2],this.getPixelRatio(),this.getProjection());this.defaultTileLoadFunction(n,this.getUrls()[0]),setTimeout((()=>{e.renderSync()}),200)}}const xs="preload",ws="useInterimTilesOnError";var bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ss=function(t){function e(e){var i=this,n=e||{},o=le({},n);return delete o.preload,delete o.useInterimTilesOnError,(i=t.call(this,o)||this).setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return bs(e,t),e.prototype.getPreload=function(){return this.get(xs)},e.prototype.setPreload=function(t){this.set(xs,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(ws)},e.prototype.setUseInterimTilesOnError=function(t){this.set(ws,t)},e}(qe);var Cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Es=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Cs(e,t),e.prototype.getFeatures=function(t){return A()},e.prototype.prepareFrame=function(t){return A()},e.prototype.renderFrame=function(t,e){return A()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,o){var r=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,o,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){},e.prototype.getDataAtPixel=function(t,e,i){return A()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return 2!=e&&3!=e&&t.addEventListener(fe,this.boundHandleImageChange_),0==e&&(t.load(),e=t.getState()),2==e},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ve&&t.changed()},e}(Te);var Ts=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Os=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Ts(e,t),e.prototype.useContainer=function(t,e,i){var n,o,r=this.getLayer().getClassName();if(t&&""===t.style.opacity&&t.className===r&&(a=t.firstElementChild)instanceof HTMLCanvasElement&&(o=a.getContext("2d")),!o||0!==o.canvas.width&&o.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=o,this.containerReused=!0),!this.container){(n=document.createElement("div")).className=r;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(o=mi()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=o}},e.prototype.clip=function(t,e,i){var n=e.pixelRatio,o=e.size[0]*n/2,r=e.size[1]*n/2,s=e.viewState.rotation,a=ut(i),l=ct(i),h=ot(i),u=nt(i);Vt(e.coordinateToPixelTransform,a),Vt(e.coordinateToPixelTransform,l),Vt(e.coordinateToPixelTransform,h),Vt(e.coordinateToPixelTransform,u),t.save(),Wi(t,-s,o,r),t.beginPath(),t.moveTo(a[0]*n,a[1]*n),t.lineTo(l[0]*n,l[1]*n),t.lineTo(h[0]*n,h[1]*n),t.lineTo(u[0]*n,u[1]*n),t.clip(),Wi(t,s,o,r)},e.prototype.clipUnrotated=function(t,e,i){var n=ut(i),o=ct(i),r=ot(i),s=nt(i);Vt(e.coordinateToPixelTransform,n),Vt(e.coordinateToPixelTransform,o),Vt(e.coordinateToPixelTransform,r),Vt(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;Vt(a,n),Vt(a,o),Vt(a,r),Vt(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var o=new ri(t,this.inversePixelTransform,i,e);n.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_("prerender",t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_("postrender",t,e)},e.prototype.getRenderTransform=function(t,e,i,n,o,r,s){var a=o/2,l=r/2,h=n/e,u=-h,c=-t[0]+s,p=-t[1];return Ut(this.tempTransform,a,l,h,u,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n,o=Vt(this.inversePixelTransform,t.slice()),r=this.context,s=this.getLayer().getExtent();if(s&&!B(s,Vt(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(o[0]),l=Math.round(o[1]),h=document.createElement("canvas"),u=h.getContext("2d");h.width=1,h.height=1,u.clearRect(0,0,1,1),u.drawImage(r.canvas,a,l,1,1,0,0,1,1),n=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:n}return 0===n[3]?null:n},e}(Es);var Is=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Rs=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new es(0,0,0,0),i}return Is(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return 2==i||4==i||3==i&&!n},e.prototype.getTile=function(t,e,i,n){var o=n.pixelRatio,r=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,o,r);return 3==a.getState()&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(2)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,o=n.projection,r=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),p=u.getTileGridForProjection(o),d=p.getZForResolution(r,u.zDirection),f=p.getResolution(d),g=t.extent,_=i.extent&&jt(i.extent);_&&(g=ht(g,jt(i.extent)));var y=u.getTilePixelRatio(l),v=Math.round(t.size[0]*y),m=Math.round(t.size[1]*y);if(a){var x=Math.round(Math.sqrt(v*v+m*m));v=x,m=x}var w=f*v/2/y,b=f*m/2/y,S=[s[0]-w,s[1]-b,s[0]+w,s[1]+b],C=p.getTileRangeForExtentAndZ(g,d),E={};E[d]={};var T=this.createLoadedTileFinder(u,o,E),O=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var R=C.minX;R<=C.maxX;++R)for(var P=C.minY;P<=C.maxY;++P){var F=this.getTile(d,R,P,t);if(this.isDrawableTile(F)){var M=j(this);if(2==F.getState()){E[d][F.tileCoord.toString()]=F;var k=F.inTransition(M);this.newTiles_||!k&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(M,t.time))continue}var L=p.getTileCoordChildTileRange(F.tileCoord,I,O),A=!1;L&&(A=T(d+1,L)),A||p.forEachTileCoordParentTileRange(F.tileCoord,T,I,O)}var D=f/r;Ut(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,a,-v/2,-m/2);var z=function(t){return _i?qt(t):(Xi||(Xi=mi(1,1).canvas),Xi.style.transform=qt(t),Xi.style.transform)}(this.pixelTransform);this.useContainer(e,z,i.opacity);var G=this.context,W=G.canvas;Ht(this.inversePixelTransform,this.pixelTransform),Ut(this.tempTransform,v/2,m/2,D,D,0,-v/2,-m/2),W.width!=v||W.height!=m?(W.width=v,W.height=m):this.containerReused||G.clearRect(0,0,v,m),_&&this.clipUnrotated(G,t,_),le(G,u.getContextOptions()),this.preRender(G,t),this.renderedTiles.length=0;var X,Y,N,Z=Object.keys(E).map(Number);Z.sort(Gt),1!==i.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(X=[],Y=[]):Z=Z.reverse();for(var B=Z.length-1;B>=0;--B){var K=Z[B],V=u.getTilePixelSize(K,l,o),U=p.getResolution(K)/f,H=V[0]*U*D,q=V[1]*U*D,Q=p.getTileCoordForCoordAndZ(ut(S),K),$=p.getTileCoordExtent(Q),tt=Vt(this.tempTransform,[y*($[0]-S[0])/f,y*(S[3]-$[3])/f]),et=y*u.getGutterForProjection(o),it=E[K];for(var nt in it){var ot=(F=it[nt]).tileCoord,rt=tt[0]-(Q[1]-ot[1])*H,st=Math.round(rt+H),at=tt[1]-(Q[2]-ot[2])*q,lt=Math.round(at+q),ct=st-(R=Math.round(rt)),pt=lt-(P=Math.round(at)),dt=d===K;if(!(k=dt&&1!==F.getAlpha(j(this),t.time)))if(X){G.save(),N=[R,P,R+ct,P,R+ct,P+pt,R,P+pt];for(var ft=0,gt=X.length;ftu&&this.instructions.push([ia.CUSTOM,u,o,t,i,eo])):l==yn&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),o=this.coordinates.length,this.instructions.push([ia.CUSTOM,u,o,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[ia.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ia.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,n,o=e.length,r=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[ia.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[ia.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,o=t.lineDash,r=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!Nt(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=r,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[ia.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=N(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Y(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(na);var sa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const aa=function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return sa(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([ia.DRAW_IMAGE,o,r,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([ia.DRAW_IMAGE,o,r,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)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([ia.DRAW_IMAGE,o,r,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([ia.DRAW_IMAGE,o,r,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)}},e.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,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),o=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=o,this.image_=r,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(ra);var la=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ha=function(t){function e(e,i,n,o){return t.call(this,e,i,n,o)||this}return la(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var o=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[ia.MOVE_TO_LINE_TO,o,r];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ia.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ta);var r=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(r,0,r.length,s),this.hitDetectionInstructions.push($s),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ia.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ta);for(var r=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,h=0,u=r.length;ht&&(y>_&&(_=y,f=v,g=r),y=0,v=r-o)),s=a,u=p,c=d),l=m,h=x}return(y+=a)>_?[v,r]:[f,g]}var da=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fa={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},ga={Circle:ca,Default:ra,Image:aa,LineString:ha,Polygon:ca,Text:function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return da(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(i||n)){var r=this.coordinates,s=r.length,a=t.getType(),l=null,h=t.getStride();if("line"!==o.placement||a!=vn&&a!=wn&&a!=mn&&a!=bn){var u=o.overflow?null:[];switch(a){case yn:case xn:l=t.getFlatCoordinates();break;case vn:l=t.getFlatMidpoint();break;case Cn:l=t.getCenter();break;case wn:l=t.getFlatMidpoints(),h=2;break;case mn:l=t.getFlatInteriorPoint(),o.overflow||u.push(l[2]/this.resolution),h=3;break;case bn:var c=t.getFlatInteriorPoints();for(l=[],w=0,b=c.length;wR[2]}else T=w>O;var P,F=Math.PI,M=[],k=S+n===e;if(y=0,v=C,p=t[e=S],d=t[e+1],k){m();var L=Math.atan2(d-g,p-f);T&&(L+=L>0?-F:F);var A=(O+w)/2,D=(I+b)/2;return M[0]=[A,D,(E-r)/2,L,o],M}for(var j=0,z=o.length;j0?-F:F),void 0!==P){var W=G-P;if(W+=W>F?-2*F:W<-F?2*F:0,Math.abs(W)>s)return null}P=G;for(var X=j,Y=0;jt?t-l:o,x=r+h>e?e-h:r,w=d[3]+m*c[0]+d[1],b=d[0]+x*c[1]+d[2],S=y-d[3],C=v-d[0];return(f||0!==u)&&(Ta[0]=S,Ra[0]=S,Ta[1]=C,Oa[1]=C,Oa[0]=S+w,Ia[0]=Oa[0],Ia[1]=C+b,Ra[1]=Ia[1]),0!==u?(Vt(_=Ut([1,0,0,1,0,0],i,n,1,1,u,-i,-n),Ta),Vt(_,Oa),Vt(_,Ia),Vt(_,Ra),H(Math.min(Ta[0],Oa[0],Ia[0],Ra[0]),Math.min(Ta[1],Oa[1],Ia[1],Ra[1]),Math.max(Ta[0],Oa[0],Ia[0],Ra[0]),Math.max(Ta[1],Oa[1],Ia[1],Ra[1]),Ea)):H(Math.min(S,S+w),Math.min(C,C+b),Math.max(S,S+w),Math.max(C,C+b),Ea),p&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:h,declutterBox:{minX:Ea[0],minY:Ea[1],maxX:Ea[2],maxY:Ea[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,o,r,s){var a=!(!r&&!s),l=n.declutterBox,h=t.canvas,u=s?s[2]*n.scale[0]/2:0;return l.minX-u<=h.width/e&&l.maxX+u>=0&&l.minY-u<=h.height/e&&l.maxY+u>=0&&(a&&this.replayTextBackground_(t,Ta,Oa,Ia,Ra,r,s),function(t,e,i,n,o,r,s,a,l,h,u){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(u[0],u[1]),function(t,e){for(var i=t.contextInstructions,n=0,o=i.length;nz&&(this.fill_(t),P=0),F>z&&(t.stroke(),F=0),P||F||(t.beginPath(),f=NaN,g=NaN),++O;break;case ia.CIRCLE:var W=l[R=G[1]],X=l[R+1],Y=l[R+2]-W,N=l[R+3]-X,Z=Math.sqrt(Y*Y+N*N);t.moveTo(W+Z,X),t.arc(W,X,Z,0,2*Math.PI,!0),++O;break;case ia.CLOSE_PATH:t.closePath(),++O;break;case ia.CUSTOM:R=G[1],c=G[2];var B=G[3],K=G[4],V=6==G.length?G[5]:void 0;j.geometry=B,j.feature=S,O in L||(L[O]=[]);var U=L[O];V?V(l,R,c,2,U):(U[0]=l[R],U[1]=l[R+1],U.length=2),K(U,j),++O;break;case ia.DRAW_IMAGE:R=G[1],c=G[2],v=G[3],p=G[4],d=G[5];var H=G[6],q=G[7],J=G[8],Q=G[9],$=G[10],tt=G[11],et=G[12],it=G[13],nt=G[14];if(!v&&G.length>=19){m=G[18],x=G[19],w=G[20],b=G[21];var ot=this.drawLabelWithPointPlacement_(m,x,w,b);v=ot.label,G[3]=v;var rt=G[22];p=(ot.anchorX-rt)*this.pixelRatio,G[4]=p;var st=G[23];d=(ot.anchorY-st)*this.pixelRatio,G[5]=d,H=v.height,G[6]=H,it=v.width,G[13]=it}var at=void 0;G.length>24&&(at=G[24]);var lt=void 0,ht=void 0,ut=void 0;G.length>16?(lt=G[15],ht=G[16],ut=G[17]):(lt=Pi,ht=!1,ut=!1),$&&D?tt+=A:$||D||(tt-=A);for(var ct=0;Ri)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+o)*e+(t+r))+3),o>0&&a.push(4*((t-o)*e+(t+r))+3),r>0&&(a.push(4*((t+o)*e+(t-r))+3),o>0&&a.push(4*((t-o)*e+(t-r))+3))}for(var l=[],h=(o=0,n.length);o0){if(!r||c!==ma&&c!==ba||-1!==r.indexOf(t)){var h=(p[a]-3)/4,d=n-h%s,f=n-(h/s|0),g=o(t,e,d*d+f*f);if(g)return g}u.clearRect(0,0,s,s);break}}var f,g,_,y,v,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(Gt),f=m.length-1;f>=0;--f){var x=m[f].toString();for(_=this.executorsByZIndex_[x],g=La.length-1;g>=0;--g)if(void 0!==(y=_[c=La[g]])&&(v=y.executeHitDetection(u,a,i,d,h)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],o=e[2],r=e[3],s=[i,n,i,r,o,r,o,n];return Xn(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return ce(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,o,r,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(Gt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,h,u,c,p,d,f=r||La;for(s&&a.reverse(),l=0,h=a.length;l0,6);var c=void 0!==n.src?0:2;return i.color_=void 0!==n.color?ee(n.color):null,i.iconImage_=function(t,e,i,n,o,r){var s=re.get(e,n,r);return s||(s=new Ua(t,e,i,n,o,r),re.set(e,n,r,s)),s}(l,u,h,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:Za,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return Ha(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Wa||this.anchorYUnits_==Wa){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Wa&&(t[0]*=e[0]),this.anchorYUnits_==Wa&&(t[1]*=e[1])}if(this.anchorOrigin_!=Za){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Ba&&this.anchorOrigin_!=Na||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ya&&this.anchorOrigin_!=Na||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=Za){var i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;t=t.slice(),this.offsetOrigin_!=Ba&&this.offsetOrigin_!=Na||(t[0]=n[0]-i[0]-t[0]),this.offsetOrigin_!=Ya&&this.offsetOrigin_!=Na||(t[1]=n[1]-i[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(fe,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(fe,t)},e}(As);var Ja={Point:function(t,e,i,n,o){var r,s=i.getImage(),a=i.getText();if(o&&(t=o,r=s&&a&&a.getText()?{}:void 0),s){if(2!=s.getImageState())return;var l=t.getBuilder(i.getZIndex(),ma);l.setImageStyle(s,r),l.drawPoint(e,n)}if(a&&a.getText()){var h=t.getBuilder(i.getZIndex(),ba);h.setTextStyle(a,r),h.drawText(e,n)}},LineString:function(t,e,i,n,o){var r=i.getStroke();if(r){var s=t.getBuilder(i.getZIndex(),xa);s.setFillStrokeStyle(null,r),s.drawLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(o||t).getBuilder(i.getZIndex(),ba);l.setTextStyle(a),l.drawText(e,n)}},Polygon:function(t,e,i,n,o){var r=i.getFill(),s=i.getStroke();if(r||s){var a=t.getBuilder(i.getZIndex(),wa);a.setFillStrokeStyle(r,s),a.drawPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),ba);h.setTextStyle(l),h.drawText(e,n)}},MultiPoint:function(t,e,i,n,o){var r,s=i.getImage(),a=i.getText();if(o&&(t=o,r=s&&a&&a.getText()?{}:void 0),s){if(2!=s.getImageState())return;var l=t.getBuilder(i.getZIndex(),ma);l.setImageStyle(s,r),l.drawMultiPoint(e,n)}if(a&&a.getText()){var h=(o||t).getBuilder(i.getZIndex(),ba);h.setTextStyle(a,r),h.drawText(e,n)}},MultiLineString:function(t,e,i,n,o){var r=i.getStroke();if(r){var s=t.getBuilder(i.getZIndex(),xa);s.setFillStrokeStyle(null,r),s.drawMultiLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(o||t).getBuilder(i.getZIndex(),ba);l.setTextStyle(a),l.drawText(e,n)}},MultiPolygon:function(t,e,i,n,o){var r=i.getFill(),s=i.getStroke();if(s||r){var a=t.getBuilder(i.getZIndex(),wa);a.setFillStrokeStyle(r,s),a.drawMultiPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),ba);h.setTextStyle(l),h.drawText(e,n)}},GeometryCollection:function(t,e,i,n,o){var r,s,a=e.getGeometriesArray();for(r=0,s=a.length;r0&&(s.width=0),this.container;var h=Math.round(t.size[0]*i),u=Math.round(t.size[1]*i);s.width!=h||s.height!=u?(s.width=h,s.height=u,s.style.transform!==o&&(s.style.transform=o)):this.containerReused||r.clearRect(0,0,h,u),this.preRender(r,t);var c=t.viewState,p=(c.projection,!1);if(n.extent&&this.clipping){var d=jt(n.extent);(p=!K(d,t.extent)&&dt(d,t.extent))&&this.clipUnrotated(r,t,d)}this.renderWorlds(a,t),p&&r.restore(),this.postRender(r,t);var f=n.opacity,g=this.container;return f!==parseFloat(g.style.opacity)&&(g.style.opacity=1===f?"":String(f)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];Vt(this.pixelTransform,i);var n=this.renderedCenter_,o=this.renderedResolution_,r=this.renderedRotation_,s=this.renderedProjection_,a=this.renderedExtent_,l=this.getLayer(),h=[],u=i[0]/2,c=i[1]/2;h.push(this.getRenderTransform(n,o,r,.5,u,c,0).slice());var p=l.getSource(),d=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!K(d,a)){for(var f=a[0],g=pt(d),_=0,y=void 0;fd[2];)y=g*++_,h.push(this.getRenderTransform(n,o,r,.5,u,c,y).slice()),f-=g}this.hitDetectionImageData_=function(t,e,i,n,o,r,s){var a=mi(t[0]/2,t[1]/2);a.imageSmoothingEnabled=!1;for(var l=a.canvas,h=new Ga(a,.5,o,null,s),u=i.length,c=Math.floor(16777215/u),p={},d=1;d<=u;++d){var f=i[d-1],g=f.getStyleFunction()||n;if(n){var _=g(f,r);if(_){Array.isArray(_)||(_=[_]);for(var y="#"+("000000"+(d*c).toString(16)).slice(-6),v=0,m=_.length;v=i[2])){var o=pt(i),r=Math.floor((n[0]-i[0])/o)*o;t[0]-=r,t[2]-=r}return t}(y[0],h);w[0]v[0]&&w[2]>v[2]&&y.push([w[0]-m,w[1],w[2]-m,w[3]])}if(!this.dirty_&&this.renderedResolution_==u&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&K(this.renderedExtent_,_))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var b,S=new _a($a(u,c),_,u,c);this.getLayer().getDeclutter()&&(b=new _a($a(u,c),_,u,c));var C,E=kt();if(E){for(var T=0,O=y.length;T=200&&a.status<300){var n=e.getType(),l=void 0;"json"==n||"text"==n?l=a.responseText:"xml"==n?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):n==ul&&(l=a.response),l?r(e.readFeatures(l,{extent:i,featureProjection:o}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(t,e,i,n,o,(function(t,e){void 0!==r&&r(t),a.addFeatures(t)}),s||Kt)}}var pl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dl=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.feature=i,o.features=n,o}return pl(e,t),e}(se);const fl=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:Ve,wrapX:void 0===n.wrapX||n.wrapX})||this).loader_=Kt,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&(W(i.format_,7),i.loader_=cl(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:hl;var o,r,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new sl:null,i.loadedExtentsRtree_=new sl,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?r=n.features:n.features&&(r=(o=n.features).getArray()),s||void 0!==o||(o=new Hi(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==o&&i.bindFeaturesCollection_(o),i}return pl(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=j(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new dl(al,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[be(e,fe,this.handleFeatureChange_,this),be(e,ae,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(W(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],o=0,r=t.length;o',n.className="follow-control on ol-unselectable ol-control",n.appendChild(r),t.call(this,{element:n,target:o.target}),r.addEventListener("click",this.handleFollow.bind(this),!1)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.handleFollow=function(){i=!i,n.className=i?"follow-control on ol-unselectable ol-control":"follow-control off ol-unselectable ol-control",e()},o}(Po);var vl=i(441),ml=i.n(vl);const xl=function(t){var e,i=document.createElement("div");function n(n){var o=n||{};e=n.handleRefresh;var r=document.createElement("button");r.innerHTML='',i.className="refresh-control on ol-unselectable ol-control",i.appendChild(r),t.call(this,{element:i,target:o.target}),r.addEventListener("click",this.handleRefresh.bind(this),!1)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.handleRefresh=function(){e()},n}(Po),wl=(t,e,i)=>{fetch(t).then((t=>t.text())).then((t=>e(t))).catch((t=>{i(t)}))};var bl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Sl=function(t){function e(e){var i=t.call(this)||this;if(i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addEventListener(Fe(i.geometryName_),i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;i.setGeometry(n)}else{var o=e;i.setProperties(o)}return i}return bl(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Ce(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=be(t,fe,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){var e,i;this.style_=t,this.styleFunction_=t?"function"==typeof(e=t)?e:(Array.isArray(e)?i=e:(W("function"==typeof e.getZIndex,41),i=[e]),function(){return i}):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeEventListener(Fe(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=t,this.addEventListener(Fe(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(Me),Cl=class extends Wo{constructor(t={layer:void 0,url:void 0}){super(t),t.layer&&(this.layer=t.layer,this.source=this.layer.getSource()),this.url=t.url}handleEvent(t){switch(t.type){case"click":return this.layer||(this.source=new fl,this.layer=new rl({source:this.source}),this.getMap().addLayer(this.layer)),this.getFeaturesAtPixelListener(t),!1;default:return!0}}getFeaturesAtPixelListener(t){return this.getFeaturesAtPixel(t.pixel)}getFeaturesAtPixel(t){return this.getFeaturesAtCoordinates(this.getMap().getCoordinateFromPixel(t))}getFeaturesAtCoordinates(t,e=1){this.source.clear();let i=[];i.push(Je(t.map((t=>t)),[-1*e,-1*e])),i.push(Je(t.map((t=>t)),[1*e,-1*e])),i.push(Je(t.map((t=>t)),[1*e,1*e])),i.push(Je(t.map((t=>t)),[-1*e,1*e]));const n=X(i),o=this.getMap().getView().getProjection(),r=Ct([n[0],n[1]],o),s=Ct([n[0],n[3]],o),a=this.url+"api/map/features?leftlon="+r[0]+"&toplat="+r[1]+"&rightlon="+s[0]+"&bottomlat="+s[1]+"&detailfactor=13";wl(a,(t=>{try{const e=JSON.parse(t);this.getMap().littlenavmap.dispatch("map/features",e);let i=[],n=0;e.airports.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});i.push(e),++n}));let r=[];e.ndbs.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});r.push(e),++n}));let s=[];e.vors.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});s.push(e),++n}));let a=[];e.markers.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});a.push(e),++n}));let l=[];e.waypoints.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});l.push(e)})),this.source.addFeatures(i),this.source.addFeatures(r),this.source.addFeatures(s),this.source.addFeatures(a),this.source.addFeatures(l)}catch(t){console.log(t)}}),(t=>{console.log("error")}))}},El=class extends Sl{constructor(t={}){super(t),this.defaultStyle=new Vs({image:new qa({anchor:[.5,.5],anchorXUnits:"fraction",anchorYUnits:"fraction",src:_l(),scale:.5})}),this.setStyle(this.defaultStyle)}isVisible(){return null!=this.getStyle()}hide(){this.setStyle(null)}show(){this.setStyle(this.defaultStyle)}rotateImage(t){this.getStyle().getImage().setRotation(t)}},Tl=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=To(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Xs({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=To(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),Ol=class extends Sl{constructor(t={}){super(t),this.defaultStyle=new Vs({fill:new Xs({color:"rgba(255,255,255,0.4)"}),stroke:new Ys({color:"#3399CC",width:1.25}),text:new Tl({text:"1",textAlign:"left",fill:new Xs({color:"#000000"}),stroke:new Ys({color:"#FFFF99",width:3.5})})}),this.setStyle(this.defaultStyle)}updateText(t){this.getStyle().getText().setText(t)}isVisible(){return null!=this.getStyle()}hide(){this.setStyle(null)}show(){this.setStyle(this.defaultStyle)}};var Il=i(964),Rl=i.n(Il),Pl="/";console.log("Starting production mode:",Pl);const Fl=new class{constructor(t,e){this.fetch=wl,this.url=t,this.target=e,this.refreshInterval=1e3,this.sources=[new ms({url:this.url})],this.activesource=0,this.layers=[new Ms({source:this.sources[0],className:"lnm-layer-0",visible:!0})],this.following=!0,this.initMap()}initMap(){const t=[new yl({handleFollow:()=>{this.following=!this.following}}),new xl({handleRefresh:()=>{this.sources.forEach((t=>{t.refresh()}))}}),new Mo({collapsible:!1})];this.setupAircraftFeature(),this.setupWindIndicator(),this.map=new Or({controls:t,interactions:Er().extend([new Cl({url:this.url})]),layers:this.layers,target:this.target,view:new Eo({maxZoom:19,minZoom:4})}),this.map.littlenavmap=this}setupAircraftFeature(){this.aircraftFeature=new El,this.aircraftLabelFeature=new Ol;const t=new fl({features:[this.aircraftFeature,this.aircraftLabelFeature]}),e=new rl({source:t});this.layers.push(e)}setupWindIndicator(){this.windIndicator=document.createElement("div");var t=document.createElement("div"),e=document.createElement("div");t.style.float="left",t.style.position="relative",t.style.marginRight="5px",e.style.float="left",e.style.position="relative",e.style.backgroundColor="#FFFF99",this.windIndicator.style.position="absolute",this.windIndicator.style.top="2%",this.windIndicator.style.left="48%",this.windIndicatorPointer=document.createElement("img"),this.windIndicatorPointer.src=Rl(),this.windIndicatorPointer.style.width="40px",this.windIndicatorTextDirection=document.createElement("span"),this.windIndicatorTextDirection.innerHTML="";var i=document.createElement("br");this.windIndicatorTextSpeed=document.createElement("span"),this.windIndicatorTextSpeed.innerHTML="",t.appendChild(this.windIndicatorPointer),e.appendChild(this.windIndicatorTextDirection),e.appendChild(i),e.appendChild(this.windIndicatorTextSpeed),this.windIndicator.appendChild(t),this.windIndicator.appendChild(e),this.windIndicator.style.visibility="hidden",document.body.appendChild(this.windIndicator)}getAircraftPosition(t){this.fetch(this.url+"api/sim/info",(e=>{try{const i=JSON.parse(e);i.active?(this.simInfo=i,this.dispatch("sim/info",i),this.setAircraftFeatureVisibility(!0),this.setWindIndicatorVisibility(!0),t([i.position.lon,i.position.lat],i.heading)):(this.simInfo=null,this.setAircraftFeatureVisibility(!1),this.setWindIndicatorVisibility(!1))}catch(t){console.log(t)}}),(t=>{console.log(t)}))}setAircraftFeatureVisibility(t){t&&!this.aircraftFeature.isVisible()?(this.aircraftFeature.show(),this.aircraftLabelFeature.show()):!t&&this.aircraftFeature.isVisible()&&(this.aircraftFeature.hide(),this.aircraftLabelFeature.hide())}setWindIndicatorVisibility(t){t&&"hidden"==this.windIndicator.style.visibility?this.windIndicator.style.visibility="visible":t||"visible"!=this.windIndicator.style.visibility||(this.windIndicator.style.visibility="hidden",this.windIndicatorTextDirection.innerHTML="",this.windIndicatorTextSpeed.innerHTML="")}ParseDMS(t){var e=t.split(/[^\d\w!.]+/),i=this.ConvertDMSToDD(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),e[3]);return[this.ConvertDMSToDD(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),e[7]),i]}ConvertDMSToDD(t,e,i,n){var o=t+e/60+i/3600;return"S"!=n&&"W"!=n||(o*=-1),o}startRefreshLoop(){setTimeout(this.refreshLoop.bind(this),this.refreshInterval)}refreshLoop(){this.getAircraftPosition(((t,e)=>{const i=St(t);this.aircraftFeature.setGeometry(new lo(i)),this.aircraftFeature.rotateImage(this.degreesToRadians(e)),this.aircraftLabelFeature.setGeometry(new lo(i)),this.aircraftLabelFeature.updateText("GS "+this.simInfo.ground_speed.toFixed(0)+"kts\nALT "+this.simInfo.indicated_altitude.toFixed(0)+"ft"),this.windIndicatorPointer.style.transform="rotate("+(this.simInfo.wind_direction-180)+"deg)",this.windIndicatorTextDirection.innerHTML=this.simInfo.wind_direction.toFixed(0)+" °M",this.windIndicatorTextSpeed.innerHTML=this.simInfo.wind_speed.toFixed(0)+" kts",this.following&&this.map.getView().animate({center:i,duration:200})})),setTimeout(this.refreshLoop.bind(this),this.refreshInterval)}degreesToRadians(t){return t*(Math.PI/180)}toggleActiveSource(){this.activesource<1?(this.activesource=1,this.layers[1].setVisible(!0),this.layers[0].setVisible(!1)):(this.activesource=0,this.layers[0].setVisible(!0),this.layers[1].setVisible(!1))}dispatch(t,e){const i=new CustomEvent(t,{detail:e});window.dispatchEvent(i)}}(Pl,"map");window.littlenavmap=Fl,window.onload=()=>{Fl.map.getView().setZoom(9),Fl.map.getView().setCenter(St([0,0])),Fl.startRefreshLoop()}})()})(); \ No newline at end of file +(()=>{var t={788:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(645),o=i.n(n)()((function(t){return t[1]}));o.push([t.id,'.ol-box {\n box-sizing: border-box;\n border-radius: 2px;\n border: 2px solid blue;\n}\n\n.ol-mouse-position {\n top: 8px;\n right: 8px;\n position: absolute;\n}\n\n.ol-scale-line {\n background: rgba(0,60,136,0.3);\n border-radius: 4px;\n bottom: 8px;\n left: 8px;\n padding: 2px;\n position: absolute;\n}\n.ol-scale-line-inner {\n border: 1px solid #eee;\n border-top: none;\n color: #eee;\n font-size: 10px;\n text-align: center;\n margin: 1px;\n will-change: contents, width;\n transition: all 0.25s;\n}\n.ol-scale-bar {\n position: absolute;\n bottom: 8px;\n left: 8px;\n}\n.ol-scale-step-marker {\n width: 1px;\n height: 15px;\n background-color: #000000;\n float: right;\n z-Index: 10;\n}\n.ol-scale-step-text {\n position: absolute;\n bottom: -5px;\n font-size: 12px;\n z-Index: 11;\n color: #000000;\n text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;\n}\n.ol-scale-text {\n position: absolute;\n font-size: 14px;\n text-align: center;\n bottom: 25px;\n color: #000000;\n text-shadow: -2px 0 #FFFFFF, 0 2px #FFFFFF, 2px 0 #FFFFFF, 0 -2px #FFFFFF;\n}\n.ol-scale-singlebar {\n position: relative;\n height: 10px;\n z-Index: 9;\n box-sizing: border-box;\n border: 1px solid black;\n}\n\n.ol-unsupported {\n display: none;\n}\n.ol-viewport, .ol-unselectable {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n.ol-selectable {\n -webkit-touch-callout: default;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n}\n.ol-grabbing {\n cursor: -webkit-grabbing;\n cursor: -moz-grabbing;\n cursor: grabbing;\n}\n.ol-grab {\n cursor: move;\n cursor: -webkit-grab;\n cursor: -moz-grab;\n cursor: grab;\n}\n.ol-control {\n position: absolute;\n background-color: rgba(255,255,255,0.4);\n border-radius: 4px;\n padding: 2px;\n}\n.ol-control:hover {\n background-color: rgba(255,255,255,0.6);\n}\n.ol-zoom {\n top: .5em;\n left: .5em;\n}\n.ol-rotate {\n top: .5em;\n right: .5em;\n transition: opacity .25s linear, visibility 0s linear;\n}\n.ol-rotate.ol-hidden {\n opacity: 0;\n visibility: hidden;\n transition: opacity .25s linear, visibility 0s linear .25s;\n}\n.ol-zoom-extent {\n top: 4.643em;\n left: .5em;\n}\n.ol-full-screen {\n right: .5em;\n top: .5em;\n}\n\n.ol-control button {\n display: block;\n margin: 1px;\n padding: 0;\n color: white;\n font-size: 1.14em;\n font-weight: bold;\n text-decoration: none;\n text-align: center;\n height: 1.375em;\n width: 1.375em;\n line-height: .4em;\n background-color: rgba(0,60,136,0.5);\n border: none;\n border-radius: 2px;\n}\n.ol-control button::-moz-focus-inner {\n border: none;\n padding: 0;\n}\n.ol-zoom-extent button {\n line-height: 1.4em;\n}\n.ol-compass {\n display: block;\n font-weight: normal;\n font-size: 1.2em;\n will-change: transform;\n}\n.ol-touch .ol-control button {\n font-size: 1.5em;\n}\n.ol-touch .ol-zoom-extent {\n top: 5.5em;\n}\n.ol-control button:hover,\n.ol-control button:focus {\n text-decoration: none;\n background-color: rgba(0,60,136,0.7);\n}\n.ol-zoom .ol-zoom-in {\n border-radius: 2px 2px 0 0;\n}\n.ol-zoom .ol-zoom-out {\n border-radius: 0 0 2px 2px;\n}\n\n\n.ol-attribution {\n text-align: right;\n bottom: .5em;\n right: .5em;\n max-width: calc(100% - 1.3em);\n}\n\n.ol-attribution ul {\n margin: 0;\n padding: 0 .5em;\n color: #000;\n text-shadow: 0 0 2px #fff;\n}\n.ol-attribution li {\n display: inline;\n list-style: none;\n}\n.ol-attribution li:not(:last-child):after {\n content: " ";\n}\n.ol-attribution img {\n max-height: 2em;\n max-width: inherit;\n vertical-align: middle;\n}\n.ol-attribution ul, .ol-attribution button {\n display: inline-block;\n}\n.ol-attribution.ol-collapsed ul {\n display: none;\n}\n.ol-attribution:not(.ol-collapsed) {\n background: rgba(255,255,255,0.8);\n}\n.ol-attribution.ol-uncollapsible {\n bottom: 0;\n right: 0;\n border-radius: 4px 0 0;\n}\n.ol-attribution.ol-uncollapsible img {\n margin-top: -.2em;\n max-height: 1.6em;\n}\n.ol-attribution.ol-uncollapsible button {\n display: none;\n}\n\n.ol-zoomslider {\n top: 4.5em;\n left: .5em;\n height: 200px;\n}\n.ol-zoomslider button {\n position: relative;\n height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n top: 5.5em;\n}\n\n.ol-overviewmap {\n left: 0.5em;\n bottom: 0.5em;\n}\n.ol-overviewmap.ol-uncollapsible {\n bottom: 0;\n left: 0;\n border-radius: 0 4px 0 0;\n}\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n display: inline-block;\n}\n.ol-overviewmap .ol-overviewmap-map {\n border: 1px solid #7b98bc;\n height: 150px;\n margin: 2px;\n width: 150px;\n}\n.ol-overviewmap:not(.ol-collapsed) button{\n bottom: 1px;\n left: 2px;\n position: absolute;\n}\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n display: none;\n}\n.ol-overviewmap:not(.ol-collapsed) {\n background: rgba(255,255,255,0.8);\n}\n.ol-overviewmap-box {\n border: 2px dotted rgba(0,60,136,0.7);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n cursor: move;\n}\n',""]);const r=o},424:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(645),o=i.n(n)()((function(t){return t[1]}));o.push([t.id," #debug {\n display: none;\n position: absolute;\n width: 100px;\n height: 100px;\n left: 0;\n top: 0;\n background-color: rgba(255, 0, 0, 0.5);\n }\n\n html,\n body {\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n }\n\n .map {\n width: 100%;\n height: 100%;\n }\n\n .ol-control button img {\n width: 25px;\n height: 25px;\n }\n\n .follow-control {\n top: 10px;\n right: .5em;\n }\n\n .follow-control.on {\n background-color: #639684;\n }\n\n .follow-control.off {}\n\n .refresh-control {\n top: 60px;\n right: .5em;\n }",""]);const r=o},645:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(n)for(var r=0;ro;){if(r-o>600){var a=r-o+1,l=n-o+1,h=Math.log(a),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(a-u)/a)*(l-a/2<0?-1:1);t(i,n,Math.max(o,Math.floor(n-l*u/a+c)),Math.min(r,Math.floor(n+(a-l)*u/a+c)),s)}var p=i[n],d=o,f=r;for(e(i,o,n),s(i[r],p)>0&&e(i,o,r);d0;)f--}0===s(i[o],p)?e(i,o,f):e(i,++f,r),f<=n&&(o=f+1),n<=f&&(r=f-1)}}(t,n,o||0,r||t.length-1,s||i)}function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,e){return te?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,i,n,o,r){for(var s=[i,n];s.length;)if(!((n=s.pop())-(i=s.pop())<=o)){var a=i+Math.ceil((n-i)/o/2)*o;t(e,a,i,n,r),s.push(i,a,a,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,i=[];if(!d(t,e))return i;for(var n=this.toBBox,o=[];e;){for(var r=0;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(n,o,e)},n.prototype._split=function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var s=this._chooseSplitIndex(i,o,n),a=f(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,r(i,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},n.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,i){for(var n,o,r,a,l,h,c,p=1/0,d=1/0,f=e;f<=i-e;f++){var g=s(t,0,f,this.toBBox),_=s(t,f,i,this.toBBox),y=(o=g,r=_,void 0,void 0,void 0,void 0,a=Math.max(o.minX,r.minX),l=Math.max(o.minY,r.minY),h=Math.min(o.maxX,r.maxX),c=Math.min(o.maxY,r.maxY),Math.max(0,h-a)*Math.max(0,c-l)),v=u(g)+u(_);y=e;d--){var f=t.children[d];a(l,t.leaf?o(f):f),h+=c(l)}return h},n.prototype._adjustParentBBoxes=function(t,e,i){for(var n=i;n>=0;n--)a(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():r(t[e],this.toBBox)},n}()},379:(t,e,i)=>{"use strict";var n,o=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),r=[];function s(t){for(var e=-1,i=0;i{t.exports="data:image/svg+xml,%3csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' version='1.0' width='128' height='128' id='svg2' sodipodi:version='0.32' inkscape:version='0.91 r13725' sodipodi:docname='aircraft_small_user.svg' inkscape:output_extension='org.inkscape.output.svg.inkscape'%3e %3cmetadata id='metadata16'%3e %3crdf:RDF%3e %3ccc:Work rdf:about=''%3e %3cdc:format%3eimage/svg+xml%3c/dc:format%3e %3cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/%3e %3cdc:title/%3e %3c/cc:Work%3e %3c/rdf:RDF%3e %3c/metadata%3e %3csodipodi:namedview inkscape:window-height='735' inkscape:window-width='1073' inkscape:pageshadow='2' inkscape:pageopacity='0.0' guidetolerance='10.0' gridtolerance='10.0' objecttolerance='10.0' borderopacity='1.0' bordercolor='%23666666' pagecolor='%23ffffff' id='base' showgrid='false' inkscape:zoom='2.8875' inkscape:cx='1.0476778' inkscape:cy='65.135002' inkscape:window-x='515' inkscape:window-y='154' inkscape:current-layer='svg2' inkscape:window-maximized='0'/%3e %3cdefs id='defs4'%3e %3cinkscape:perspective sodipodi:type='inkscape:persp3d' inkscape:vp_x='0 : 10 : 1' inkscape:vp_y='0 : 1000 : 0' inkscape:vp_z='20 : 10 : 1' inkscape:persp3d-origin='10 : 6.6666667 : 1' id='perspective18'/%3e %3cfilter id='filter'%3e %3cfeGaussianBlur stdDeviation='0.4858' id='feGaussianBlur7'/%3e %3c/filter%3e %3c/defs%3e %3cpath style='fill:%23ffff00;fill-opacity:1;stroke:%23000000;stroke-width:5.2827301;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1' id='path13' d='m 64.321061,9.894986 c -3.403927,4.904341 -3.31629,4.79328 -4.848773,6.787338 -0.930048,1.631215 -2.329857,10.573931 -2.296198,14.687238 0.02089,2.552583 -0.165767,4.084366 -0.535967,4.397075 -0.312521,0.264032 -1.955246,1.083861 -3.645501,1.815777 -2.982352,1.291403 -3.732027,1.373484 -25.370713,2.81941 -17.135838,1.145053 -22.5286969,1.658918 -23.3310019,2.216614 -2.2245336,1.546326 -2.3121808,5.07125 -0.2901467,11.719857 l 1.043267,3.430023 52.8477186,8.884048 0.692335,29.494054 0.01971,6.40165 c -0.64265,0.19749 -2.132128,0.0181 -6.776943,0.4953 -4.644847,0.47728 -8.706195,1.10109 -9.025144,1.39052 -1.282344,1.16362 -0.192953,10.22934 1.22744,10.21594 2.24188,-0.0211 10.540611,1.09775 10.978887,1.4781 0.314502,0.2698 7.444817,1.235 10.190318,1.20909 2.745474,-0.0259 9.860468,-1.12385 10.168921,-1.40131 0.43221,-0.38854 8.711114,-1.66393 10.953002,-1.68511 1.420428,-0.0134 2.361236,-9.09834 1.060089,-10.23754 -0.325507,-0.28141 -4.394571,-0.8304 -9.046518,-1.21992 -4.651923,-0.38948 -6.789901,-0.12812 -7.435885,-0.31367 l -0.809377,-0.15912 1.585705,-35.798139 52.694174,-9.880328 0.98695,-3.449201 c 1.91291,-6.685769 1.7676,-10.208475 -0.48192,-11.712547 -0.8113,-0.542434 -6.21172,-0.954425 -23.36365,-1.775805 C 79.85281,38.667127 79.101952,38.599221 76.098902,37.364315 74.396938,36.664429 72.740928,35.875571 72.424256,35.61761 72.048971,35.311973 71.837318,33.783955 71.816418,31.231364 71.782757,27.118061 70.236785,18.203162 69.280184,16.589721 67.782945,14.906516 67.646504,14.859152 64.320983,9.895079 Z' inkscape:connector-curvature='0' sodipodi:nodetypes='ccscssscccccccscccscsccccccsscsccc'/%3e %3c/svg%3e"},441:t=>{t.exports="data:image/svg+xml,%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg width='100%25' height='100%25' viewBox='0 0 64 64' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cpath d='M52,36c0,11 -9,20 -20,20c-11,0 -20,-9 -20,-20c0,-9.7 6.9,-17.7 16,-19.6l0,7.6l14,-12l-14,-12l0,8.3c-13.6,1.9 -24,13.6 -24,27.7c0,15.4 12.6,28 28,28c15.4,0 28,-12.6 28,-28l-8,0Z' style='fill:%23fff;fill-rule:nonzero;'/%3e%3c/svg%3e"},964:t=>{t.exports="data:image/svg+xml,%3c!-- Created with Inkscape (http://www.inkscape.org/) --%3e %3csvg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:cc='http://creativecommons.org/ns%23' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' height='20' width='20' viewBox='0 0 20 20' id='svg2' version='1.1' inkscape:version='0.91 r13725' sodipodi:docname='windpointer.svg'%3e %3cdefs id='defs8' /%3e %3csodipodi:namedview pagecolor='%23ffffff' bordercolor='%23666666' borderopacity='1' objecttolerance='10' gridtolerance='10' guidetolerance='10' inkscape:pageopacity='0' inkscape:pageshadow='2' inkscape:window-width='1469' inkscape:window-height='961' id='namedview6' showgrid='true' units='px' showguides='false' inkscape:zoom='20.297462' inkscape:cx='7.2677431' inkscape:cy='13.60907' inkscape:window-x='38' inkscape:window-y='24' inkscape:window-maximized='0' inkscape:current-layer='svg2'%3e %3cinkscape:grid type='xygrid' id='grid3199' /%3e %3c/sodipodi:namedview%3e %3cmetadata id='metadata4'%3e %3crdf:RDF%3e %3ccc:Work rdf:about=''%3e %3cdc:format%3eimage/svg+xml%3c/dc:format%3e %3cdc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage' /%3e %3cdc:title%3e%3c/dc:title%3e %3c/cc:Work%3e %3c/rdf:RDF%3e %3c/metadata%3e %3cpath style='fill:%23ffff00;fill-rule:evenodd;stroke:%23000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;fill-opacity:1' d='M 10,0 15.043965,19.950733 10,15 4.9560346,19.950733 Z' id='path3241' inkscape:connector-curvature='0' sodipodi:nodetypes='ccccc' /%3e %3c/svg%3e"}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={id:n,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(379),e=i.n(t),n=i(788);e()(n.Z,{insert:"head",singleton:!1}),n.Z.locals;var o=i(424);e()(o.Z,{insert:"head",singleton:!1}),o.Z.locals;var r={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},s={};s[r.DEGREES]=2*Math.PI*6370997/360,s[r.FEET]=.3048,s[r.METERS]=1,s[r.USFEET]=1200/3937;const a=r,l=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||s[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function h(t,e,i){return Math.min(Math.max(t,e),i)}var u="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},c="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function p(t,e,i,n,o,r){var s=o-i,a=r-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=o,n=r):l>0&&(i+=s*l,n+=a*l)}return d(t,e,i,n)}function d(t,e,i,n){var o=i-t,r=n-e;return o*o+r*r}function f(t){return t*Math.PI/180}function g(t,e){var i=t%e;return i*e<0?i+e:i}function _(t,e,i){return t+i*(e-t)}var y,v=(y=function(t,e){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),m=6378137,x=Math.PI*m,w=[-x,-x,x,x],b=[-180,-85,180,85],S=m*Math.log(Math.tan(Math.PI/2)),C=function(t){function e(e){return t.call(this,{code:e,units:a.METERS,extent:w,global:!0,worldExtent:b,getPointResolution:function(t,e){return t/u(e[1]/m)}})||this}return v(e,t),e}(l),E=[new C("EPSG:3857"),new C("EPSG:102100"),new C("EPSG:102113"),new C("EPSG:900913"),new C("http://www.opengis.net/gml/srs/epsg.xml#3857")];var T=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),O=[-180,-90,180,90],I=6378137*Math.PI/180,R=function(t){function e(e,i){return t.call(this,{code:e,units:a.DEGREES,extent:O,axisOrientation:i,global:!0,metersPerUnit:I,worldExtent:O})||this}return T(e,t),e}(l),P=[new R("CRS:84"),new R("EPSG:4326","neu"),new R("urn:ogc:def:crs:OGC:1.3:CRS84"),new R("urn:ogc:def:crs:OGC:2:84"),new R("http://www.opengis.net/gml/srs/epsg.xml#4326","neu")],F={},M={};function k(t,e,i){var n=t.getCode(),o=e.getCode();n in M||(M[n]={}),M[n][o]=i}const L="top-left";function A(){return function(){throw new Error("Unimplemented abstract method.")}()}var D=0;function j(t){return t.ol_uid||(t.ol_uid=String(++D))}var z=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const G=function(t){function e(e){var i=this,n="Assertion failed. See https://openlayers.org/en/v"+"6.5.0".split("-")[0]+"/doc/errors/#"+e+" for details.";return(i=t.call(this,n)||this).code=e,i.name="AssertionError",i.message=n,i}return z(e,t),e}(Error);function W(t,e){if(!t)throw new G(e)}function X(t){for(var e=[1/0,1/0,-1/0,-1/0],i=0,n=t.length;io&&(l|=4),ar&&(l|=2),0===l&&(l=1),l}function H(t,e,i,n,o){return o?(o[0]=t,o[1]=e,o[2]=i,o[3]=n,o):[t,e,i,n]}function q(t){return H(1/0,1/0,-1/0,-1/0,t)}function J(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Q(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function $(t,e,i,n,o){for(;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ft(t){return t[2]180)&&(i[0]=g(n+180,360)-180),i}function Et(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||Tt(t,e)===_t)&&i}function Tt(t,e){var i=function(t,e){var i;return t in M&&e in M[t]&&(i=M[t][e]),i}(t.getCode(),e.getCode());return i||(i=yt),i}function Ot(t,e){return Tt(mt(t),mt(e))}function It(t,e,i){return Ot(e,i)(t,void 0,t.length)}var Rt,Pt,Ft,Mt=null;function kt(){return Mt}function Lt(t,e){return t}function At(t,e){return t}function Dt(t,e){return t}function jt(t,e){return t}wt(E),wt(P),Rt=E,Pt=function(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;sS?a=S:a<-S&&(a=-S),r[s+1]=a}return r},Ft=function(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;se?1:t0){for(o=1;o=1024){var o=0;for(var r in t)0==(3&o++)&&(delete t[r],--e)}n=function(t){var e,i,n,o,r;if(Qt.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),Jt.exec(t)){var s,a=t.length-1;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),o=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(o=(o<<4)+o)),r=[e,i,n,o/255]}else 0==t.indexOf("rgba(")?ie(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),ie(r)):W(!1,14);return r}(i),t[i]=n,++e}return n}}();function ee(t){return Array.isArray(t)?t:te(t)}function ie(t){return t[0]=h(t[0]+.5|0,0,255),t[1]=h(t[1]+.5|0,0,255),t[2]=h(t[2]+.5|0,0,255),t[3]=h(t[3],0,1),t}function ne(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function oe(t,e,i){return e+":"+t+":"+(i?$t(i):"null")}var re=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var n=oe(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var o=oe(t,e,i);this.cache_[o]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}());const se=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),ae="propertychange";var le="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1,o=arguments.length;n0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=Kt,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(zt),fe="change",ge="contextmenu",_e="click",ye="keydown",ve="keypress",me="resize",xe="touchmove",we="wheel";function be(t,e,i,n,o){if(n&&n!==t&&(i=i.bind(n)),o){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function Se(t,e,i,n){return be(t,e,i,n,!0)}function Ce(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),he(t))}var Ee=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Te=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return Ee(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(fe)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}const qe=function(t){function e(e){var i=this,n=le({},e);delete n.source,(i=t.call(this,n)||this).mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addEventListener(Fe(Xe),i.handleSourcePropertyChange_);var o=e.source?e.source:null;return i.setSource(o),i}return Ue(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Xe)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Ke},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ce(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=be(t,fe,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ce(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ce(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=be(t,Ze,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);W(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=be(this,fe,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Xe,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Ne);function Je(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Qe(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function $e(t,e){var i=Math.cos(e),n=Math.sin(e),o=t[0]*i-t[1]*n,r=t[1]*i+t[0]*n;return t[0]=o,t[1]=r,t}function ti(t,e){if(e.canWrapX()){var i=pt(e.getExtent()),n=function(t,e,i){var n=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]n[2])){var r=i||pt(n);o=Math.floor((t[0]-n[0])/r)}return o}(t,e,i);n&&(t[0]-=n*i)}return t}var ei=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function ii(t,e){re.expire()}const ni=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return ei(e,t),e.prototype.dispatchRenderEvent=function(t,e){A()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Ut(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ht(n,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,r,s,a){var l,h=e.viewState;function u(t,e,i,n){return o.call(r,e,t?i:null,n)}var c=h.projection,p=ti(t.slice(),c),d=[[0,0]];if(c.canWrapX()&&n){var f=pt(c.getExtent());d.push([-f,0],[f,0])}for(var g=e.layerStatesArray,_=g.length,y=[],v=[],m=0;m=0;--x){var w=g[x],b=w.layer;if(b.hasRenderer()&&He(w,h)&&s.call(a,b)){var S=b.getRenderer(),C=b.getSource();if(S&&C){var E=C.getWrapX()?p:t,T=u.bind(null,w.managed);v[0]=E[0]+d[m][0],v[1]=E[1]+d[m][1],l=S.forEachFeatureAtCoordinate(v,e,i,T,y)}if(l)return l}}if(0!==y.length){var O=1/y.length;return y.forEach((function(t,e){return t.distanceSq+=e*O})),y.sort((function(t,e){return t.distanceSq-e.distanceSq})),y.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){return A()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,o,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,Zt,this,o,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){A()},e.prototype.scheduleExpireIconCache=function(t){re.canExpireCache()&&t.postRenderFunctions.push(ii)},e}(zt);var oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ri=function(t){function e(e,i,n,o){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=n,r.context=o,r}return oi(e,t),e}(se);var si="ol-hidden",ai="ol-control",li=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"),hi=["style","variant","weight","size","lineHeight","family"],ui=function(t){var e=t.match(li);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,o=hi.length;n=0;--r)n[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,n=0;;++n){var o=i[n],r=e[n];if(!o&&!r)break;o!==r&&(o?r?t.insertBefore(r,o):(t.removeChild(o),--n):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent("postcompose",t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o){for(var r=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],h=l.layer;if(h.hasRenderer()&&He(l,r)&&o(h)){var u=h.getRenderer().getDataAtPixel(t,e,i);if(u){var c=n(h,u);if(c)return c}}}},e}(ni),Zi="add",Bi="remove";var Ki=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vi="length",Ui=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.element=i,o.index=n,o}return Ki(e,t),e}(se);const Hi=function(t){function e(e,i){var n=t.call(this)||this,o=i||{};if(n.unique_=!!o.unique,n.array_=e||[],n.unique_)for(var r=0,s=n.array_.length;r0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Ce(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(xe,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ce(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ce),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(de),ln="postrender",hn="layergroup",un="size",cn="target",pn="view";var dn=1/0;const fn=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,he(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){W(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=dn&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,o=e[t],r=i[t],s=t;t>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),h=lt;){var s=this.getParentIndex_(e);if(!(n[s]>r))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=o,n[e]=r},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,o=this.elements_,r=this.priorities_,s=0,a=o.length;for(e=0;e0;)n=(i=this.dequeue()[0]).getKey(),0!==i.getState()||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++o,i.load())},e}(fn),yn="Point",vn="LineString",mn="Polygon",xn="MultiPoint",wn="MultiLineString",bn="MultiPolygon",Sn="GeometryCollection",Cn="Circle",En="center",Tn="resolution",On="rotation";function In(t,e,i){return function(n,o,r,s,a){if(n){var l=e?0:r[0]*o,u=e?0:r[1]*o,c=a?a[0]:0,p=a?a[1]:0,d=t[0]+l/2+c,f=t[2]-l/2+c,g=t[1]+u/2+p,_=t[3]-u/2+p;d>f&&(f=d=(f+d)/2),g>_&&(_=g=(_+g)/2);var y=h(n[0],d,f),v=h(n[1],g,_),m=30*o;return s&&i&&(y+=-m*Math.log(1+Math.max(0,d-n[0])/m)+m*Math.log(1+Math.max(0,n[0]-f)/m),v+=-m*Math.log(1+Math.max(0,g-n[1])/m)+m*Math.log(1+Math.max(0,n[1]-_)/m)),[y,v]}}}function Rn(t){return t}function Pn(t,e,i,n){var o=pt(e)/i[0],r=lt(e)/i[1];return n?Math.min(t,Math.max(o,r)):Math.min(t,Math.min(o,r))}function Fn(t,e,i){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),h(n,i/2,2*e)}function Mn(t,e,i,n,o){return function(r,s,a,l){if(void 0!==r){var u=n?Pn(t,n,a,o):t;return(void 0===i||i)&&l?Fn(r,u,e):h(r,e,u)}}}function kn(t){return void 0!==t?0:void 0}function Ln(t){return void 0!==t?t:void 0}function An(t){return Math.pow(t,3)}function Dn(t){return 1-An(1-t)}function jn(t){return 3*t*t-2*t*t*t}function zn(t){return t}const Gn="XY",Wn="XYZM";function Xn(t,e,i,n,o,r){for(var s=r||[],a=0,l=e;l1)a=i;else{if(p>0){for(var d=0;do&&(o=h),r=a,s=l}return o}function Jn(t,e,i,n,o,r,s,a,l,h,u){if(e==i)return h;var c,p;if(0===o){if((p=d(s,a,t[e],t[e+1]))0&&g>d)&&(f<0&&_0&&_>f)?(a=c,l=p):(r[s++]=a,r[s++]=l,h=a,u=l,a=c,l=p)}}return r[s++]=a,r[s++]=l,s}function eo(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=e;a0;){for(var c=h.pop(),d=h.pop(),f=0,g=t[d],_=t[d+1],y=t[c],v=t[c+1],m=d+n;mf&&(u=m,f=x)}f>o&&(l[(u-e)/n]=1,d+nr&&(h-a)*(r-l)-(o-a)*(u-l)>0&&s++:u<=r&&(h-a)*(r-l)-(o-a)*(u-l)<0&&s--,a=h,l=u}return 0!==s}function co(t,e,i,n,o,r){if(0===i.length)return!1;if(!uo(t,e,i[0],n,o,r))return!1;for(var s=1,a=i.length;s=o[0]&&r[2]<=o[2]||r[1]>=o[1]&&r[3]<=o[3]||function(t,e,i,n,o){for(var r,s=[t[e],t[e+1]],a=[];e+n=s&&g<=l),n||!(4&r)||4&o||(n=(_=d-(p-l)*f)>=a&&_<=h),n||!(8&r)||8&o||(n=(g=p-(d-a)/f)>=s&&g<=l),n||!(16&r)||16&o||(n=(_=d-(p-s)*f)>=a&&_<=h)}return n}(o,t,e)})))}function fo(t,e,i,n){for(;e0}function _o(t,e,i,n,o){for(var r=void 0!==o&&o,s=0,a=i.length;sx&&co(t,e,i,n,h=(u+c)/2,f)&&(m=h,x=w),u=c}return isNaN(m)&&(m=o[r]),s?(s.push(m,f,x),s):[m,f,x]}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new lo(this.getFlatInteriorPoint(),"XYM")},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new so(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],o=0,r=0,s=i.length;rc&&d1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i),!this.isDef()){var n=arguments[i-1];return n.center&&this.setCenterInternal(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&bo(e,!0))}for(var o=Date.now(),r=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,l=[],h=0;h0},e.prototype.getInteracting=function(){return this.hints_[1]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(0,-this.hints_[0]);for(var e=0,i=this.animations_.length;e=0;--i){for(var n=this.animations_[i],o=!0,r=0,s=n.length;r0?l/a.duration:1;h>=1?(a.complete=!0,h=1):o=!1;var u=a.easing(h);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],d=c+u*(a.targetCenter[0]-c),f=p+u*(a.targetCenter[1]-p);this.targetCenter_=[d,f]}if(a.sourceResolution&&a.targetResolution){var _=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);if(a.anchor){var y=this.getViewportSize_(this.getRotation()),v=this.constraints_.resolution(_,0,y,!0);this.targetCenter_=this.calculateCenterZoom(v,a.anchor)}this.targetResolution_=_,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var m=1===u?g(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);if(a.anchor){var x=this.constraints_.rotation(m,!0);this.targetCenter_=this.calculateCenterRotate(x,a.anchor)}this.targetRotation_=m}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(o){this.animations_[i]=null,this.setHint(0,-1);var w=n[0].callback;w&&bo(w,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,n=this.getCenterInternal();return void 0!==n&&($e(i=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),Je(i,e)),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenterInternal(),o=this.getResolution();return void 0!==n&&void 0!==o&&(i=[e[0]-t*(e[0]-n[0])/o,e[1]-t*(e[1]-n[1])/o]),i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Lt(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(En)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Dt(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),i=this.getCenterInternal();W(i,1);var n=this.getResolution();W(void 0!==n,2);var o=this.getRotation();return W(void 0!==o,3),at(i,n,o,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Tn)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(jt(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSize_(),n=pt(t)/i[0],o=lt(t)/i[1];return Math.max(n,o)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*o)}},e.prototype.getRotation=function(){return this.get(On)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,o=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/o}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),n=this.getCenterInternal(),o=this.padding;if(o){var r=this.getViewportSizeMinusPadding_();n=Co(n,this.getViewportSize_(),[r[0]/2+o[3],r[1]/2+o[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var o=Wt(this.resolutions_,t,1);n=o,e=this.resolutions_[o],i=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=h(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,h(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(W(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))W(!ft(t),25),i=xo(n=jt(t,this.getProjection()));else if(t.getType()===Cn){var n;(i=xo(n=jt(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),rt(n))}else{var o=kt();i=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(i,e)},e.prototype.fitInternal=function(t,e){var i=e||{},n=i.size;n||(n=this.getViewportSizeMinusPadding_());var o,r=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;o=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;for(var a=t.getFlatCoordinates(),l=this.getRotation(),h=Math.cos(-l),u=Math.sin(-l),c=1/0,p=1/0,d=-1/0,f=-1/0,g=t.getStride(),_=0,y=a.length;_=0;a--){var l=s[a];if(l.getMap()===this&&l.getActive()&&this.getTargetElement()&&(!l.handleEvent(t)||t.propagationStopped))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var o=t.viewHints;if(o[0]||o[1]){var r=!yi&&Date.now()-t.time>8;i=r?0:8,n=r?0:2}}e.getTilesLoading()0&&t[1]>0}(i)&&n&&n.isDef()){var s=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:at(a.center,a.resolution,a.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{}}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),o&&(!this.previousExtent_||!ft(this.previousExtent_)&&!J(r.extent,this.previousExtent_))&&(this.dispatchEvent(new tn("movestart",this,o)),this.previousExtent_=q(this.previousExtent_)),this.previousExtent_&&!r.viewHints[0]&&!r.viewHints[1]&&!J(r.extent,this.previousExtent_)&&(this.dispatchEvent(new tn("moveend",this,r)),N(r.extent,this.previousExtent_))),this.dispatchEvent(new tn(ln,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(hn,t)},e.prototype.setSize=function(t){this.set(un,t)},e.prototype.setTarget=function(t){this.set(cn,t)},e.prototype.setView=function(t){this.set(pn,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(Me);var Ro=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Po=function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return Ro(e,t),e.prototype.disposeInternal=function(){wi(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&wi(this.element);for(var e=0,i=this.listenerKeys.length;e0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Nt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,o=e.length;n0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:Dn}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains(si);o||0!==i?o&&0!==i&&this.element.classList.remove(si):this.element.classList.add(si)}this.label_.style.transform=n}this.rotation_=i}},e}(Po);var Ao=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Do=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),target:n.target})||this;var o=void 0!==n.className?n.className:"ol-zoom",r=void 0!==n.delta?n.delta:1,s=void 0!==n.zoomInClassName?n.zoomInClassName:o+"-in",a=void 0!==n.zoomOutClassName?n.zoomOutClassName:o+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",h=void 0!==n.zoomOutLabel?n.zoomOutLabel:"−",u=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=u,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(_e,i.handleClick_.bind(i,r),!1);var d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof h?document.createTextNode(h):h),d.addEventListener(_e,i.handleClick_.bind(i,-r),!1);var f=o+" ol-unselectable "+ai,g=i.element;return g.className=f,g.appendChild(p),g.appendChild(d),i.duration_=void 0!==n.duration?n.duration:250,i}return Ao(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getZoom();if(void 0!==i){var n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:Dn})):e.setZoom(n)}}},e}(Po),jo="active";var zo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Go(t,e,i,n){var o=t.getZoom();if(void 0!==o){var r=t.getConstrainedZoom(o+e),s=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==n?n:250,easing:Dn})}}const Wo=function(t){function e(e){var i=t.call(this)||this;return e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return zo(e,t),e.prototype.getActive=function(){return this.get(jo)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(jo,t)},e.prototype.setMap=function(t){this.map_=t},e}(Me);var Xo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Yo=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return Xo(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==on.DBLCLICK){var i=t.originalEvent,n=t.map,o=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;Go(n.getView(),r,o,this.duration_),i.preventDefault(),e=!0}return!e},e}(Wo);var No=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Zo(t){for(var e=t.length,i=0,n=0,o=0;o0}}else if(t.type==on.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==on.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===on.POINTERDOWN||e===on.POINTERDRAG||e===on.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==on.POINTERUP?delete this.trackedPointers_[i]:(t.type==on.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=ue(this.trackedPointers_)}},e}(Wo);function Ko(t){var e=arguments;return function(t){for(var i=!0,n=0,o=e.length;n0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Bo);var or=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const rr=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:Bt})||this).condition_=n.condition?n.condition:Vo,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return or(e,t),e.prototype.handleDragEvent=function(t){if(tr(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==kn){var n=e.getSize(),o=t.pixel,r=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=r-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!tr(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!(!tr(t)||!qo(t)||!this.condition_(t)||(t.map.getView().beginInteraction(),this.lastAngle_=void 0,0))},e}(Bo);var sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ar=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return sr(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},e.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_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new mo([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(zt);var lr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),hr=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.coordinate=i,o.mapBrowserEvent=n,o}return lr(e,t),e}(se);const ur=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.box_=new ar(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:qo,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return lr(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new hr("boxdrag",t.coordinate,t))},e.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 hr(e?"boxend":"boxcancel",t.coordinate,t)),!1},e.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 hr("boxstart",t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Bo);var cr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const pr=function(t){function e(e){var i=this,n=e||{},o=n.condition?n.condition:Qo;return(i=t.call(this,{condition:o,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return cr(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap(),i=e.getView(),n=e.getSize(),o=this.getGeometry().getExtent();if(this.out_){var r=i.calculateExtentInternal(n),s=function(t,e){return function(t,e){for(var i=0,n=e.length;i0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var o=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,o),this.initialVelocity_=Math.sqrt(o*o+r*r)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();var vr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),mr="trackpad";const xr=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var o=n.condition?n.condition:Ho;return i.condition_=n.onFocusOnly?Ko(Uo,o):o,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return vr(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==we)return!0;var e,i=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==we&&(e=n.deltaY,pi&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=gi),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?mr:"wheel");var r=i.getView();if(this.mode_===mr&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-h(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Go(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Wo);var wr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const br=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Bt),(i=t.call(this,o)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return wr(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=o-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=o;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==kn){var l=s.getViewport().getBoundingClientRect(),h=Zo(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),this.rotating_&&(s.render(),a.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2&&(t.map.getView().endInteraction(this.duration_),1))},e.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}return!1},e}(Bo);var Sr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Cr=function(t){function e(e){var i=this,n=e||{},o=n;return o.stopDown||(o.stopDown=Bt),(i=t.call(this,o)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Sr(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,r=i.clientY-n.clientY,s=Math.sqrt(o*o+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var h=a.getViewport().getBoundingClientRect(),u=Zo(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(u),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0},e.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}return!1},e}(Bo);function Er(t){var e=t||{},i=new Hi,n=new yr(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new rr),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Yo({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new nr({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new br),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Cr({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new fr),i.push(new _r({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new xr({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new pr({duration:e.zoomDuration})),i}var Tr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Or=function(t){function e(e){return(e=le({},e)).controls||(e.controls=function(t){var e={},i=new Hi;return(void 0===e.zoom||e.zoom)&&i.push(new Do(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new Lo(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Mo(e.attributionOptions)),i}()),e.interactions||(e.interactions=Er({onFocusOnly:!0})),t.call(this,e)||this}return Tr(e,t),e.prototype.createRenderer=function(){return new Ni(this)},e}(Io);var Ir=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Rr=function(t){function e(e,i,n){var o=t.call(this)||this,r=n||{};return o.tileCoord=e,o.state=i,o.interimTile=null,o.hifi=!0,o.key="",o.transition_=void 0===r.transition?250:r.transition,o.transitionStarts_={},o}return Ir(e,t),e.prototype.changed=function(){this.dispatchEvent(fe)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(2==t.getState())return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(2==t.getState()){t.interimTile=null;break}1==t.getState()?e=t:0==t.getState()?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(3!==this.state&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){A()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:An(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(de);var Pr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Fr=function(t){function e(e,i,n,o){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=n,r.resolution=i,r.state=o,r}return Pr(e,t),e.prototype.changed=function(){this.dispatchEvent(fe)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return A()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){A()},e}(de);var Mr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function kr(t,e,i){var n=t;if(n.src&&yi){var o=n.decode(),r=!0;return o.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var s=[Se(n,"load",e),Se(n,"error",i)];return function(){s.forEach(Ce)}}!function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,n,0)||this;return a.src_=o,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.state=0,a.imageLoadFunction_=s,a}Mr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=lt(this.extent)/this.image_.height),this.state=2,this.unlistenImage_(),this.changed()},e.prototype.load=function(){0!=this.state&&3!=this.state||(this.state=1,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=kr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Fr);var Lr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ar=function(t){function e(e,i,n,o,r,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=o,a.src_=n,a.key=n,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.tileLoadFunction_=r,a}return Lr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){var t;this.state=3,this.unlistenImage_(),this.image_=((t=mi(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=2:this.state=4,this.unlistenImage_(),this.changed()},e.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=kr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Rr),Dr=function(){function t(t,e,i,n,o,r){this.sourceProj_=t,this.targetProj_=e;var s={},a=Ot(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&pt(n)==pt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?pt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?pt(this.targetProj_.getExtent()):null;var l=ut(i),h=ct(i),u=ot(i),p=nt(i),d=this.transformInv_(l),f=this.transformInv_(h),g=this.transformInv_(u),_=this.transformInv_(p),y=10+(r?Math.max(0,Math.ceil(c(it(i)/(r*r*256*256)))):0);if(this.addQuad_(l,h,u,p,d,f,g,_,y),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i.5&&u<1,d=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(d=pt(X([t,e,i,n]))/this.targetWorldWidth_>.25||d),!p&&this.sourceProj_.isGlobal()&&u&&(d=u>.25||d)),!(!d&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||dt(h,this.maxSourceExtent_)){var f=0;if(!(d||isFinite(o[0])&&isFinite(o[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)d=!0;else if(1!=(f=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!d){var _=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.transformInv_(_),v=void 0;v=p?(g(o[0],c)+g(s[0],c))/2-g(y[0],c):(o[0]+s[0])/2-y[0];var m=(o[1]+s[1])/2-y[1];d=v*v+m*m>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var x=[(e[0]+i[0])/2,(e[1]+i[1])/2],w=this.transformInv_(x),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],S=this.transformInv_(b);this.addQuad_(t,e,x,b,o,r,w,S,l-1),this.addQuad_(b,x,i,n,S,w,s,a,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(C),T=[(i[0]+n[0])/2,(i[1]+n[1])/2],O=this.transformInv_(T);this.addQuad_(t,C,T,n,o,E,O,a,l-1),this.addQuad_(C,e,i,T,E,r,s,O,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,n,o,s,a),0==(14&f)&&this.addTriangle_(t,i,e,o,s,r),f&&(0==(13&f)&&this.addTriangle_(e,n,t,r,a,o),0==(7&f)&&this.addTriangle_(e,n,i,r,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var o=e.source;Q(t,o[0]),Q(t,o[1]),Q(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();var jr,zr={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function Gr(t,e,i,n,o){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,o),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,o)),t.restore()}function Wr(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Xr(t,e,i,n){var o=It(i,e,t),r=xt(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(r*=s);var a=t.getMetersPerUnit();void 0!==a&&(r/=a);var l=t.getExtent();if(!l||B(l,o)){var h=xt(t,r,o)/r;isFinite(h)&&h>0&&(r/=h)}return r}var Yr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Nr=function(t){function e(e,i,n,o,r,s,a,l,u,c,p,d){var f=t.call(this,r,0)||this;f.renderEdges_=void 0!==p&&p,f.contextOptions_=d,f.pixelRatio_=a,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=i,f.targetTileGrid_=o,f.wrappedTileCoord_=s||r,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var g=o.getTileCoordExtent(f.wrappedTileCoord_),_=f.targetTileGrid_.getExtent(),y=f.sourceTileGrid_.getExtent(),v=_?ht(g,_):g;if(0===it(v))return f.state=4,f;var m=e.getExtent();m&&(y=y?ht(y,m):m);var x=o.getResolution(f.wrappedTileCoord_[0]),w=function(t,e,i,n){var o=rt(i),r=Xr(t,e,o,n);return(!isFinite(r)||r<=0)&&et(i,(function(i){return r=Xr(t,e,i,n),isFinite(r)&&r>0})),r}(e,n,v,x);if(!isFinite(w)||w<=0)return f.state=4,f;var b=void 0!==c?c:.5;if(f.triangulation_=new Dr(e,n,v,y,w*b,x),0===f.triangulation_.getTriangles().length)return f.state=4,f;f.sourceZ_=i.getZForResolution(w);var S=f.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(S[1]=h(S[1],y[1],y[3]),S[3]=h(S[3],y[1],y[3])):S=ht(S,y)),it(S)){for(var C=i.getTileRangeForExtentAndZ(S,f.sourceZ_),E=C.minX;E<=C.maxX;E++)for(var T=C.minY;T<=C.maxY;T++){var O=u(f.sourceZ_,E,T,a);O&&f.sourceTiles_.push(O)}0===f.sourceTiles_.length&&(f.state=4)}else f.state=4;return f}return Yr(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&2==e.getState()&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=3;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],o="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=function(t,e,i,n,o,r,s,a,l,h,u,c){var p=mi(Math.round(i*t),Math.round(i*e));if(le(p,c),0===l.length)return p.canvas;function d(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){var n,o;n=f,(o=t.extent)[0]n[2]&&(n[2]=o[2]),o[1]n[3]&&(n[3]=o[3])}));var g=pt(f),_=lt(f),y=mi(Math.round(i*g/n),Math.round(i*_/n));le(y,c);var v=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-f[0],o=-(t.extent[3]-f[3]),r=pt(t.extent),s=lt(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*v,o*v,r*v,s*v)}));var m=ut(s);return a.getTriangles().forEach((function(t,e,o){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],g=s[1][1],_=s[2][0],v=s[2][1],x=d((a[0][0]-m[0])/r),w=d(-(a[0][1]-m[1])/r),b=d((a[1][0]-m[0])/r),S=d(-(a[1][1]-m[1])/r),C=d((a[2][0]-m[0])/r),E=d(-(a[2][1]-m[1])/r),T=l,O=h;l=0,h=0;var I=function(t){for(var e=t.length,i=0;io&&(o=s,n=r)}if(0===o)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[u-=T,g-=O,0,0,b-x],[_-=T,v-=O,0,0,C-x],[0,0,u,g,S-w],[0,0,_,v,E-w]]);if(I){if(p.save(),p.beginPath(),function(){if(void 0===jr){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Gr(t,4,5,4,0),Gr(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;jr=Wr(e,0)||Wr(e,4)||Wr(e,8)}return jr}()||c===zr){p.moveTo(b,S);for(var R=x-b,P=w-S,F=0;F<4;F++)p.lineTo(b+d((F+1)*R/4),S+d(F*P/3)),3!=F&&p.lineTo(b+d((F+1)*R/4),S+d((F+1)*P/3));p.lineTo(C,E)}else p.moveTo(b,S),p.lineTo(x,w),p.lineTo(C,E);p.clip(),p.transform(I[0],I[2],I[1],I[3],x,w),p.translate(f[0]-T,f[3]-O),p.scale(n/i,-n/i),p.drawImage(y.canvas,0,0),p.restore()}})),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,o=(n[0][0]-m[0])/r,s=-(n[0][1]-m[1])/r,a=(n[1][0]-m[0])/r,l=-(n[1][1]-m[1])/r,h=(n[2][0]-m[0])/r,u=-(n[2][1]-m[1])/r;p.beginPath(),p.moveTo(a,l),p.lineTo(o,s),p.lineTo(h,u),p.closePath(),p.stroke()})),p.restore()),p.canvas}(n,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=2}this.changed()},e.prototype.load=function(){if(0==this.state){this.state=1,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var o=e.getState();if(0==o||1==o){t++;var r=be(e,fe,(function(i){var n=e.getState();2!=n&&3!=n&&4!=n||(Ce(r),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,i){0==t.getState()&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ce),this.sourcesListenerKeys_=null},e}(Rr),Zr=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return W(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return W(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){W(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Br(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function Kr(t,e,i){return t+"/"+e+"/"+i}function Vr(t){return Kr(t[0],t[1],t[2])}var Ur=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Hr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ur(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=(e=this.peekFirstKey(),e.split("/").map(Number))[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Vr(e.tileCoord)),e.release())}.bind(this))}var e},e}(Zr);var qr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Jr(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const Qr=function(t){function e(e){var i=t.call(this)||this;return i.projection_=mt(e.projection),i.attributions_=Jr(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ve,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return qr(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return A()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Jr(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Me);var $r=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function ts(t,e,i,n,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=i,o.maxY=n,o):new $r(t,e,i,n)}const es=$r;var is=[0,0,0];const ns=function(){function t(t){var e,i,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,W((e=this.resolutions_,!0,i=function(t,e){return e-t}||Gt,e.every((function(t,n){if(0===n)return!0;var o=i(e[n-1],t);return!(o>0||0===o)}))),17),!t.origins)for(var o=0,r=this.resolutions_.length-1;o=this.minZoom;){if(e(a,2===this.zoomFactor_?ts(o=Math.floor(o/2),o,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]0?n:Math.max(s/a[0],r/a[1]),h=o+1,u=new Array(h),c=0;ci||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(n,o)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,n){},e}(Qr),hs=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return as(e,t),e}(se);const us=ls;function cs(t,e){var i=/\{z\}/g,n=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(o,s[2].toString()).replace(r,(function(){var t=s[0],i=e.getFullTileRange(t);return W(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}var ps=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ds=function(t){function e(i){var n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(n.tileUrlFunction=i.tileUrlFunction),n.urls=null,i.urls?n.setUrls(i.urls):i.url&&n.setUrl(i.url),n.tileLoadingKeys_={},n}return ps(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=j(i),o=i.getState();1==o?(this.tileLoadingKeys_[n]=!0,e="tileloadstart"):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=3==o?"tileloaderror":2==o?"tileloadend":void 0),null!=e&&this.dispatchEvent(new hs(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n=i[1].charCodeAt(0),o=i[2].charCodeAt(0),r=void 0;for(r=n;r<=o;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var i=t.length,n=new Array(i),o=0;oOpenStreetMap | © OpenTopoMap | Little Navmap '];const n=void 0!==e.crossOrigin?e.crossOrigin:void 0,o=[256,256],r=[256,300],s=void 0!==e.url?e.url+"api/map/image?format=png&quality=75&width="+o[0]+"&height="+o[1]:void 0;super({attributions:i,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:n,imageSmoothing:e.imageSmoothing,maxZoom:void 0!==e.maxZoom?e.maxZoom:19,minZoom:void 0!==e.minZoom?e.minZoom:4,opaque:void 0===e.opaque||e.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:void 0,transition:e.transition,url:s,wrapX:e.wrapX,tileSize:[r[0],r[1]],projection:"EPSG:3857"}),this.setTileLoadFunction(this.defaultTileLoadFunction.bind(this))}defaultTileLoadFunction(t,e){const i=this.getTileGrid().getTileCoordExtent(t.getTileCoord()),n=Math.abs(i[2]-i[0])/6.6666,o=Ct([i[0]+n,i[1]+n],this.getProjection()),r=Ct([i[2]-n,i[3]-n],this.getProjection());t.getImage().src=e+"&leftlon="+o[0]+"&toplat="+o[1]+"&rightlon="+r[0]+"&bottomlat="+r[1]+"&detailfactor=10&reload="+Math.random()}getPixelRatio(){const t=this.tileGrid.getTileSize();return t[0]/t[1]}updateTileAtPixel(t,e){const i=e.getCoordinateFromPixel(t);this.updateTileAtLonLat(i,e)}updateTileAtLonLat(t,e){const i=this.tileGrid.getTileCoordForCoordAndZ(t,Math.round(e.getView().getZoom())),n=this.getTile(i[0],i[1],i[2],this.getPixelRatio(),this.getProjection());this.defaultTileLoadFunction(n,this.getUrls()[0]),setTimeout((()=>{e.renderSync()}),200)}}const xs="preload",ws="useInterimTilesOnError";var bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Ss=function(t){function e(e){var i=this,n=e||{},o=le({},n);return delete o.preload,delete o.useInterimTilesOnError,(i=t.call(this,o)||this).setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return bs(e,t),e.prototype.getPreload=function(){return this.get(xs)},e.prototype.setPreload=function(t){this.set(xs,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(ws)},e.prototype.setUseInterimTilesOnError=function(t){this.set(ws,t)},e}(qe);var Cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Es=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Cs(e,t),e.prototype.getFeatures=function(t){return A()},e.prototype.prepareFrame=function(t){return A()},e.prototype.renderFrame=function(t,e){return A()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,o){var r=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,o,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){},e.prototype.getDataAtPixel=function(t,e,i){return A()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return 2!=e&&3!=e&&t.addEventListener(fe,this.boundHandleImageChange_),0==e&&(t.load(),e=t.getState()),2==e},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ve&&t.changed()},e}(Te);var Ts=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Os=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Ts(e,t),e.prototype.useContainer=function(t,e,i){var n,o,r=this.getLayer().getClassName();if(t&&""===t.style.opacity&&t.className===r&&(a=t.firstElementChild)instanceof HTMLCanvasElement&&(o=a.getContext("2d")),!o||0!==o.canvas.width&&o.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=o,this.containerReused=!0),!this.container){(n=document.createElement("div")).className=r;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(o=mi()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=o}},e.prototype.clip=function(t,e,i){var n=e.pixelRatio,o=e.size[0]*n/2,r=e.size[1]*n/2,s=e.viewState.rotation,a=ut(i),l=ct(i),h=ot(i),u=nt(i);Vt(e.coordinateToPixelTransform,a),Vt(e.coordinateToPixelTransform,l),Vt(e.coordinateToPixelTransform,h),Vt(e.coordinateToPixelTransform,u),t.save(),Wi(t,-s,o,r),t.beginPath(),t.moveTo(a[0]*n,a[1]*n),t.lineTo(l[0]*n,l[1]*n),t.lineTo(h[0]*n,h[1]*n),t.lineTo(u[0]*n,u[1]*n),t.clip(),Wi(t,s,o,r)},e.prototype.clipUnrotated=function(t,e,i){var n=ut(i),o=ct(i),r=ot(i),s=nt(i);Vt(e.coordinateToPixelTransform,n),Vt(e.coordinateToPixelTransform,o),Vt(e.coordinateToPixelTransform,r),Vt(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;Vt(a,n),Vt(a,o),Vt(a,r),Vt(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var o=new ri(t,this.inversePixelTransform,i,e);n.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_("prerender",t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_("postrender",t,e)},e.prototype.getRenderTransform=function(t,e,i,n,o,r,s){var a=o/2,l=r/2,h=n/e,u=-h,c=-t[0]+s,p=-t[1];return Ut(this.tempTransform,a,l,h,u,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n,o=Vt(this.inversePixelTransform,t.slice()),r=this.context,s=this.getLayer().getExtent();if(s&&!B(s,Vt(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(o[0]),l=Math.round(o[1]),h=document.createElement("canvas"),u=h.getContext("2d");h.width=1,h.height=1,u.clearRect(0,0,1,1),u.drawImage(r.canvas,a,l,1,1,0,0,1,1),n=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:n}return 0===n[3]?null:n},e}(Es);var Is=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Rs=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new es(0,0,0,0),i}return Is(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return 2==i||4==i||3==i&&!n},e.prototype.getTile=function(t,e,i,n){var o=n.pixelRatio,r=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,o,r);return 3==a.getState()&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(2)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,o=n.projection,r=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),p=u.getTileGridForProjection(o),d=p.getZForResolution(r,u.zDirection),f=p.getResolution(d),g=t.extent,_=i.extent&&jt(i.extent);_&&(g=ht(g,jt(i.extent)));var y=u.getTilePixelRatio(l),v=Math.round(t.size[0]*y),m=Math.round(t.size[1]*y);if(a){var x=Math.round(Math.sqrt(v*v+m*m));v=x,m=x}var w=f*v/2/y,b=f*m/2/y,S=[s[0]-w,s[1]-b,s[0]+w,s[1]+b],C=p.getTileRangeForExtentAndZ(g,d),E={};E[d]={};var T=this.createLoadedTileFinder(u,o,E),O=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var R=C.minX;R<=C.maxX;++R)for(var P=C.minY;P<=C.maxY;++P){var F=this.getTile(d,R,P,t);if(this.isDrawableTile(F)){var M=j(this);if(2==F.getState()){E[d][F.tileCoord.toString()]=F;var k=F.inTransition(M);this.newTiles_||!k&&-1!==this.renderedTiles.indexOf(F)||(this.newTiles_=!0)}if(1===F.getAlpha(M,t.time))continue}var L=p.getTileCoordChildTileRange(F.tileCoord,I,O),A=!1;L&&(A=T(d+1,L)),A||p.forEachTileCoordParentTileRange(F.tileCoord,T,I,O)}var D=f/r;Ut(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,a,-v/2,-m/2);var z=function(t){return _i?qt(t):(Xi||(Xi=mi(1,1).canvas),Xi.style.transform=qt(t),Xi.style.transform)}(this.pixelTransform);this.useContainer(e,z,i.opacity);var G=this.context,W=G.canvas;Ht(this.inversePixelTransform,this.pixelTransform),Ut(this.tempTransform,v/2,m/2,D,D,0,-v/2,-m/2),W.width!=v||W.height!=m?(W.width=v,W.height=m):this.containerReused||G.clearRect(0,0,v,m),_&&this.clipUnrotated(G,t,_),le(G,u.getContextOptions()),this.preRender(G,t),this.renderedTiles.length=0;var X,Y,N,Z=Object.keys(E).map(Number);Z.sort(Gt),1!==i.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(X=[],Y=[]):Z=Z.reverse();for(var B=Z.length-1;B>=0;--B){var K=Z[B],V=u.getTilePixelSize(K,l,o),U=p.getResolution(K)/f,H=V[0]*U*D,q=V[1]*U*D,Q=p.getTileCoordForCoordAndZ(ut(S),K),$=p.getTileCoordExtent(Q),tt=Vt(this.tempTransform,[y*($[0]-S[0])/f,y*(S[3]-$[3])/f]),et=y*u.getGutterForProjection(o),it=E[K];for(var nt in it){var ot=(F=it[nt]).tileCoord,rt=tt[0]-(Q[1]-ot[1])*H,st=Math.round(rt+H),at=tt[1]-(Q[2]-ot[2])*q,lt=Math.round(at+q),ct=st-(R=Math.round(rt)),pt=lt-(P=Math.round(at)),dt=d===K;if(!(k=dt&&1!==F.getAlpha(j(this),t.time)))if(X){G.save(),N=[R,P,R+ct,P,R+ct,P+pt,R,P+pt];for(var ft=0,gt=X.length;ftu&&this.instructions.push([ia.CUSTOM,u,o,t,i,eo])):l==yn&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),o=this.coordinates.length,this.instructions.push([ia.CUSTOM,u,o,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[ia.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ia.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,n,o=e.length,r=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[ia.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[ia.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,o=t.lineDash,r=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!Nt(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=r,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[ia.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=N(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Y(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(na);var sa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const aa=function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return sa(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([ia.DRAW_IMAGE,o,r,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([ia.DRAW_IMAGE,o,r,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)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(i,n);this.instructions.push([ia.DRAW_IMAGE,o,r,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([ia.DRAW_IMAGE,o,r,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)}},e.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,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),o=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=o,this.image_=r,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(ra);var la=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const ha=function(t){function e(e,i,n,o){return t.call(this,e,i,n,o)||this}return la(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var o=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[ia.MOVE_TO_LINE_TO,o,r];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ia.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ta);var r=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(r,0,r.length,s),this.hitDetectionInstructions.push($s),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ia.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ta);for(var r=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,h=0,u=r.length;ht&&(y>_&&(_=y,f=v,g=r),y=0,v=r-o)),s=a,u=p,c=d),l=m,h=x}return(y+=a)>_?[v,r]:[f,g]}var da=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fa={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},ga={Circle:ca,Default:ra,Image:aa,LineString:ha,Polygon:ca,Text:function(t){function e(e,i,n,o){var r=t.call(this,e,i,n,o)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return da(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(i||n)){var r=this.coordinates,s=r.length,a=t.getType(),l=null,h=t.getStride();if("line"!==o.placement||a!=vn&&a!=wn&&a!=mn&&a!=bn){var u=o.overflow?null:[];switch(a){case yn:case xn:l=t.getFlatCoordinates();break;case vn:l=t.getFlatMidpoint();break;case Cn:l=t.getCenter();break;case wn:l=t.getFlatMidpoints(),h=2;break;case mn:l=t.getFlatInteriorPoint(),o.overflow||u.push(l[2]/this.resolution),h=3;break;case bn:var c=t.getFlatInteriorPoints();for(l=[],w=0,b=c.length;wR[2]}else T=w>O;var P,F=Math.PI,M=[],k=S+n===e;if(y=0,v=C,p=t[e=S],d=t[e+1],k){m();var L=Math.atan2(d-g,p-f);T&&(L+=L>0?-F:F);var A=(O+w)/2,D=(I+b)/2;return M[0]=[A,D,(E-r)/2,L,o],M}for(var j=0,z=o.length;j0?-F:F),void 0!==P){var W=G-P;if(W+=W>F?-2*F:W<-F?2*F:0,Math.abs(W)>s)return null}P=G;for(var X=j,Y=0;jt?t-l:o,x=r+h>e?e-h:r,w=d[3]+m*c[0]+d[1],b=d[0]+x*c[1]+d[2],S=y-d[3],C=v-d[0];return(f||0!==u)&&(Ta[0]=S,Ra[0]=S,Ta[1]=C,Oa[1]=C,Oa[0]=S+w,Ia[0]=Oa[0],Ia[1]=C+b,Ra[1]=Ia[1]),0!==u?(Vt(_=Ut([1,0,0,1,0,0],i,n,1,1,u,-i,-n),Ta),Vt(_,Oa),Vt(_,Ia),Vt(_,Ra),H(Math.min(Ta[0],Oa[0],Ia[0],Ra[0]),Math.min(Ta[1],Oa[1],Ia[1],Ra[1]),Math.max(Ta[0],Oa[0],Ia[0],Ra[0]),Math.max(Ta[1],Oa[1],Ia[1],Ra[1]),Ea)):H(Math.min(S,S+w),Math.min(C,C+b),Math.max(S,S+w),Math.max(C,C+b),Ea),p&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:h,declutterBox:{minX:Ea[0],minY:Ea[1],maxX:Ea[2],maxY:Ea[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,o,r,s){var a=!(!r&&!s),l=n.declutterBox,h=t.canvas,u=s?s[2]*n.scale[0]/2:0;return l.minX-u<=h.width/e&&l.maxX+u>=0&&l.minY-u<=h.height/e&&l.maxY+u>=0&&(a&&this.replayTextBackground_(t,Ta,Oa,Ia,Ra,r,s),function(t,e,i,n,o,r,s,a,l,h,u){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(u[0],u[1]),function(t,e){for(var i=t.contextInstructions,n=0,o=i.length;nz&&(this.fill_(t),P=0),F>z&&(t.stroke(),F=0),P||F||(t.beginPath(),f=NaN,g=NaN),++O;break;case ia.CIRCLE:var W=l[R=G[1]],X=l[R+1],Y=l[R+2]-W,N=l[R+3]-X,Z=Math.sqrt(Y*Y+N*N);t.moveTo(W+Z,X),t.arc(W,X,Z,0,2*Math.PI,!0),++O;break;case ia.CLOSE_PATH:t.closePath(),++O;break;case ia.CUSTOM:R=G[1],c=G[2];var B=G[3],K=G[4],V=6==G.length?G[5]:void 0;j.geometry=B,j.feature=S,O in L||(L[O]=[]);var U=L[O];V?V(l,R,c,2,U):(U[0]=l[R],U[1]=l[R+1],U.length=2),K(U,j),++O;break;case ia.DRAW_IMAGE:R=G[1],c=G[2],v=G[3],p=G[4],d=G[5];var H=G[6],q=G[7],J=G[8],Q=G[9],$=G[10],tt=G[11],et=G[12],it=G[13],nt=G[14];if(!v&&G.length>=19){m=G[18],x=G[19],w=G[20],b=G[21];var ot=this.drawLabelWithPointPlacement_(m,x,w,b);v=ot.label,G[3]=v;var rt=G[22];p=(ot.anchorX-rt)*this.pixelRatio,G[4]=p;var st=G[23];d=(ot.anchorY-st)*this.pixelRatio,G[5]=d,H=v.height,G[6]=H,it=v.width,G[13]=it}var at=void 0;G.length>24&&(at=G[24]);var lt=void 0,ht=void 0,ut=void 0;G.length>16?(lt=G[15],ht=G[16],ut=G[17]):(lt=Pi,ht=!1,ut=!1),$&&D?tt+=A:$||D||(tt-=A);for(var ct=0;Ri)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+o)*e+(t+r))+3),o>0&&a.push(4*((t-o)*e+(t+r))+3),r>0&&(a.push(4*((t+o)*e+(t-r))+3),o>0&&a.push(4*((t-o)*e+(t-r))+3))}for(var l=[],h=(o=0,n.length);o0){if(!r||c!==ma&&c!==ba||-1!==r.indexOf(t)){var h=(p[a]-3)/4,d=n-h%s,f=n-(h/s|0),g=o(t,e,d*d+f*f);if(g)return g}u.clearRect(0,0,s,s);break}}var f,g,_,y,v,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(Gt),f=m.length-1;f>=0;--f){var x=m[f].toString();for(_=this.executorsByZIndex_[x],g=La.length-1;g>=0;--g)if(void 0!==(y=_[c=La[g]])&&(v=y.executeHitDetection(u,a,i,d,h)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],o=e[2],r=e[3],s=[i,n,i,r,o,r,o,n];return Xn(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return ce(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,o,r,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(Gt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,h,u,c,p,d,f=r||La;for(s&&a.reverse(),l=0,h=a.length;l0,6);var c=void 0!==n.src?0:2;return i.color_=void 0!==n.color?ee(n.color):null,i.iconImage_=function(t,e,i,n,o,r){var s=re.get(e,n,r);return s||(s=new Ua(t,e,i,n,o,r),re.set(e,n,r,s)),s}(l,u,h,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:Za,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return Ha(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Wa||this.anchorYUnits_==Wa){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Wa&&(t[0]*=e[0]),this.anchorYUnits_==Wa&&(t[1]*=e[1])}if(this.anchorOrigin_!=Za){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Ba&&this.anchorOrigin_!=Na||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ya&&this.anchorOrigin_!=Na||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=Za){var i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;t=t.slice(),this.offsetOrigin_!=Ba&&this.offsetOrigin_!=Na||(t[0]=n[0]-i[0]-t[0]),this.offsetOrigin_!=Ya&&this.offsetOrigin_!=Na||(t[1]=n[1]-i[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(fe,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(fe,t)},e}(As);var Ja={Point:function(t,e,i,n,o){var r,s=i.getImage(),a=i.getText();if(o&&(t=o,r=s&&a&&a.getText()?{}:void 0),s){if(2!=s.getImageState())return;var l=t.getBuilder(i.getZIndex(),ma);l.setImageStyle(s,r),l.drawPoint(e,n)}if(a&&a.getText()){var h=t.getBuilder(i.getZIndex(),ba);h.setTextStyle(a,r),h.drawText(e,n)}},LineString:function(t,e,i,n,o){var r=i.getStroke();if(r){var s=t.getBuilder(i.getZIndex(),xa);s.setFillStrokeStyle(null,r),s.drawLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(o||t).getBuilder(i.getZIndex(),ba);l.setTextStyle(a),l.drawText(e,n)}},Polygon:function(t,e,i,n,o){var r=i.getFill(),s=i.getStroke();if(r||s){var a=t.getBuilder(i.getZIndex(),wa);a.setFillStrokeStyle(r,s),a.drawPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),ba);h.setTextStyle(l),h.drawText(e,n)}},MultiPoint:function(t,e,i,n,o){var r,s=i.getImage(),a=i.getText();if(o&&(t=o,r=s&&a&&a.getText()?{}:void 0),s){if(2!=s.getImageState())return;var l=t.getBuilder(i.getZIndex(),ma);l.setImageStyle(s,r),l.drawMultiPoint(e,n)}if(a&&a.getText()){var h=(o||t).getBuilder(i.getZIndex(),ba);h.setTextStyle(a,r),h.drawText(e,n)}},MultiLineString:function(t,e,i,n,o){var r=i.getStroke();if(r){var s=t.getBuilder(i.getZIndex(),xa);s.setFillStrokeStyle(null,r),s.drawMultiLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(o||t).getBuilder(i.getZIndex(),ba);l.setTextStyle(a),l.drawText(e,n)}},MultiPolygon:function(t,e,i,n,o){var r=i.getFill(),s=i.getStroke();if(s||r){var a=t.getBuilder(i.getZIndex(),wa);a.setFillStrokeStyle(r,s),a.drawMultiPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(o||t).getBuilder(i.getZIndex(),ba);h.setTextStyle(l),h.drawText(e,n)}},GeometryCollection:function(t,e,i,n,o){var r,s,a=e.getGeometriesArray();for(r=0,s=a.length;r0&&(s.width=0),this.container;var h=Math.round(t.size[0]*i),u=Math.round(t.size[1]*i);s.width!=h||s.height!=u?(s.width=h,s.height=u,s.style.transform!==o&&(s.style.transform=o)):this.containerReused||r.clearRect(0,0,h,u),this.preRender(r,t);var c=t.viewState,p=(c.projection,!1);if(n.extent&&this.clipping){var d=jt(n.extent);(p=!K(d,t.extent)&&dt(d,t.extent))&&this.clipUnrotated(r,t,d)}this.renderWorlds(a,t),p&&r.restore(),this.postRender(r,t);var f=n.opacity,g=this.container;return f!==parseFloat(g.style.opacity)&&(g.style.opacity=1===f?"":String(f)),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];Vt(this.pixelTransform,i);var n=this.renderedCenter_,o=this.renderedResolution_,r=this.renderedRotation_,s=this.renderedProjection_,a=this.renderedExtent_,l=this.getLayer(),h=[],u=i[0]/2,c=i[1]/2;h.push(this.getRenderTransform(n,o,r,.5,u,c,0).slice());var p=l.getSource(),d=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!K(d,a)){for(var f=a[0],g=pt(d),_=0,y=void 0;fd[2];)y=g*++_,h.push(this.getRenderTransform(n,o,r,.5,u,c,y).slice()),f-=g}this.hitDetectionImageData_=function(t,e,i,n,o,r,s){var a=mi(t[0]/2,t[1]/2);a.imageSmoothingEnabled=!1;for(var l=a.canvas,h=new Ga(a,.5,o,null,s),u=i.length,c=Math.floor(16777215/u),p={},d=1;d<=u;++d){var f=i[d-1],g=f.getStyleFunction()||n;if(n){var _=g(f,r);if(_){Array.isArray(_)||(_=[_]);for(var y="#"+("000000"+(d*c).toString(16)).slice(-6),v=0,m=_.length;v=i[2])){var o=pt(i),r=Math.floor((n[0]-i[0])/o)*o;t[0]-=r,t[2]-=r}return t}(y[0],h);w[0]v[0]&&w[2]>v[2]&&y.push([w[0]-m,w[1],w[2]-m,w[3]])}if(!this.dirty_&&this.renderedResolution_==u&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&K(this.renderedExtent_,_))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var b,S=new _a($a(u,c),_,u,c);this.getLayer().getDeclutter()&&(b=new _a($a(u,c),_,u,c));var C,E=kt();if(E){for(var T=0,O=y.length;T=200&&a.status<300){var n=e.getType(),l=void 0;"json"==n||"text"==n?l=a.responseText:"xml"==n?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):n==ul&&(l=a.response),l?r(e.readFeatures(l,{extent:i,featureProjection:o}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(t,e,i,n,o,(function(t,e){void 0!==r&&r(t),a.addFeatures(t)}),s||Kt)}}var pl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dl=function(t){function e(e,i,n){var o=t.call(this,e)||this;return o.feature=i,o.features=n,o}return pl(e,t),e}(se);const fl=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:Ve,wrapX:void 0===n.wrapX||n.wrapX})||this).loader_=Kt,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&(W(i.format_,7),i.loader_=cl(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:hl;var o,r,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new sl:null,i.loadedExtentsRtree_=new sl,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?r=n.features:n.features&&(r=(o=n.features).getArray()),s||void 0!==o||(o=new Hi(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==o&&i.bindFeaturesCollection_(o),i}return pl(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=j(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new dl(al,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[be(e,fe,this.handleFeatureChange_,this),be(e,ae,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(W(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],o=0,r=t.length;o',n.className="follow-control on ol-unselectable ol-control",n.appendChild(r),t.call(this,{element:n,target:o.target}),r.addEventListener("click",this.handleFollow.bind(this),!1)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.handleFollow=function(){i=!i,n.className=i?"follow-control on ol-unselectable ol-control":"follow-control off ol-unselectable ol-control",e()},o}(Po);var vl=i(441),ml=i.n(vl);const xl=function(t){var e,i=document.createElement("div");function n(n){var o=n||{};e=n.handleRefresh;var r=document.createElement("button");r.innerHTML='',i.className="refresh-control on ol-unselectable ol-control",i.appendChild(r),t.call(this,{element:i,target:o.target}),r.addEventListener("click",this.handleRefresh.bind(this),!1)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.handleRefresh=function(){e()},n}(Po),wl=(t,e,i)=>{fetch(t).then((t=>t.text())).then((t=>e(t))).catch((t=>{i(t)}))};var bl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();const Sl=function(t){function e(e){var i=t.call(this)||this;if(i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addEventListener(Fe(i.geometryName_),i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;i.setGeometry(n)}else{var o=e;i.setProperties(o)}return i}return bl(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Ce(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=be(t,fe,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){var e,i;this.style_=t,this.styleFunction_=t?"function"==typeof(e=t)?e:(Array.isArray(e)?i=e:(W("function"==typeof e.getZIndex,41),i=[e]),function(){return i}):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeEventListener(Fe(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=t,this.addEventListener(Fe(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(Me),Cl=class extends Wo{constructor(t={layer:void 0,url:void 0}){super(t),t.layer&&(this.layer=t.layer,this.source=this.layer.getSource()),this.url=t.url}handleEvent(t){switch(t.type){case"click":return this.layer||(this.source=new fl,this.layer=new rl({source:this.source}),this.getMap().addLayer(this.layer)),this.getFeaturesAtPixelListener(t),!1;default:return!0}}getFeaturesAtPixelListener(t){return this.getFeaturesAtPixel(t.pixel)}getFeaturesAtPixel(t){return this.getFeaturesAtCoordinates(this.getMap().getCoordinateFromPixel(t))}getFeaturesAtCoordinates(t,e=1){this.source.clear();let i=[];i.push(Je(t.map((t=>t)),[-1*e,-1*e])),i.push(Je(t.map((t=>t)),[1*e,-1*e])),i.push(Je(t.map((t=>t)),[1*e,1*e])),i.push(Je(t.map((t=>t)),[-1*e,1*e]));const n=X(i),o=this.getMap().getView().getProjection(),r=Ct([n[0],n[1]],o),s=Ct([n[0],n[3]],o),a=this.url+"api/map/features?leftlon="+r[0]+"&toplat="+r[1]+"&rightlon="+s[0]+"&bottomlat="+s[1]+"&detailfactor=13";wl(a,(t=>{try{const e=JSON.parse(t);this.getMap().littlenavmap.dispatch("map/features",e);let i=[],n=0;e.airports.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});i.push(e),++n}));let r=[];e.ndbs.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});r.push(e),++n}));let s=[];e.vors.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});s.push(e),++n}));let a=[];e.markers.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});a.push(e),++n}));let l=[];e.waypoints.result.forEach((t=>{let e=new Sl({geometry:new lo(St([t.position.lon,t.position.lat],o))});l.push(e)})),this.source.addFeatures(i),this.source.addFeatures(r),this.source.addFeatures(s),this.source.addFeatures(a),this.source.addFeatures(l)}catch(t){console.log(t)}}),(t=>{console.log("error")}))}},El=class extends Sl{constructor(t={}){super(t),this.defaultStyle=new Vs({image:new qa({anchor:[.5,.5],anchorXUnits:"fraction",anchorYUnits:"fraction",src:_l(),scale:.5})}),this.setStyle(this.defaultStyle)}isVisible(){return null!=this.getStyle()}hide(){this.setStyle(null)}show(){this.setStyle(this.defaultStyle)}rotateImage(t){this.getStyle().getImage().setRotation(t)}},Tl=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=To(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Xs({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=To(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),Ol=class extends Sl{constructor(t={}){super(t),this.defaultStyle=new Vs({fill:new Xs({color:"rgba(255,255,255,0.4)"}),stroke:new Ys({color:"#3399CC",width:1.25}),text:new Tl({text:"1",textAlign:"left",fill:new Xs({color:"#000000"}),stroke:new Ys({color:"#FFFF99",width:3.5})})}),this.setStyle(this.defaultStyle)}updateText(t){this.getStyle().getText().setText(t)}isVisible(){return null!=this.getStyle()}hide(){this.setStyle(null)}show(){this.setStyle(this.defaultStyle)}};var Il=i(964),Rl=i.n(Il),Pl="/";console.log("Starting production mode:",Pl);const Fl=new class{constructor(t,e){this.fetch=wl,this.url=t,this.target=e,this.refreshInterval=1e3,this.sources=[new ms({url:this.url})],this.activesource=0,this.layers=[new Ms({source:this.sources[0],className:"lnm-layer-0",visible:!0})],this.following=!0,this.initMap()}initMap(){const t=[new yl({handleFollow:()=>{this.following=!this.following}}),new xl({handleRefresh:()=>{this.sources.forEach((t=>{t.refresh()}))}}),new Mo({collapsible:!1})];this.setupAircraftFeature(),this.setupWindIndicator(),this.map=new Or({controls:t,interactions:Er().extend([new Cl({url:this.url})]),layers:this.layers,target:this.target,view:new Eo({maxZoom:19,minZoom:4})}),this.map.littlenavmap=this}setupAircraftFeature(){this.aircraftFeature=new El,this.aircraftLabelFeature=new Ol;const t=new fl({features:[this.aircraftFeature,this.aircraftLabelFeature]}),e=new rl({source:t});this.layers.push(e)}setupWindIndicator(){this.windIndicator=document.createElement("div");var t=document.createElement("div"),e=document.createElement("div");t.style.float="left",t.style.position="relative",t.style.marginRight="5px",e.style.float="left",e.style.position="relative",e.style.backgroundColor="#FFFF99",this.windIndicator.style.position="absolute",this.windIndicator.style.top="2%",this.windIndicator.style.left="48%",this.windIndicatorPointer=document.createElement("img"),this.windIndicatorPointer.src=Rl(),this.windIndicatorPointer.style.width="40px",this.windIndicatorTextDirection=document.createElement("span"),this.windIndicatorTextDirection.innerHTML="";var i=document.createElement("br");this.windIndicatorTextSpeed=document.createElement("span"),this.windIndicatorTextSpeed.innerHTML="",t.appendChild(this.windIndicatorPointer),e.appendChild(this.windIndicatorTextDirection),e.appendChild(i),e.appendChild(this.windIndicatorTextSpeed),this.windIndicator.appendChild(t),this.windIndicator.appendChild(e),this.windIndicator.style.visibility="hidden",document.body.appendChild(this.windIndicator)}getAircraftPosition(t){this.fetch(this.url+"api/sim/info",(e=>{try{const i=JSON.parse(e);i.active?(this.simInfo=i,this.dispatch("sim/info",i),this.setAircraftFeatureVisibility(!0),this.setWindIndicatorVisibility(!0),t([i.position.lon,i.position.lat],i.heading)):(this.simInfo=null,this.setAircraftFeatureVisibility(!1),this.setWindIndicatorVisibility(!1))}catch(t){console.log(t)}}),(t=>{console.log(t)}))}setAircraftFeatureVisibility(t){t&&!this.aircraftFeature.isVisible()?(this.aircraftFeature.show(),this.aircraftLabelFeature.show()):!t&&this.aircraftFeature.isVisible()&&(this.aircraftFeature.hide(),this.aircraftLabelFeature.hide())}setWindIndicatorVisibility(t){t&&"hidden"==this.windIndicator.style.visibility?this.windIndicator.style.visibility="visible":t||"visible"!=this.windIndicator.style.visibility||(this.windIndicator.style.visibility="hidden",this.windIndicatorTextDirection.innerHTML="",this.windIndicatorTextSpeed.innerHTML="")}ParseDMS(t){var e=t.split(/[^\d\w!.]+/),i=this.ConvertDMSToDD(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),e[3]);return[this.ConvertDMSToDD(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),e[7]),i]}ConvertDMSToDD(t,e,i,n){var o=t+e/60+i/3600;return"S"!=n&&"W"!=n||(o*=-1),o}startRefreshLoop(){setTimeout(this.refreshLoop.bind(this),this.refreshInterval)}refreshLoop(){this.getAircraftPosition(((t,e)=>{const i=St(t);this.aircraftFeature.setGeometry(new lo(i)),this.aircraftFeature.rotateImage(this.degreesToRadians(e)),this.aircraftLabelFeature.setGeometry(new lo(i)),this.aircraftLabelFeature.updateText("GS "+this.simInfo.ground_speed.toFixed(0)+"kts\nALT "+this.simInfo.indicated_altitude.toFixed(0)+"ft"),this.windIndicatorPointer.style.transform="rotate("+(this.simInfo.wind_direction-180)+"deg)",this.windIndicatorTextDirection.innerHTML=this.simInfo.wind_direction.toFixed(0)+" °M",this.windIndicatorTextSpeed.innerHTML=this.simInfo.wind_speed.toFixed(0)+" kts",this.following&&this.map.getView().animate({center:i,duration:200})})),setTimeout(this.refreshLoop.bind(this),this.refreshInterval)}degreesToRadians(t){return t*(Math.PI/180)}toggleActiveSource(){this.activesource<1?(this.activesource=1,this.layers[1].setVisible(!0),this.layers[0].setVisible(!1)):(this.activesource=0,this.layers[0].setVisible(!0),this.layers[1].setVisible(!1))}dispatch(t,e){const i=new CustomEvent(t,{detail:e});window.dispatchEvent(i)}moveTo(t){const e=St(t);this.map.getView().animate({center:e,duration:200})}}(Pl,"map");window.littlenavmap=Fl,window.onload=()=>{Fl.map.getView().setZoom(9),Fl.map.getView().setCenter(St([0,0])),Fl.startRefreshLoop()}})()})(); \ No newline at end of file diff --git a/web/plugins/ol-map/index.html b/web/plugins/ol-map/index.html index fd560c73e..34ec0208b 100644 --- a/web/plugins/ol-map/index.html +++ b/web/plugins/ol-map/index.html @@ -11,8 +11,9 @@ From b37d8fc4598571d1afc756862507ed643c91cc61 Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Tue, 8 Mar 2022 16:26:34 +0100 Subject: [PATCH 28/29] Turn off aircraft following when quicksearching an airport --- web/plugins/ol-map/index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/plugins/ol-map/index.html b/web/plugins/ol-map/index.html index 34ec0208b..ebd1293d7 100644 --- a/web/plugins/ol-map/index.html +++ b/web/plugins/ol-map/index.html @@ -108,6 +108,11 @@ fetch("/api/airport/info?ident=" + ident).then((response) => { return response.json(); }).then((json) => { + // turn off aircraft follow + if (littlenavmap.following) { + littlenavmap.map.getControls().getArray()[0].handleFollow(); + } + // move to airport position littlenavmap.moveTo([json.position.lon, json.position.lat]); }).catch((error) => { console.log(error); From ac5e2478507b278beef1f2483c8dd5a3703ed1cd Mon Sep 17 00:00:00 2001 From: Kosma Kaczmarski Date: Tue, 8 Mar 2022 17:05:01 +0100 Subject: [PATCH 29/29] Trap main UI to respect ol-map plugin active state - Reinit content iframe manipulation by ol-map logic when returning from other panels to map.html --- web/plugins/ol-map/index.html | 36 ++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/web/plugins/ol-map/index.html b/web/plugins/ol-map/index.html index ebd1293d7..619af65dd 100644 --- a/web/plugins/ol-map/index.html +++ b/web/plugins/ol-map/index.html @@ -20,6 +20,7 @@ * - /web/ol (dist of littlenavmap-openlayers) */ + var mapButton; var contentIframe; var singleFrameMapContainer; @@ -39,6 +40,35 @@ // plugin init method var returned_Value = callback(callback.TYPE_BACKGROUND, stop); + mapButton = parent.document.querySelector("button#buttonMap"); + + // build up plugin + refresh(); + + // handle clicks on map button (returning from other panels) + trapMapButton(); + + console.log("ol-map plugin initialised"); + } + + function trapMapButton() { + mapButton.addEventListener("click", trapContentIFrame) + } + + function untrapMapButton() { + mapButton.removeEventListener("click", trapContentIFrame) + } + + function trapContentIFrame() { + contentIframe.addEventListener("load", refresh); + } + + function untrapContentIFrame() { + contentIframe.removeEventListener("load", refresh); + } + + function refresh() { + // get refs contentIframe = parent.document.querySelector("iframe[name=contentiframe]"); singleFrameMapContainer = contentIframe.contentDocument.querySelector("div#mapcontainer"); @@ -80,7 +110,8 @@ applyOverrides(); - console.log("ol-map plugin initialised"); + // remove iframe load listener (allowing navigation to other panels) + untrapContentIFrame(); } function stop() { @@ -96,6 +127,9 @@ revertOverrides(); + // remove click listener on map button + untrapMapButton(); + console.log("ol-map plugin stopped"); }