@prushforth/map 1.0.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +89 -0
- package/demo/index.html +78 -0
- package/dist/cjs/AttributionButton-DgbgLHy4.js +106 -0
- package/dist/cjs/MapTileLayer-D4vp8bR4.js +454 -0
- package/dist/cjs/app-globals-DY--Q2Nl.js +775 -0
- package/dist/cjs/calculatePosition-CDcdNl7C.js +92 -0
- package/dist/cjs/gcds-ext-map.cjs.js +47 -0
- package/dist/cjs/gcds-ext-map_2.cjs.entry.js +8081 -0
- package/dist/cjs/index-CW_WOSnc.js +32697 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +14 -0
- package/dist/cjs/locale-_4nEyxeO.js +153 -0
- package/dist/cjs/map-a.cjs.entry.js +16 -0
- package/dist/cjs/map-caption.cjs.entry.js +55 -0
- package/dist/cjs/map-extent.cjs.entry.js +993 -0
- package/dist/cjs/map-feature.cjs.entry.js +636 -0
- package/dist/cjs/map-featurecaption.cjs.entry.js +14 -0
- package/dist/cjs/map-geometry.cjs.entry.js +36 -0
- package/dist/cjs/map-input.cjs.entry.js +348 -0
- package/dist/cjs/map-link.cjs.entry.js +6055 -0
- package/dist/cjs/map-meta.cjs.entry.js +40 -0
- package/dist/cjs/map-properties.cjs.entry.js +14 -0
- package/dist/cjs/map-select.cjs.entry.js +100 -0
- package/dist/cjs/map-span.cjs.entry.js +14 -0
- package/dist/cjs/map-style.cjs.entry.js +127 -0
- package/dist/cjs/map-tile.cjs.entry.js +274 -0
- package/dist/cjs/renderStyles-yOMXvf12.js +59 -0
- package/dist/collection/assets/canada.json +1 -0
- package/dist/collection/assets/images/w3community.ico +0 -0
- package/dist/collection/assets/mapml/en/apstile/arctic +18 -0
- package/dist/collection/assets/mapml/en/cbmtile/canvec +22 -0
- package/dist/collection/assets/mapml/en/cbmtile/cbmt +24 -0
- package/dist/collection/assets/mapml/en/cbmtile/cbmtgeom +20 -0
- package/dist/collection/assets/mapml/en/cbmtile/cbmtsimple +20 -0
- package/dist/collection/assets/mapml/en/cbmtile/current_conditions +33 -0
- package/dist/collection/assets/mapml/en/cbmtile/toporama +25 -0
- package/dist/collection/assets/mapml/en/custom/arcticsdi.mapml +18 -0
- package/dist/collection/assets/mapml/en/osmtile/cbmt +24 -0
- package/dist/collection/assets/mapml/en/osmtile/current_conditions +32 -0
- package/dist/collection/assets/mapml/en/osmtile/dark.mapml +19 -0
- package/dist/collection/assets/mapml/en/osmtile/light.mapml +19 -0
- package/dist/collection/assets/mapml/en/osmtile/osm +19 -0
- package/dist/collection/assets/mapml/en/osmtile/toporama +25 -0
- package/dist/collection/assets/mapml/fr/apstile/arctic +19 -0
- package/dist/collection/assets/mapml/fr/cbmtile/canvec +22 -0
- package/dist/collection/assets/mapml/fr/cbmtile/cbmt +24 -0
- package/dist/collection/assets/mapml/fr/cbmtile/cbmtgeom +20 -0
- package/dist/collection/assets/mapml/fr/cbmtile/cbmtsimple +20 -0
- package/dist/collection/assets/mapml/fr/cbmtile/current_conditions +25 -0
- package/dist/collection/assets/mapml/fr/cbmtile/toporama +25 -0
- package/dist/collection/assets/mapml/fr/osmtile/cbmt +24 -0
- package/dist/collection/assets/mapml/fr/osmtile/current_conditions +24 -0
- package/dist/collection/assets/mapml/fr/osmtile/dark.mapml +19 -0
- package/dist/collection/assets/mapml/fr/osmtile/light.mapml +19 -0
- package/dist/collection/assets/mapml/fr/osmtile/osm +19 -0
- package/dist/collection/assets/mapml/fr/osmtile/toporama +25 -0
- package/dist/collection/assets/pmtiles/darkTheme.js +19 -0
- package/dist/collection/assets/pmtiles/lightTheme.js +19 -0
- package/dist/collection/collection-manifest.json +28 -0
- package/dist/collection/components/gcds-ext-map/assets/pmtiles/darkTheme.js +19 -0
- package/dist/collection/components/gcds-ext-map/assets/pmtiles/lightTheme.js +19 -0
- package/dist/collection/components/gcds-ext-map/gcds-ext-map.css +2138 -0
- package/dist/collection/components/gcds-ext-map/gcds-ext-map.js +1517 -0
- package/dist/collection/components/gcds-ext-map/stories/gcds-ext-map.stories.js +367 -0
- package/dist/collection/components/map-a/map-a.js +89 -0
- package/dist/collection/components/map-caption/map-caption.js +52 -0
- package/dist/collection/components/map-extent/map-extent.js +809 -0
- package/dist/collection/components/map-feature/map-feature.js +724 -0
- package/dist/collection/components/map-featurecaption/map-featurecaption.js +6 -0
- package/dist/collection/components/map-geometry/map-geometry.js +57 -0
- package/dist/collection/components/map-input/map-input.js +355 -0
- package/dist/collection/components/map-layer/map-layer.js +1245 -0
- package/dist/collection/components/map-layer/stories/map-layer.stories.js +101 -0
- package/dist/collection/components/map-link/map-link.js +1149 -0
- package/dist/collection/components/map-meta/map-meta.js +82 -0
- package/dist/collection/components/map-properties/map-properties.js +7 -0
- package/dist/collection/components/map-select/map-select.js +145 -0
- package/dist/collection/components/map-span/map-span.js +7 -0
- package/dist/collection/components/map-style/map-style.js +144 -0
- package/dist/collection/components/map-tile/map-tile.js +370 -0
- package/dist/collection/components/utils/mapml/DOMTokenList.js +123 -0
- package/dist/collection/components/utils/mapml/DefaultMapOptions.js +11 -0
- package/dist/collection/components/utils/mapml/Util.js +1601 -0
- package/dist/collection/components/utils/mapml/control/AttributionButton.js +101 -0
- package/dist/collection/components/utils/mapml/control/FullscreenButton.js +181 -0
- package/dist/collection/components/utils/mapml/control/GeolocationButton.js +70 -0
- package/dist/collection/components/utils/mapml/control/LayerControl.js +212 -0
- package/dist/collection/components/utils/mapml/control/ReloadButton.js +75 -0
- package/dist/collection/components/utils/mapml/control/ScaleBar.js +108 -0
- package/dist/collection/components/utils/mapml/control/SearchButton.js +565 -0
- package/dist/collection/components/utils/mapml/elementSupport/extents/createLayerControlForExtent.js +259 -0
- package/dist/collection/components/utils/mapml/elementSupport/inputs/heightInput.js +18 -0
- package/dist/collection/components/utils/mapml/elementSupport/inputs/hiddenInput.js +19 -0
- package/dist/collection/components/utils/mapml/elementSupport/inputs/locationInput.js +127 -0
- package/dist/collection/components/utils/mapml/elementSupport/inputs/widthInput.js +18 -0
- package/dist/collection/components/utils/mapml/elementSupport/inputs/zoomInput.js +30 -0
- package/dist/collection/components/utils/mapml/elementSupport/layers/calculatePosition.js +88 -0
- package/dist/collection/components/utils/mapml/elementSupport/layers/createLayerControlForLayer.js +326 -0
- package/dist/collection/components/utils/mapml/elementSupport/layers/renderStyles.js +55 -0
- package/dist/collection/components/utils/mapml/elementSupport/viewers/matchMedia.js +251 -0
- package/dist/collection/components/utils/mapml/features/featureRenderer.js +342 -0
- package/dist/collection/components/utils/mapml/features/geometry.js +268 -0
- package/dist/collection/components/utils/mapml/features/path.js +485 -0
- package/dist/collection/components/utils/mapml/handlers/AnnounceMovement.js +154 -0
- package/dist/collection/components/utils/mapml/handlers/ContextMenu.js +1436 -0
- package/dist/collection/components/utils/mapml/handlers/FeatureIndex.js +116 -0
- package/dist/collection/components/utils/mapml/handlers/QueryHandler.js +476 -0
- package/dist/collection/components/utils/mapml/handlers/keyboard.js +60 -0
- package/dist/collection/components/utils/mapml/layers/Crosshair.js +108 -0
- package/dist/collection/components/utils/mapml/layers/DebugOverlay.js +357 -0
- package/dist/collection/components/utils/mapml/layers/FeatureIndexOverlay.js +239 -0
- package/dist/collection/components/utils/mapml/layers/ImageLayer.js +136 -0
- package/dist/collection/components/utils/mapml/layers/MapExtentLayer.js +114 -0
- package/dist/collection/components/utils/mapml/layers/MapFeatureLayer.js +623 -0
- package/dist/collection/components/utils/mapml/layers/MapLayer.js +640 -0
- package/dist/collection/components/utils/mapml/layers/MapTileLayer.js +450 -0
- package/dist/collection/components/utils/mapml/layers/TemplatedFeaturesOrTilesLayer.js +346 -0
- package/dist/collection/components/utils/mapml/layers/TemplatedImageLayer.js +276 -0
- package/dist/collection/components/utils/mapml/layers/TemplatedPMTilesLayer.js +135 -0
- package/dist/collection/components/utils/mapml/layers/TemplatedTileLayer.js +664 -0
- package/dist/collection/components/utils/utils.js +26 -0
- package/dist/collection/fonts/icons/LICENSE.txt +92 -0
- package/dist/collection/fonts/icons/README.md +543 -0
- package/dist/collection/fonts/icons/gcds-icons.css +110 -0
- package/dist/collection/fonts/icons/gcds-icons.eot +0 -0
- package/dist/collection/fonts/icons/gcds-icons.svg +82 -0
- package/dist/collection/fonts/icons/gcds-icons.ttf +0 -0
- package/dist/collection/fonts/icons/gcds-icons.woff +0 -0
- package/dist/collection/fonts/lato/LICENSE.txt +48 -0
- package/dist/collection/fonts/lato/README.md +195 -0
- package/dist/collection/fonts/lato/gcds-lato-italic.woff +0 -0
- package/dist/collection/fonts/lato/gcds-lato-italic.woff2 +0 -0
- package/dist/collection/fonts/lato/gcds-lato.css +30 -0
- package/dist/collection/fonts/lato/gcds-lato.woff +0 -0
- package/dist/collection/fonts/lato/gcds-lato.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/LICENSE.txt +43 -0
- package/dist/collection/fonts/noto-sans/README.md +423 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-bold-italic.woff +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-bold-italic.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-bold.woff +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-bold.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-light-italic.woff +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-light-italic.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-light.woff +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-light.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-medium-italic.woff +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-medium-italic.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-medium.woff +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-medium.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-regular-italic.woff +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-regular-italic.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-regular.woff +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-regular.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-semibold-italic.woff +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-semibold-italic.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-semibold.woff +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans-semibold.woff2 +0 -0
- package/dist/collection/fonts/noto-sans/gcds-noto-sans.css +89 -0
- package/dist/collection/fonts/noto-sans-mono/LICENSE.txt +93 -0
- package/dist/collection/fonts/noto-sans-mono/README.md +135 -0
- package/dist/collection/fonts/noto-sans-mono/gcds-noto-sans-mono.css +17 -0
- package/dist/collection/fonts/noto-sans-mono/gcds-noto-sans-mono.woff +0 -0
- package/dist/collection/fonts/noto-sans-mono/gcds-noto-sans-mono.woff2 +0 -0
- package/dist/collection/generated/locale.js +148 -0
- package/dist/collection/global/mapml-globals.js +916 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/leaflet-src.esm.js +14419 -0
- package/dist/components/gcds-ext-map.d.ts +11 -0
- package/dist/components/gcds-ext-map.js +10 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/map-a.d.ts +11 -0
- package/dist/components/map-a.js +1 -0
- package/dist/components/map-caption.d.ts +11 -0
- package/dist/components/map-caption.js +1 -0
- package/dist/components/map-extent.d.ts +11 -0
- package/dist/components/map-extent.js +1 -0
- package/dist/components/map-feature.d.ts +11 -0
- package/dist/components/map-feature.js +1 -0
- package/dist/components/map-featurecaption.d.ts +11 -0
- package/dist/components/map-featurecaption.js +1 -0
- package/dist/components/map-geometry.d.ts +11 -0
- package/dist/components/map-geometry.js +1 -0
- package/dist/components/map-input.d.ts +11 -0
- package/dist/components/map-input.js +1 -0
- package/dist/components/map-layer.d.ts +11 -0
- package/dist/components/map-layer.js +1 -0
- package/dist/components/map-link.d.ts +11 -0
- package/dist/components/map-link.js +1 -0
- package/dist/components/map-meta.d.ts +11 -0
- package/dist/components/map-meta.js +1 -0
- package/dist/components/map-properties.d.ts +11 -0
- package/dist/components/map-properties.js +1 -0
- package/dist/components/map-select.d.ts +11 -0
- package/dist/components/map-select.js +1 -0
- package/dist/components/map-span.d.ts +11 -0
- package/dist/components/map-span.js +1 -0
- package/dist/components/map-style.d.ts +11 -0
- package/dist/components/map-style.js +1 -0
- package/dist/components/map-tile.d.ts +11 -0
- package/dist/components/map-tile.js +1 -0
- package/dist/components/p-B4YLD_Og.js +1 -0
- package/dist/components/p-BE41zrui.js +1 -0
- package/dist/components/p-Bpv_U_Lb.js +1 -0
- package/dist/components/p-CwRxGZga.js +5 -0
- package/dist/components/p-EYVT9Efh.js +1 -0
- package/dist/components/p-gwC_yeRa.js +1 -0
- package/dist/esm/AttributionButton-CfaoSLCu.js +103 -0
- package/dist/esm/MapTileLayer-DvC_iOIS.js +451 -0
- package/dist/esm/app-globals-De5ze2BD.js +773 -0
- package/dist/esm/calculatePosition-B4YLD_Og.js +90 -0
- package/dist/esm/gcds-ext-map.js +43 -0
- package/dist/esm/gcds-ext-map_2.entry.js +8078 -0
- package/dist/esm/index-BUsJ7i5g.js +32656 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +12 -0
- package/dist/esm/locale-Bpv_U_Lb.js +150 -0
- package/dist/esm/map-a.entry.js +14 -0
- package/dist/esm/map-caption.entry.js +53 -0
- package/dist/esm/map-extent.entry.js +991 -0
- package/dist/esm/map-feature.entry.js +634 -0
- package/dist/esm/map-featurecaption.entry.js +12 -0
- package/dist/esm/map-geometry.entry.js +34 -0
- package/dist/esm/map-input.entry.js +346 -0
- package/dist/esm/map-link.entry.js +6035 -0
- package/dist/esm/map-meta.entry.js +38 -0
- package/dist/esm/map-properties.entry.js +12 -0
- package/dist/esm/map-select.entry.js +98 -0
- package/dist/esm/map-span.entry.js +12 -0
- package/dist/esm/map-style.entry.js +125 -0
- package/dist/esm/map-tile.entry.js +272 -0
- package/dist/esm/renderStyles-EYVT9Efh.js +57 -0
- package/dist/gcds-ext-map/assets/canada.json +1 -0
- package/dist/gcds-ext-map/assets/images/w3community.ico +0 -0
- package/dist/gcds-ext-map/assets/mapml/en/apstile/arctic +18 -0
- package/dist/gcds-ext-map/assets/mapml/en/cbmtile/canvec +22 -0
- package/dist/gcds-ext-map/assets/mapml/en/cbmtile/cbmt +24 -0
- package/dist/gcds-ext-map/assets/mapml/en/cbmtile/cbmtgeom +20 -0
- package/dist/gcds-ext-map/assets/mapml/en/cbmtile/cbmtsimple +20 -0
- package/dist/gcds-ext-map/assets/mapml/en/cbmtile/current_conditions +33 -0
- package/dist/gcds-ext-map/assets/mapml/en/cbmtile/toporama +25 -0
- package/dist/gcds-ext-map/assets/mapml/en/custom/arcticsdi.mapml +18 -0
- package/dist/gcds-ext-map/assets/mapml/en/osmtile/cbmt +24 -0
- package/dist/gcds-ext-map/assets/mapml/en/osmtile/current_conditions +32 -0
- package/dist/gcds-ext-map/assets/mapml/en/osmtile/dark.mapml +19 -0
- package/dist/gcds-ext-map/assets/mapml/en/osmtile/light.mapml +19 -0
- package/dist/gcds-ext-map/assets/mapml/en/osmtile/osm +19 -0
- package/dist/gcds-ext-map/assets/mapml/en/osmtile/toporama +25 -0
- package/dist/gcds-ext-map/assets/mapml/fr/apstile/arctic +19 -0
- package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/canvec +22 -0
- package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/cbmt +24 -0
- package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/cbmtgeom +20 -0
- package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/cbmtsimple +20 -0
- package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/current_conditions +25 -0
- package/dist/gcds-ext-map/assets/mapml/fr/cbmtile/toporama +25 -0
- package/dist/gcds-ext-map/assets/mapml/fr/osmtile/cbmt +24 -0
- package/dist/gcds-ext-map/assets/mapml/fr/osmtile/current_conditions +24 -0
- package/dist/gcds-ext-map/assets/mapml/fr/osmtile/dark.mapml +19 -0
- package/dist/gcds-ext-map/assets/mapml/fr/osmtile/light.mapml +19 -0
- package/dist/gcds-ext-map/assets/mapml/fr/osmtile/osm +19 -0
- package/dist/gcds-ext-map/assets/mapml/fr/osmtile/toporama +25 -0
- package/dist/gcds-ext-map/assets/pmtiles/darkTheme.js +19 -0
- package/dist/gcds-ext-map/assets/pmtiles/lightTheme.js +19 -0
- package/dist/gcds-ext-map/fonts/icons/LICENSE.txt +92 -0
- package/dist/gcds-ext-map/fonts/icons/README.md +543 -0
- package/dist/gcds-ext-map/fonts/icons/gcds-icons.css +110 -0
- package/dist/gcds-ext-map/fonts/icons/gcds-icons.eot +0 -0
- package/dist/gcds-ext-map/fonts/icons/gcds-icons.svg +82 -0
- package/dist/gcds-ext-map/fonts/icons/gcds-icons.ttf +0 -0
- package/dist/gcds-ext-map/fonts/icons/gcds-icons.woff +0 -0
- package/dist/gcds-ext-map/fonts/lato/LICENSE.txt +48 -0
- package/dist/gcds-ext-map/fonts/lato/README.md +195 -0
- package/dist/gcds-ext-map/fonts/lato/gcds-lato-italic.woff +0 -0
- package/dist/gcds-ext-map/fonts/lato/gcds-lato-italic.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/lato/gcds-lato.css +30 -0
- package/dist/gcds-ext-map/fonts/lato/gcds-lato.woff +0 -0
- package/dist/gcds-ext-map/fonts/lato/gcds-lato.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/LICENSE.txt +43 -0
- package/dist/gcds-ext-map/fonts/noto-sans/README.md +423 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-bold-italic.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-bold-italic.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-bold.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-bold.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-light-italic.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-light-italic.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-light.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-light.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-medium-italic.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-medium-italic.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-medium.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-medium.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-regular-italic.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-regular-italic.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-regular.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-regular.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-semibold-italic.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-semibold-italic.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-semibold.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans-semibold.woff2 +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans/gcds-noto-sans.css +89 -0
- package/dist/gcds-ext-map/fonts/noto-sans-mono/LICENSE.txt +93 -0
- package/dist/gcds-ext-map/fonts/noto-sans-mono/README.md +135 -0
- package/dist/gcds-ext-map/fonts/noto-sans-mono/gcds-noto-sans-mono.css +17 -0
- package/dist/gcds-ext-map/fonts/noto-sans-mono/gcds-noto-sans-mono.woff +0 -0
- package/dist/gcds-ext-map/fonts/noto-sans-mono/gcds-noto-sans-mono.woff2 +0 -0
- package/dist/gcds-ext-map/gcds-ext-map.esm.js +1 -0
- package/dist/gcds-ext-map/index.esm.js +0 -0
- package/dist/gcds-ext-map/leaflet-src.esm.js +14419 -0
- package/dist/gcds-ext-map/p-1b22f774.entry.js +1 -0
- package/dist/gcds-ext-map/p-29b4ba34.entry.js +1 -0
- package/dist/gcds-ext-map/p-2dd09d44.entry.js +1 -0
- package/dist/gcds-ext-map/p-3fef47e5.entry.js +1 -0
- package/dist/gcds-ext-map/p-4e324a1d.entry.js +1 -0
- package/dist/gcds-ext-map/p-4f4a6873.entry.js +1 -0
- package/dist/gcds-ext-map/p-9cc5ad37.entry.js +1 -0
- package/dist/gcds-ext-map/p-9edfea7d.entry.js +1 -0
- package/dist/gcds-ext-map/p-B4YLD_Og.js +1 -0
- package/dist/gcds-ext-map/p-B8Id5Ptd.js +1 -0
- package/dist/gcds-ext-map/p-BUsJ7i5g.js +6 -0
- package/dist/gcds-ext-map/p-Bpv_U_Lb.js +1 -0
- package/dist/gcds-ext-map/p-CtOuMgy9.js +1 -0
- package/dist/gcds-ext-map/p-Dd474fsL.js +1 -0
- package/dist/gcds-ext-map/p-EYVT9Efh.js +1 -0
- package/dist/gcds-ext-map/p-a67d721d.entry.js +1 -0
- package/dist/gcds-ext-map/p-b16e862b.entry.js +1 -0
- package/dist/gcds-ext-map/p-b9cbf1e0.entry.js +10 -0
- package/dist/gcds-ext-map/p-cab5246e.entry.js +1 -0
- package/dist/gcds-ext-map/p-d58d409b.entry.js +1 -0
- package/dist/gcds-ext-map/p-dfa21368.entry.js +1 -0
- package/dist/gcds-ext-map/p-f211048a.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/gcds-ext-map/gcds-ext-map.d.ts +125 -0
- package/dist/types/components/gcds-ext-map/stories/gcds-ext-map.stories.d.ts +230 -0
- package/dist/types/components/map-a/map-a.d.ts +7 -0
- package/dist/types/components/map-caption/map-caption.d.ts +7 -0
- package/dist/types/components/map-extent/map-extent.d.ts +53 -0
- package/dist/types/components/map-feature/map-feature.d.ts +50 -0
- package/dist/types/components/map-featurecaption/map-featurecaption.d.ts +3 -0
- package/dist/types/components/map-geometry/map-geometry.d.ts +7 -0
- package/dist/types/components/map-input/map-input.d.ts +24 -0
- package/dist/types/components/map-layer/map-layer.d.ts +85 -0
- package/dist/types/components/map-layer/stories/map-layer.stories.d.ts +96 -0
- package/dist/types/components/map-link/map-link.d.ts +66 -0
- package/dist/types/components/map-meta/map-meta.d.ts +11 -0
- package/dist/types/components/map-properties/map-properties.d.ts +3 -0
- package/dist/types/components/map-select/map-select.d.ts +13 -0
- package/dist/types/components/map-span/map-span.d.ts +5 -0
- package/dist/types/components/map-style/map-style.d.ts +17 -0
- package/dist/types/components/map-tile/map-tile.d.ts +32 -0
- package/dist/types/components/utils/mapml/DOMTokenList.d.ts +30 -0
- package/dist/types/components/utils/mapml/elementSupport/inputs/heightInput.d.ts +7 -0
- package/dist/types/components/utils/mapml/elementSupport/inputs/hiddenInput.d.ts +7 -0
- package/dist/types/components/utils/mapml/elementSupport/inputs/locationInput.d.ts +14 -0
- package/dist/types/components/utils/mapml/elementSupport/inputs/widthInput.d.ts +7 -0
- package/dist/types/components/utils/mapml/elementSupport/inputs/zoomInput.d.ts +11 -0
- package/dist/types/components/utils/mapml/layers/MapLayer.d.ts +69 -0
- package/dist/types/components/utils/utils.d.ts +2 -0
- package/dist/types/components.d.ts +521 -0
- package/dist/types/gcds-ext-map.d.ts +17 -0
- package/dist/types/generated/locale.d.ts +146 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1861 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +87 -0
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ContextMenu = require('./index-CW_WOSnc.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Leaflet layer for handling map-tile elements
|
|
7
|
+
* Extends GridLayer to create tiles based on map-tile elements
|
|
8
|
+
*
|
|
9
|
+
* Similar in intent to MapFeatureLayer, which is a receiver for
|
|
10
|
+
* map-feature elements' leaflet layer object
|
|
11
|
+
*
|
|
12
|
+
* This layer will be inserted into the LayerGroup hosted by the <map-link> or
|
|
13
|
+
* <map-layer> immediately after creation, so that its index within the _layers array of
|
|
14
|
+
* that LayerGroup will be equal to its z-index within the LayerGroup's container
|
|
15
|
+
*
|
|
16
|
+
* <map-tile row="10" col="12" src="url1"></map-tile> LayerGroup._layers[0] <- each *set* of adjacent tiles
|
|
17
|
+
* <map-tile row="11" col="12" src="url2"></map-tile> LayerGroup._layers[0] <- is a *single* MapTileLayer
|
|
18
|
+
* <map-extent units="OSMTILE" checked hidden> LayerGroup._layers[1] *each* <map-extent> is a LayerGroup of Templated*Layer.js
|
|
19
|
+
* <map-feature id="a"> LayerGroup._layers[2] <- each *set* of adjacent features
|
|
20
|
+
* <map-feature id="b"> LayerGroup._layers[2] <- is a single MapFeatureLayer FeatureGroup
|
|
21
|
+
* <map-tile row="10" col="12" src="url3"></map-tile> LayerGroup._layers[3]
|
|
22
|
+
* <map-tile row="11" col="12" src="url4"></map-tile> LayerGroup._layers[3]
|
|
23
|
+
* <map-feature id="c"> LayerGroup._layers[4]
|
|
24
|
+
* <map-feature id="d"> LayerGroup._layers[4]
|
|
25
|
+
* and so on
|
|
26
|
+
*/
|
|
27
|
+
var MapTileLayer = ContextMenu.leafletSrcExports.GridLayer.extend({
|
|
28
|
+
initialize: function (options) {
|
|
29
|
+
ContextMenu.leafletSrcExports.GridLayer.prototype.initialize.call(this, options);
|
|
30
|
+
this._mapTiles = options.mapTiles || [];
|
|
31
|
+
this._tileMap = {};
|
|
32
|
+
this._pendingTiles = {};
|
|
33
|
+
this._buildTileMap();
|
|
34
|
+
this._container = ContextMenu.leafletSrcExports.DomUtil.create('div', 'leaflet-layer');
|
|
35
|
+
if (options.zIndex) {
|
|
36
|
+
this._container.style.zIndex = options.zIndex;
|
|
37
|
+
}
|
|
38
|
+
ContextMenu.leafletSrcExports.DomUtil.addClass(this._container, 'mapml-static-tile-container');
|
|
39
|
+
// Store bounds for visibility checks
|
|
40
|
+
// this.layerBounds = this._computeLayerBounds();
|
|
41
|
+
// this.zoomBounds = this._computeZoomBounds();
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
getEvents: function () {
|
|
45
|
+
const events = ContextMenu.leafletSrcExports.GridLayer.prototype.getEvents
|
|
46
|
+
? ContextMenu.leafletSrcExports.GridLayer.prototype.getEvents.call(this)
|
|
47
|
+
: {};
|
|
48
|
+
|
|
49
|
+
// Add our custom zoom change handler
|
|
50
|
+
events.zoomend = this._handleZoomChange;
|
|
51
|
+
|
|
52
|
+
return events;
|
|
53
|
+
},
|
|
54
|
+
onAdd: function (map) {
|
|
55
|
+
this.options.pane.appendChild(this._container);
|
|
56
|
+
// Call the parent method
|
|
57
|
+
ContextMenu.leafletSrcExports.GridLayer.prototype.onAdd.call(this, map);
|
|
58
|
+
},
|
|
59
|
+
onRemove: function (map) {
|
|
60
|
+
// Clean up pending tiles
|
|
61
|
+
this._pendingTiles = {};
|
|
62
|
+
// remove _container from the dom, but don't delete it
|
|
63
|
+
ContextMenu.leafletSrcExports.DomUtil.remove(this._container);
|
|
64
|
+
},
|
|
65
|
+
setZIndex: function (zIndex) {
|
|
66
|
+
this.options.zIndex = zIndex;
|
|
67
|
+
this._updateZIndex();
|
|
68
|
+
|
|
69
|
+
return this;
|
|
70
|
+
},
|
|
71
|
+
_updateZIndex: function () {
|
|
72
|
+
if (
|
|
73
|
+
this._container &&
|
|
74
|
+
this.options.zIndex !== undefined &&
|
|
75
|
+
this.options.zIndex !== null
|
|
76
|
+
) {
|
|
77
|
+
this._container.style.zIndex = this.options.zIndex;
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
_handleZoomChange: function () {
|
|
82
|
+
// this is necessary for CBMTILE in particular, I think because
|
|
83
|
+
// Leaflet relies on Web Mercator powers of 2 inter-zoom tile relations
|
|
84
|
+
// to calculate what tiles to clean up/remove. CBMTILE doesn't have that
|
|
85
|
+
// relationship between zoom levels /tiles.
|
|
86
|
+
//
|
|
87
|
+
// Force removal of all tiles that don't match current zoom
|
|
88
|
+
const currentZoom = this._map.getZoom();
|
|
89
|
+
|
|
90
|
+
for (const key in this._tiles) {
|
|
91
|
+
const coords = this._keyToTileCoords(key);
|
|
92
|
+
if (coords.z !== currentZoom) {
|
|
93
|
+
this._removeTile(key);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* Adds a map-tile element to the layer
|
|
99
|
+
* @param {HTMLTileElement} mapTile - The map-tile element to add
|
|
100
|
+
*/
|
|
101
|
+
addMapTile: function (mapTile) {
|
|
102
|
+
if (!this._mapTiles.includes(mapTile)) {
|
|
103
|
+
this._mapTiles.push(mapTile);
|
|
104
|
+
this._addToTileMap(mapTile);
|
|
105
|
+
this._updateBounds();
|
|
106
|
+
if (this._map) {
|
|
107
|
+
this.redraw();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Removes a map-tile element from the layer
|
|
114
|
+
* @param {HTMLTileElement} mapTile - The map-tile element to remove
|
|
115
|
+
*/
|
|
116
|
+
removeMapTile: function (mapTile) {
|
|
117
|
+
const index = this._mapTiles.indexOf(mapTile);
|
|
118
|
+
if (index !== -1) {
|
|
119
|
+
this._mapTiles.splice(index, 1);
|
|
120
|
+
this._removeFromTileMap(mapTile);
|
|
121
|
+
this._updateBounds();
|
|
122
|
+
if (this._map) {
|
|
123
|
+
this.redraw();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Removes a map-tile element from the layer using specific coordinates
|
|
130
|
+
* Used when tile coordinates have changed and we need to remove based on old coordinates
|
|
131
|
+
* @param {HTMLTileElement} mapTile - The map-tile element to remove
|
|
132
|
+
* @param {Object} coords - The coordinates to use for removal {col, row, zoom}
|
|
133
|
+
*/
|
|
134
|
+
removeMapTileAt: function (mapTile, coords) {
|
|
135
|
+
const index = this._mapTiles.indexOf(mapTile);
|
|
136
|
+
if (index !== -1) {
|
|
137
|
+
this._mapTiles.splice(index, 1);
|
|
138
|
+
this._removeFromTileMapAt(coords);
|
|
139
|
+
// Clean up bidirectional links using current tile reference
|
|
140
|
+
if (mapTile._tileDiv) {
|
|
141
|
+
mapTile._tileDiv._mapTile = null;
|
|
142
|
+
mapTile._tileDiv = null;
|
|
143
|
+
}
|
|
144
|
+
this._updateBounds();
|
|
145
|
+
if (this._map) {
|
|
146
|
+
this.redraw();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Checks if the layer is currently visible on the map
|
|
153
|
+
* @returns {boolean} - True if the layer is visible, false otherwise
|
|
154
|
+
*/
|
|
155
|
+
isVisible: function () {
|
|
156
|
+
if (!this._map) return false;
|
|
157
|
+
if (!this.layerBounds) this._updateBounds();
|
|
158
|
+
// approach copied/refactored from MapFeatureLayer
|
|
159
|
+
let map = this._map,
|
|
160
|
+
mapZoom = map.getZoom(),
|
|
161
|
+
zoomBounds = this.zoomBounds,
|
|
162
|
+
layerBounds = this.layerBounds,
|
|
163
|
+
withinZoom =
|
|
164
|
+
mapZoom <= zoomBounds.maxZoom && mapZoom >= zoomBounds.minZoom;
|
|
165
|
+
return (
|
|
166
|
+
withinZoom &&
|
|
167
|
+
this._mapTiles &&
|
|
168
|
+
layerBounds &&
|
|
169
|
+
layerBounds.overlaps(
|
|
170
|
+
ContextMenu.Util.pixelToPCRSBounds(
|
|
171
|
+
map.getPixelBounds(),
|
|
172
|
+
mapZoom,
|
|
173
|
+
map.options.projection
|
|
174
|
+
)
|
|
175
|
+
)
|
|
176
|
+
);
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Overrides GridLayer createTile to use map-tile elements
|
|
181
|
+
* @param {Object} coords - Tile coordinates
|
|
182
|
+
* @param {Function} done - Callback to be called when the tile is ready, with error and tile element params
|
|
183
|
+
* @returns {HTMLElement} - The created tile element
|
|
184
|
+
*/
|
|
185
|
+
createTile: function (coords, done) {
|
|
186
|
+
const tileKey = this._tileCoordsToKey(coords);
|
|
187
|
+
const tileSize = this.getTileSize();
|
|
188
|
+
|
|
189
|
+
// Create container element
|
|
190
|
+
const tileElement = document.createElement('div');
|
|
191
|
+
tileElement.setAttribute('col', coords.x);
|
|
192
|
+
tileElement.setAttribute('row', coords.y);
|
|
193
|
+
tileElement.setAttribute('zoom', coords.z);
|
|
194
|
+
ContextMenu.leafletSrcExports.DomUtil.addClass(tileElement, 'leaflet-tile');
|
|
195
|
+
|
|
196
|
+
// Set size
|
|
197
|
+
tileElement.style.width = tileSize.x + 'px';
|
|
198
|
+
tileElement.style.height = tileSize.y + 'px';
|
|
199
|
+
|
|
200
|
+
// Find matching tile in our map
|
|
201
|
+
const matchingTile = this._tileMap[tileKey];
|
|
202
|
+
|
|
203
|
+
if (matchingTile) {
|
|
204
|
+
// Create an image element with the src from the matching map-tile
|
|
205
|
+
const img = document.createElement('img');
|
|
206
|
+
img.src = matchingTile.src;
|
|
207
|
+
img.width = tileSize.x;
|
|
208
|
+
img.height = tileSize.y;
|
|
209
|
+
img.alt = '';
|
|
210
|
+
img.setAttribute('role', 'presentation');
|
|
211
|
+
// bidirectional link map-tile element and rendered div
|
|
212
|
+
tileElement._mapTile = matchingTile;
|
|
213
|
+
matchingTile._tileDiv = tileElement;
|
|
214
|
+
|
|
215
|
+
tileElement.appendChild(img);
|
|
216
|
+
|
|
217
|
+
// Add the loaded class manually to ensure tile is visible
|
|
218
|
+
ContextMenu.leafletSrcExports.DomUtil.addClass(tileElement, 'leaflet-tile-loaded');
|
|
219
|
+
|
|
220
|
+
// Call the done callback to signal that the tile is ready
|
|
221
|
+
done(null, tileElement);
|
|
222
|
+
} else {
|
|
223
|
+
// The tile might be added later, register a pending tile
|
|
224
|
+
if (!this._pendingTiles) {
|
|
225
|
+
this._pendingTiles = {};
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Store the tile element and done callback for later update
|
|
229
|
+
this._pendingTiles[tileKey] = {
|
|
230
|
+
element: tileElement,
|
|
231
|
+
done: done
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
// Don't call done yet - we'll call it when the map-tile is added
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return tileElement;
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Builds the tile map from the current map-tile elements
|
|
242
|
+
* @private
|
|
243
|
+
*/
|
|
244
|
+
_buildTileMap: function () {
|
|
245
|
+
this._tileMap = {};
|
|
246
|
+
for (const mapTile of this._mapTiles) {
|
|
247
|
+
this._addToTileMap(mapTile);
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Adds a map-tile element to the tile map
|
|
253
|
+
* @param {HTMLTileElement} mapTile - The map-tile element to add
|
|
254
|
+
* @private
|
|
255
|
+
*/
|
|
256
|
+
_addToTileMap: function (mapTile) {
|
|
257
|
+
const tileKey = `${mapTile.col}:${mapTile.row}:${mapTile.zoom}`;
|
|
258
|
+
this._tileMap[tileKey] = mapTile;
|
|
259
|
+
|
|
260
|
+
// Check if this tile was requested but not available at that time
|
|
261
|
+
if (this._pendingTiles && this._pendingTiles[tileKey]) {
|
|
262
|
+
const pendingTile = this._pendingTiles[tileKey];
|
|
263
|
+
const tileElement = pendingTile.element;
|
|
264
|
+
const doneCallback = pendingTile.done;
|
|
265
|
+
|
|
266
|
+
// Create and append the image to the tile
|
|
267
|
+
const tileSize = this.getTileSize();
|
|
268
|
+
const img = document.createElement('img');
|
|
269
|
+
img.src = mapTile.src;
|
|
270
|
+
img.width = tileSize.x;
|
|
271
|
+
img.height = tileSize.y;
|
|
272
|
+
img.alt = '';
|
|
273
|
+
img.setAttribute('role', 'presentation');
|
|
274
|
+
|
|
275
|
+
// bidirectional link map-tile element and rendered div
|
|
276
|
+
tileElement._mapTile = mapTile;
|
|
277
|
+
mapTile._tileDiv = tileElement;
|
|
278
|
+
|
|
279
|
+
tileElement.appendChild(img);
|
|
280
|
+
|
|
281
|
+
// Add the loaded class manually to ensure tile is visible
|
|
282
|
+
ContextMenu.leafletSrcExports.DomUtil.addClass(tileElement, 'leaflet-tile-loaded');
|
|
283
|
+
|
|
284
|
+
// Call the done callback to signal that the tile is now ready
|
|
285
|
+
if (doneCallback) {
|
|
286
|
+
doneCallback(null, tileElement);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Remove from pending tiles
|
|
290
|
+
delete this._pendingTiles[tileKey];
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
/**
|
|
294
|
+
* Removes a map-tile element from the tile map
|
|
295
|
+
* @param {HTMLTileElement} mapTile - The map-tile element to remove
|
|
296
|
+
* @private
|
|
297
|
+
*/
|
|
298
|
+
_removeFromTileMap: function (mapTile) {
|
|
299
|
+
const tileKey = `${mapTile.col}:${mapTile.row}:${mapTile.zoom}`;
|
|
300
|
+
delete this._tileMap[tileKey];
|
|
301
|
+
|
|
302
|
+
// Clean up bidirectional links
|
|
303
|
+
if (mapTile._tileDiv) {
|
|
304
|
+
mapTile._tileDiv._mapTile = null;
|
|
305
|
+
mapTile._tileDiv = null;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Also remove from pending tiles if it exists there
|
|
309
|
+
if (this._pendingTiles && this._pendingTiles[tileKey]) {
|
|
310
|
+
delete this._pendingTiles[tileKey];
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Removes a tile from the tile map using specific coordinates
|
|
316
|
+
* @param {Object} coords - The coordinates {col, row, zoom}
|
|
317
|
+
* @private
|
|
318
|
+
*/
|
|
319
|
+
_removeFromTileMapAt: function (coords) {
|
|
320
|
+
const tileKey = `${coords.col}:${coords.row}:${coords.zoom}`;
|
|
321
|
+
delete this._tileMap[tileKey];
|
|
322
|
+
|
|
323
|
+
// Also remove from pending tiles if it exists there
|
|
324
|
+
if (this._pendingTiles && this._pendingTiles[tileKey]) {
|
|
325
|
+
delete this._pendingTiles[tileKey];
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Updates layer bounds when tiles are added or removed
|
|
331
|
+
* @private
|
|
332
|
+
*/
|
|
333
|
+
_updateBounds: function () {
|
|
334
|
+
this.layerBounds = this._computeLayerBounds();
|
|
335
|
+
this.zoomBounds = this._computeZoomBounds();
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Computes the layer bounds from all map-tile elements
|
|
340
|
+
* @returns {L.Bounds} - The computed layer bounds
|
|
341
|
+
* @private
|
|
342
|
+
*/
|
|
343
|
+
_computeLayerBounds: function () {
|
|
344
|
+
if (this._mapTiles.length === 0) {
|
|
345
|
+
return ContextMenu.leafletSrcExports.bounds([0, 0], [0, 0]);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
const tilesByZoom = {};
|
|
349
|
+
const projection = this.options.projection;
|
|
350
|
+
const tileSize = M[projection].options.crs.tile.bounds.max.x;
|
|
351
|
+
|
|
352
|
+
// Group tiles by zoom
|
|
353
|
+
for (const mapTile of this._mapTiles) {
|
|
354
|
+
const zoom = mapTile.zoom;
|
|
355
|
+
|
|
356
|
+
if (!tilesByZoom[zoom]) {
|
|
357
|
+
tilesByZoom[zoom] = [];
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
tilesByZoom[zoom].push({
|
|
361
|
+
x: mapTile.col,
|
|
362
|
+
y: mapTile.row,
|
|
363
|
+
z: zoom
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// Calculate bounds for each zoom level
|
|
368
|
+
const layerBoundsByZoom = {};
|
|
369
|
+
for (const zoom in tilesByZoom) {
|
|
370
|
+
const tiles = tilesByZoom[zoom];
|
|
371
|
+
let pixelBounds = null;
|
|
372
|
+
|
|
373
|
+
for (const tile of tiles) {
|
|
374
|
+
const pixelX = tile.x * tileSize;
|
|
375
|
+
const pixelY = tile.y * tileSize;
|
|
376
|
+
|
|
377
|
+
if (!pixelBounds) {
|
|
378
|
+
pixelBounds = ContextMenu.leafletSrcExports.bounds(
|
|
379
|
+
ContextMenu.leafletSrcExports.point(pixelX, pixelY),
|
|
380
|
+
ContextMenu.leafletSrcExports.point(pixelX + tileSize, pixelY + tileSize)
|
|
381
|
+
);
|
|
382
|
+
} else {
|
|
383
|
+
pixelBounds.extend(ContextMenu.leafletSrcExports.point(pixelX, pixelY));
|
|
384
|
+
pixelBounds.extend(ContextMenu.leafletSrcExports.point(pixelX + tileSize, pixelY + tileSize));
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
if (pixelBounds) {
|
|
389
|
+
layerBoundsByZoom[zoom] = ContextMenu.Util.pixelToPCRSBounds(
|
|
390
|
+
pixelBounds,
|
|
391
|
+
parseInt(zoom),
|
|
392
|
+
projection
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// Combine all zoom level bounds
|
|
398
|
+
let combinedBounds = null;
|
|
399
|
+
for (const zoom in layerBoundsByZoom) {
|
|
400
|
+
if (!combinedBounds) {
|
|
401
|
+
// makes a clone of the bounds, including methods
|
|
402
|
+
combinedBounds = layerBoundsByZoom[zoom].pad(0);
|
|
403
|
+
} else {
|
|
404
|
+
combinedBounds.extend(layerBoundsByZoom[zoom].min);
|
|
405
|
+
combinedBounds.extend(layerBoundsByZoom[zoom].max);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return combinedBounds || ContextMenu.leafletSrcExports.bounds([0, 0], [0, 0]);
|
|
410
|
+
},
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Computes zoom bounds from all map-tile elements
|
|
414
|
+
* @returns {Object} - The computed zoom bounds
|
|
415
|
+
* @private
|
|
416
|
+
*/
|
|
417
|
+
_computeZoomBounds: function () {
|
|
418
|
+
const result = {
|
|
419
|
+
minZoom: Infinity,
|
|
420
|
+
maxZoom: -Infinity,
|
|
421
|
+
minNativeZoom: Infinity,
|
|
422
|
+
maxNativeZoom: -Infinity
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
if (this._mapTiles.length === 0) {
|
|
426
|
+
return {
|
|
427
|
+
minZoom: 0,
|
|
428
|
+
maxZoom: 22,
|
|
429
|
+
minNativeZoom: 0,
|
|
430
|
+
maxNativeZoom: 22
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// Find min/max zoom from map-tile elements
|
|
435
|
+
for (const mapTile of this._mapTiles) {
|
|
436
|
+
const zoom = mapTile.zoom;
|
|
437
|
+
result.minNativeZoom = Math.min(result.minNativeZoom, zoom);
|
|
438
|
+
result.maxNativeZoom = Math.max(result.maxNativeZoom, zoom);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// Set min/max zoom based on native zoom
|
|
442
|
+
result.minZoom = result.minNativeZoom;
|
|
443
|
+
result.maxZoom = result.maxNativeZoom;
|
|
444
|
+
|
|
445
|
+
return result;
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
var mapTileLayer = function (options) {
|
|
450
|
+
return new MapTileLayer(options);
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
exports.MapTileLayer = MapTileLayer;
|
|
454
|
+
exports.mapTileLayer = mapTileLayer;
|