@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,636 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ContextMenu = require('./index-CW_WOSnc.js');
|
|
4
|
+
var calculatePosition = require('./calculatePosition-CDcdNl7C.js');
|
|
5
|
+
|
|
6
|
+
const MapFeature = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
ContextMenu.registerInstance(this, hostRef);
|
|
9
|
+
}
|
|
10
|
+
get el() { return ContextMenu.getElement(this); }
|
|
11
|
+
zoom;
|
|
12
|
+
min;
|
|
13
|
+
max;
|
|
14
|
+
_featureLayer;
|
|
15
|
+
_geometry;
|
|
16
|
+
_groupEl;
|
|
17
|
+
_observer;
|
|
18
|
+
_parentEl;
|
|
19
|
+
_initialZoom;
|
|
20
|
+
_getFeatureExtent;
|
|
21
|
+
zoomChanged(newValue, oldValue) {
|
|
22
|
+
if (oldValue !== newValue && this._featureLayer) {
|
|
23
|
+
this.reRender(this._featureLayer);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
minChanged(newValue, oldValue) {
|
|
27
|
+
if (oldValue !== newValue && this._featureLayer) {
|
|
28
|
+
this.reRender(this._featureLayer);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
maxChanged(newValue, oldValue) {
|
|
32
|
+
if (oldValue !== newValue && this._featureLayer) {
|
|
33
|
+
this.reRender(this._featureLayer);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
get zoomValue() {
|
|
37
|
+
// for templated or queried features ** native zoom is only used for zoomTo() **
|
|
38
|
+
let meta = {}, metaEl = this.getMeta('zoom');
|
|
39
|
+
if (metaEl)
|
|
40
|
+
meta = ContextMenu.Util._metaContentToObject(metaEl.getAttribute('content'));
|
|
41
|
+
if (this._parentEl?.nodeName === 'MAP-LINK') {
|
|
42
|
+
// nativeZoom = zoom attribute || (sd.map-meta zoom 'value' || 'max') || this._initialZoom
|
|
43
|
+
return +(this.el.hasAttribute('zoom')
|
|
44
|
+
? this.el.getAttribute('zoom')
|
|
45
|
+
: meta['value']
|
|
46
|
+
? meta['value']
|
|
47
|
+
: meta['max']
|
|
48
|
+
? meta['max']
|
|
49
|
+
: this._initialZoom ?? this.getMapEl()?.zoom ?? 0);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
// for "static" features
|
|
53
|
+
// nativeZoom zoom attribute || this._initialZoom
|
|
54
|
+
return +(this.el.hasAttribute('zoom')
|
|
55
|
+
? this.el.getAttribute('zoom')
|
|
56
|
+
: this._initialZoom ?? this.getMapEl()?.zoom ?? 0);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
get minValue() {
|
|
60
|
+
// for templated or queried features
|
|
61
|
+
let meta = {}, metaEl = this.getMeta('zoom');
|
|
62
|
+
if (metaEl)
|
|
63
|
+
meta = ContextMenu.Util._metaContentToObject(metaEl.getAttribute('content'));
|
|
64
|
+
let projectionMinZoom = 0;
|
|
65
|
+
if (this._parentEl?.nodeName === 'MAP-LINK') {
|
|
66
|
+
// minZoom = min attribute || sd.map-meta min zoom || map-link minZoom
|
|
67
|
+
return +(this.el.hasAttribute('min')
|
|
68
|
+
? this.el.getAttribute('min')
|
|
69
|
+
: meta['min']
|
|
70
|
+
? meta['min']
|
|
71
|
+
: this._parentEl.getZoomBounds().minZoom);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
// for "static" features
|
|
75
|
+
// minZoom = min attribute || map-meta zoom || projection minZoom
|
|
76
|
+
return +(this.el.hasAttribute('min')
|
|
77
|
+
? this.el.getAttribute('min')
|
|
78
|
+
: meta['min']
|
|
79
|
+
? meta['min']
|
|
80
|
+
: projectionMinZoom);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
get maxValue() {
|
|
84
|
+
// for templated or queried features
|
|
85
|
+
let meta = {}, metaEl = this.getMeta('zoom');
|
|
86
|
+
if (metaEl)
|
|
87
|
+
meta = ContextMenu.Util._metaContentToObject(metaEl.getAttribute('content'));
|
|
88
|
+
let projectionMaxZoom = this.getMapEl()?._map?.options.crs.options.resolutions.length - 1;
|
|
89
|
+
if (this._parentEl?.nodeName === 'MAP-LINK') {
|
|
90
|
+
// maxZoom = max attribute || sd.map-meta max zoom || map-link maxZoom
|
|
91
|
+
return +(this.el.hasAttribute('max')
|
|
92
|
+
? this.el.getAttribute('max')
|
|
93
|
+
: meta['max']
|
|
94
|
+
? meta['max']
|
|
95
|
+
: this._parentEl.getZoomBounds().maxZoom);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// for "static" features
|
|
99
|
+
// maxZoom = max attribute || map-meta zoom max || projection maxZoom
|
|
100
|
+
return +(this.el.hasAttribute('max')
|
|
101
|
+
? this.el.getAttribute('max')
|
|
102
|
+
: meta['max']
|
|
103
|
+
? meta['max']
|
|
104
|
+
: projectionMaxZoom);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
get extent() {
|
|
108
|
+
if (this.el.isConnected) {
|
|
109
|
+
// if the feature extent is the first time to be calculated or the feature extent is changed
|
|
110
|
+
if (!this._getFeatureExtent) {
|
|
111
|
+
this._getFeatureExtent = this._memoizeExtent();
|
|
112
|
+
}
|
|
113
|
+
return this._getFeatureExtent();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
get position() {
|
|
117
|
+
return calculatePosition.calculatePosition(this.el);
|
|
118
|
+
}
|
|
119
|
+
getMapEl() {
|
|
120
|
+
return ContextMenu.Util.getClosest(this.el, 'gcds-ext-map');
|
|
121
|
+
}
|
|
122
|
+
getLayerEl() {
|
|
123
|
+
return ContextMenu.Util.getClosest(this.el, 'map-layer,layer-');
|
|
124
|
+
}
|
|
125
|
+
async connectedCallback() {
|
|
126
|
+
// set the initial zoom of the map when features connected
|
|
127
|
+
// used for fallback zoom getter for static features
|
|
128
|
+
this._initialZoom = this.getMapEl()?.zoom;
|
|
129
|
+
this._parentEl =
|
|
130
|
+
this.el.parentNode?.nodeName === 'MAP-LAYER' ||
|
|
131
|
+
this.el.parentNode?.nodeName === 'LAYER-' ||
|
|
132
|
+
this.el.parentNode?.nodeName === 'MAP-LINK'
|
|
133
|
+
? this.el.parentNode
|
|
134
|
+
: this.el.parentNode?.host;
|
|
135
|
+
if (this.getLayerEl()?.hasAttribute('data-moving') ||
|
|
136
|
+
this._parentEl?.parentElement?.hasAttribute('data-moving'))
|
|
137
|
+
return;
|
|
138
|
+
// Publish MapML compatibility methods on element
|
|
139
|
+
this.el.getMapEl = this.getMapEl.bind(this);
|
|
140
|
+
this.el.getLayerEl = this.getLayerEl.bind(this);
|
|
141
|
+
this.el.zoomTo = this.zoomTo.bind(this);
|
|
142
|
+
this.el.getZoomToZoom = this.getZoomToZoom.bind(this);
|
|
143
|
+
this.el.click = this.click.bind(this);
|
|
144
|
+
this.el.focus = this.focus.bind(this);
|
|
145
|
+
this.el.blur = this.blur.bind(this);
|
|
146
|
+
this.el.mapml2geojson = this.mapml2geojson.bind(this);
|
|
147
|
+
this.el.addFeature = this.addFeature.bind(this);
|
|
148
|
+
this.el.removeFeature = this.removeFeature.bind(this);
|
|
149
|
+
this.el.reRender = this.reRender.bind(this);
|
|
150
|
+
Object.defineProperty(this.el, 'zoom', {
|
|
151
|
+
get: () => this.zoomValue,
|
|
152
|
+
configurable: true,
|
|
153
|
+
enumerable: true
|
|
154
|
+
});
|
|
155
|
+
Object.defineProperty(this.el, 'extent', {
|
|
156
|
+
get: () => this.extent,
|
|
157
|
+
configurable: true,
|
|
158
|
+
enumerable: true
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(this.el, 'position', {
|
|
161
|
+
get: () => this.position,
|
|
162
|
+
configurable: true,
|
|
163
|
+
enumerable: true
|
|
164
|
+
});
|
|
165
|
+
// Note: zoom, min, max are already exposed as @Prop with reflect: true
|
|
166
|
+
// so they don't need Object.defineProperty - they're already accessible on the element
|
|
167
|
+
if (this._parentEl?.nodeName === 'MAP-LAYER' ||
|
|
168
|
+
this._parentEl?.nodeName === 'LAYER-' ||
|
|
169
|
+
this._parentEl?.nodeName === 'MAP-LINK') {
|
|
170
|
+
this._createOrGetFeatureLayer();
|
|
171
|
+
}
|
|
172
|
+
// Expose properties on DOM element for MapML compatibility
|
|
173
|
+
Object.defineProperty(this.el, '_featureLayer', {
|
|
174
|
+
get: () => this._featureLayer,
|
|
175
|
+
configurable: true,
|
|
176
|
+
enumerable: true
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(this.el, '_geometry', {
|
|
179
|
+
get: () => this._geometry,
|
|
180
|
+
configurable: true,
|
|
181
|
+
enumerable: true
|
|
182
|
+
});
|
|
183
|
+
// use observer to monitor the changes in mapFeature's subtree
|
|
184
|
+
this._observer = new MutationObserver((mutationList) => {
|
|
185
|
+
for (let mutation of mutationList) {
|
|
186
|
+
// the attributes changes of <map-feature> element should be handled by watchers
|
|
187
|
+
if (mutation.type === 'attributes' && mutation.target === this.el) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
// re-render feature if there is any observed change
|
|
191
|
+
this.reRender(this._featureLayer);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
this._observer.observe(this.el, {
|
|
195
|
+
childList: true,
|
|
196
|
+
subtree: true,
|
|
197
|
+
attributes: true,
|
|
198
|
+
attributeOldValue: true,
|
|
199
|
+
characterData: true
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
disconnectedCallback() {
|
|
203
|
+
if (this.getLayerEl()?.hasAttribute('data-moving') ||
|
|
204
|
+
this._parentEl?.parentElement?.hasAttribute('data-moving'))
|
|
205
|
+
return;
|
|
206
|
+
this._observer?.disconnect();
|
|
207
|
+
if (this._featureLayer) {
|
|
208
|
+
this.removeFeature(this._featureLayer);
|
|
209
|
+
// If this was the last feature in the layer, clean up the layer
|
|
210
|
+
if (this._featureLayer.getLayers().length === 0) {
|
|
211
|
+
if (this._featureLayer.options.renderer) {
|
|
212
|
+
// manually remove the shared renderer
|
|
213
|
+
this._featureLayer.options.renderer.remove();
|
|
214
|
+
}
|
|
215
|
+
this._featureLayer.remove();
|
|
216
|
+
this._featureLayer = null;
|
|
217
|
+
delete this._featureLayer;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
// Clean up the layer registry if not data-moving
|
|
221
|
+
const entry = this?._parentEl?._layerRegistry?.get(this.position);
|
|
222
|
+
if (entry) {
|
|
223
|
+
entry.count--;
|
|
224
|
+
if (entry.count === 0) {
|
|
225
|
+
this._parentEl._layerRegistry.delete(this.position);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
reRender(layerToRenderOn) {
|
|
230
|
+
if (this._groupEl?.isConnected) {
|
|
231
|
+
let fallbackCS = this._getFallbackCS();
|
|
232
|
+
let placeholder = document.createElement('span');
|
|
233
|
+
this._groupEl.insertAdjacentElement('beforebegin', placeholder);
|
|
234
|
+
if (layerToRenderOn._staticFeature) {
|
|
235
|
+
layerToRenderOn._removeFromFeaturesList(this._geometry);
|
|
236
|
+
}
|
|
237
|
+
layerToRenderOn.removeLayer(this._geometry);
|
|
238
|
+
// Garbage collection needed
|
|
239
|
+
this._geometry = layerToRenderOn
|
|
240
|
+
.createGeometry(this.el, fallbackCS)
|
|
241
|
+
.addTo(layerToRenderOn);
|
|
242
|
+
// createGeometry sets _groupEl on the DOM element as a side effect
|
|
243
|
+
this._groupEl = this.el._groupEl;
|
|
244
|
+
placeholder.replaceWith(this._geometry.options.group);
|
|
245
|
+
layerToRenderOn._validateRendering();
|
|
246
|
+
delete this._getFeatureExtent;
|
|
247
|
+
this._setUpEvents();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
removeFeature(layerToRemoveFrom) {
|
|
251
|
+
layerToRemoveFrom.removeLayer(this._geometry);
|
|
252
|
+
if (layerToRemoveFrom._staticFeature) {
|
|
253
|
+
layerToRemoveFrom._removeFromFeaturesList(this._geometry);
|
|
254
|
+
}
|
|
255
|
+
layerToRemoveFrom.options.properties = null;
|
|
256
|
+
delete this._geometry;
|
|
257
|
+
if (this._getFeatureExtent)
|
|
258
|
+
delete this._getFeatureExtent;
|
|
259
|
+
}
|
|
260
|
+
addFeature(layerToAddTo) {
|
|
261
|
+
this._featureLayer = layerToAddTo;
|
|
262
|
+
if (!this.el.querySelector('map-geometry'))
|
|
263
|
+
return;
|
|
264
|
+
let fallbackCS = this._getFallbackCS();
|
|
265
|
+
this._geometry = layerToAddTo.createGeometry(this.el, fallbackCS);
|
|
266
|
+
if (!this._geometry)
|
|
267
|
+
return;
|
|
268
|
+
// createGeometry sets _groupEl on the DOM element as a side effect
|
|
269
|
+
this._groupEl = this.el._groupEl;
|
|
270
|
+
this._geometry._layerEl = this.getLayerEl();
|
|
271
|
+
layerToAddTo.addLayer(this._geometry);
|
|
272
|
+
this._setUpEvents();
|
|
273
|
+
}
|
|
274
|
+
getPrevious() {
|
|
275
|
+
if (this.isFirst()) {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
return this.el.previousElementSibling;
|
|
279
|
+
}
|
|
280
|
+
isFirst() {
|
|
281
|
+
return !this._parentEl._layerRegistry.has(this.position);
|
|
282
|
+
}
|
|
283
|
+
_createOrGetFeatureLayer() {
|
|
284
|
+
// Wait for parent layer to be ready before proceeding
|
|
285
|
+
this._parentEl
|
|
286
|
+
.whenReady()
|
|
287
|
+
.then(() => {
|
|
288
|
+
// Detect parent context and get the appropriate layer container
|
|
289
|
+
const isMapLink = this._parentEl.nodeName === 'MAP-LINK';
|
|
290
|
+
const parentLayer = isMapLink
|
|
291
|
+
? this._parentEl._templatedLayer
|
|
292
|
+
: this._parentEl._layer;
|
|
293
|
+
const parentElement = this._parentEl;
|
|
294
|
+
if (this.isFirst() && parentLayer) {
|
|
295
|
+
let map = parentElement.getMapEl()._map;
|
|
296
|
+
this._featureLayer = new ContextMenu.MapFeatureLayer(null, {
|
|
297
|
+
renderer: ContextMenu.featureRenderer(),
|
|
298
|
+
pane: parentLayer.getContainer(),
|
|
299
|
+
...(isMapLink && parentElement.getBounds()
|
|
300
|
+
? { layerBounds: parentElement.getBounds() }
|
|
301
|
+
: {}),
|
|
302
|
+
...(isMapLink ? { zoomBounds: this._getZoomBounds() } : {}),
|
|
303
|
+
...(isMapLink ? {} : { _leafletLayer: parentElement._layer }),
|
|
304
|
+
zIndex: this.position,
|
|
305
|
+
projection: map.options.projection,
|
|
306
|
+
mapEl: parentElement.getMapEl(),
|
|
307
|
+
onEachFeature: function (properties, geometry) {
|
|
308
|
+
if (properties) {
|
|
309
|
+
const popupOptions = {
|
|
310
|
+
autoClose: false,
|
|
311
|
+
autoPan: true,
|
|
312
|
+
maxHeight: map.getSize().y * 0.5 - 50,
|
|
313
|
+
maxWidth: map.getSize().x * 0.7,
|
|
314
|
+
minWidth: 165
|
|
315
|
+
};
|
|
316
|
+
var c = document.createElement('div');
|
|
317
|
+
c.classList.add('mapml-popup-content');
|
|
318
|
+
c.insertAdjacentHTML('afterbegin', properties.innerHTML);
|
|
319
|
+
geometry.bindPopup(c, popupOptions);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
ContextMenu.leafletSrcExports.extend(this._featureLayer.options, {
|
|
324
|
+
_leafletLayer: Object.assign(this._featureLayer, {
|
|
325
|
+
_layerEl: this.getLayerEl()
|
|
326
|
+
})
|
|
327
|
+
});
|
|
328
|
+
// Add this position to the parent's _layerRegistry with layer reference and count = 1
|
|
329
|
+
parentElement._layerRegistry.set(this.position, { layer: this._featureLayer, count: 1 });
|
|
330
|
+
this.addFeature(this._featureLayer);
|
|
331
|
+
// add MapFeatureLayer to appropriate parent layer
|
|
332
|
+
parentLayer.addLayer(this._featureLayer);
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
// get the previously registered FeatureLayer for this position
|
|
336
|
+
const entry = parentElement._layerRegistry.get(this.position);
|
|
337
|
+
this._featureLayer = entry?.layer;
|
|
338
|
+
if (entry) {
|
|
339
|
+
entry.count++;
|
|
340
|
+
}
|
|
341
|
+
if (this._featureLayer) {
|
|
342
|
+
this.addFeature(this._featureLayer);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
})
|
|
346
|
+
.catch((error) => {
|
|
347
|
+
console.log('Error waiting for parent layer to be ready:', error);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
_setUpEvents() {
|
|
351
|
+
['click', 'focus', 'blur', 'keyup', 'keydown'].forEach((name) => {
|
|
352
|
+
this._groupEl.addEventListener(name, (e) => {
|
|
353
|
+
if (name === 'click') {
|
|
354
|
+
let clickEv = new PointerEvent(name, { cancelable: true });
|
|
355
|
+
clickEv.originalEvent = e;
|
|
356
|
+
this.el.dispatchEvent(clickEv);
|
|
357
|
+
}
|
|
358
|
+
else if (name === 'keyup' || name === 'keydown') {
|
|
359
|
+
let keyEv = new KeyboardEvent(name, { cancelable: true });
|
|
360
|
+
keyEv.originalEvent = e;
|
|
361
|
+
this.el.dispatchEvent(keyEv);
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
let focusEv = new FocusEvent(name, { cancelable: true });
|
|
365
|
+
focusEv.originalEvent = e;
|
|
366
|
+
this.el.dispatchEvent(focusEv);
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
_getFallbackCS() {
|
|
372
|
+
let csMeta;
|
|
373
|
+
if (this._parentEl?.nodeName === 'MAP-LINK') {
|
|
374
|
+
csMeta =
|
|
375
|
+
this._parentEl.shadowRoot?.querySelector('map-meta[name=cs][content]') ||
|
|
376
|
+
this._parentEl.parentElement?.getMeta?.('cs');
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
let layerEl = this.getLayerEl();
|
|
380
|
+
csMeta = layerEl?.src
|
|
381
|
+
? layerEl.shadowRoot?.querySelector('map-meta[name=cs][content]')
|
|
382
|
+
: layerEl?.querySelector('map-meta[name=cs][content]');
|
|
383
|
+
}
|
|
384
|
+
return csMeta
|
|
385
|
+
? ContextMenu.Util._metaContentToObject(csMeta.getAttribute('content')).content
|
|
386
|
+
: 'gcrs';
|
|
387
|
+
}
|
|
388
|
+
_memoizeExtent() {
|
|
389
|
+
let extentCache;
|
|
390
|
+
return () => {
|
|
391
|
+
if (extentCache && this._getFeatureExtent) {
|
|
392
|
+
return extentCache;
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
// calculate feature extent
|
|
396
|
+
let map = this.getMapEl()._map, geometry = this.el.querySelector('map-geometry'), cs = geometry?.getAttribute('cs') || this._getFallbackCS(), zoom = this.zoomValue, shapes = geometry?.querySelectorAll('map-point, map-linestring, map-polygon, map-multipoint, map-multilinestring'), bboxExtent = [
|
|
397
|
+
Infinity,
|
|
398
|
+
Infinity,
|
|
399
|
+
Number.NEGATIVE_INFINITY,
|
|
400
|
+
Number.NEGATIVE_INFINITY
|
|
401
|
+
];
|
|
402
|
+
if (shapes) {
|
|
403
|
+
for (let shape of Array.from(shapes)) {
|
|
404
|
+
let coord = shape.querySelectorAll('map-coordinates');
|
|
405
|
+
for (let i = 0; i < coord.length; ++i) {
|
|
406
|
+
bboxExtent = this._updateExtent(shape, coord[i], bboxExtent);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
let topLeft = ContextMenu.leafletSrcExports.point(bboxExtent[0], bboxExtent[1]);
|
|
411
|
+
let bottomRight = ContextMenu.leafletSrcExports.point(bboxExtent[2], bboxExtent[3]);
|
|
412
|
+
let pcrsBound = ContextMenu.Util.boundsToPCRSBounds(ContextMenu.leafletSrcExports.bounds(topLeft, bottomRight), zoom, map.options.projection, cs);
|
|
413
|
+
if (shapes?.length === 1 &&
|
|
414
|
+
shapes[0].tagName.toUpperCase() === 'MAP-POINT') {
|
|
415
|
+
let projection = map.options.projection, maxZoom = this.el.hasAttribute('max')
|
|
416
|
+
? +this.el.getAttribute('max')
|
|
417
|
+
: M[projection].options.resolutions.length - 1, tileCenter = M[projection].options.crs.tile.bounds.getCenter(), pixel = M[projection].transformation.transform(pcrsBound.min, M[projection].scale(+this.zoomValue || maxZoom));
|
|
418
|
+
pcrsBound = ContextMenu.Util.pixelToPCRSBounds(ContextMenu.leafletSrcExports.bounds(pixel.subtract(tileCenter), pixel.add(tileCenter)), this.zoomValue || maxZoom, projection);
|
|
419
|
+
}
|
|
420
|
+
let result = Object.assign(ContextMenu.Util._convertAndFormatPCRS(pcrsBound, map.options.crs, map.options.projection), { zoom: this._getZoomBounds() });
|
|
421
|
+
extentCache = result;
|
|
422
|
+
return result;
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
_updateExtent(shape, coord, bboxExtent) {
|
|
427
|
+
let data = coord.innerHTML
|
|
428
|
+
.trim()
|
|
429
|
+
.replace(/<[^>]+>/g, '')
|
|
430
|
+
.replace(/\s+/g, ' ')
|
|
431
|
+
.split(/[<>\ ]/g);
|
|
432
|
+
switch (shape.tagName.toUpperCase()) {
|
|
433
|
+
case 'MAP-POINT':
|
|
434
|
+
bboxExtent = ContextMenu.Util._updateExtent(bboxExtent, +data[0], +data[1]);
|
|
435
|
+
break;
|
|
436
|
+
case 'MAP-LINESTRING':
|
|
437
|
+
case 'MAP-POLYGON':
|
|
438
|
+
case 'MAP-MULTIPOINT':
|
|
439
|
+
case 'MAP-MULTILINESTRING':
|
|
440
|
+
for (let i = 0; i < data.length; i += 2) {
|
|
441
|
+
bboxExtent = ContextMenu.Util._updateExtent(bboxExtent, +data[i], +data[i + 1]);
|
|
442
|
+
}
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
445
|
+
return bboxExtent;
|
|
446
|
+
}
|
|
447
|
+
_getZoomBounds() {
|
|
448
|
+
return {
|
|
449
|
+
minZoom: this.minValue,
|
|
450
|
+
maxZoom: this.maxValue,
|
|
451
|
+
minNativeZoom: this.zoomValue,
|
|
452
|
+
maxNativeZoom: this.zoomValue
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
getZoomToZoom() {
|
|
456
|
+
let tL = this.extent.topLeft.pcrs, bR = this.extent.bottomRight.pcrs, bound = ContextMenu.leafletSrcExports.bounds(ContextMenu.leafletSrcExports.point(tL.horizontal, tL.vertical), ContextMenu.leafletSrcExports.point(bR.horizontal, bR.vertical));
|
|
457
|
+
let projection = this.getMapEl()._map.options.projection, layerZoomBounds = this.getLayerEl().extent.zoom, minZoom = layerZoomBounds.minZoom ? layerZoomBounds.minZoom : 0, maxZoom = layerZoomBounds.maxZoom
|
|
458
|
+
? layerZoomBounds.maxZoom
|
|
459
|
+
: M[projection].options.resolutions.length - 1;
|
|
460
|
+
let newZoom;
|
|
461
|
+
if (this.el.hasAttribute('zoom')) {
|
|
462
|
+
newZoom = this.zoomValue;
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
newZoom = ContextMenu.Util.getMaxZoom(bound, this.getMapEl()._map, minZoom, maxZoom);
|
|
466
|
+
if (this.maxValue < newZoom) {
|
|
467
|
+
newZoom = this.maxValue;
|
|
468
|
+
}
|
|
469
|
+
else if (this.minValue > newZoom) {
|
|
470
|
+
newZoom = this.minValue;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
if (newZoom < minZoom) {
|
|
474
|
+
newZoom = minZoom;
|
|
475
|
+
}
|
|
476
|
+
else if (newZoom > maxZoom) {
|
|
477
|
+
newZoom = maxZoom;
|
|
478
|
+
}
|
|
479
|
+
return newZoom;
|
|
480
|
+
}
|
|
481
|
+
getMeta(metaName) {
|
|
482
|
+
let name = metaName.toLowerCase();
|
|
483
|
+
if (name !== 'cs' && name !== 'zoom' && name !== 'projection')
|
|
484
|
+
return null;
|
|
485
|
+
let sdMeta = this._parentEl?.shadowRoot?.querySelector(`map-meta[name=${name}][content]`);
|
|
486
|
+
if (this._parentEl?.nodeName === 'MAP-LINK') {
|
|
487
|
+
return sdMeta || this._parentEl.parentElement?.getMeta?.(metaName);
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
return this._parentEl?.src
|
|
491
|
+
? this._parentEl.shadowRoot?.querySelector(`map-meta[name=${name}][content]`)
|
|
492
|
+
: this._parentEl?.querySelector(`map-meta[name=${name}][content]`);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
mapml2geojson(options) {
|
|
496
|
+
let defaults = {
|
|
497
|
+
propertyFunction: null,
|
|
498
|
+
transform: true
|
|
499
|
+
};
|
|
500
|
+
options = Object.assign({}, defaults, options);
|
|
501
|
+
let json = {
|
|
502
|
+
type: 'Feature',
|
|
503
|
+
properties: {},
|
|
504
|
+
geometry: {}
|
|
505
|
+
};
|
|
506
|
+
let el = this.el.querySelector('map-properties');
|
|
507
|
+
if (!el) {
|
|
508
|
+
json.properties = null;
|
|
509
|
+
}
|
|
510
|
+
else if (typeof options.propertyFunction === 'function') {
|
|
511
|
+
json.properties = options.propertyFunction(el);
|
|
512
|
+
}
|
|
513
|
+
else if (el.querySelector('table')) {
|
|
514
|
+
let table = el.querySelector('table').cloneNode(true);
|
|
515
|
+
json.properties = ContextMenu.Util._table2properties(table);
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
json.properties = {
|
|
519
|
+
prop0: el.innerHTML.replace(/(<([^>]+)>)/gi, '').replace(/\s/g, '')
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
let source = null, dest = null, map = this.getMapEl()._map;
|
|
523
|
+
if (options.transform) {
|
|
524
|
+
source = new ContextMenu.proj4.Proj(map.options.crs.code);
|
|
525
|
+
dest = new ContextMenu.proj4.Proj('EPSG:4326');
|
|
526
|
+
if (map.options.crs.code === 'EPSG:3857' ||
|
|
527
|
+
map.options.crs.code === 'EPSG:4326') {
|
|
528
|
+
options.transform = false;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
let collection = this.el.querySelector('map-geometry')?.querySelector('map-geometrycollection'), shapes = this.el.querySelector('map-geometry')?.querySelectorAll('map-point, map-polygon, map-linestring, map-multipoint, map-multipolygon, map-multilinestring');
|
|
532
|
+
if (collection) {
|
|
533
|
+
json.geometry.type = 'GeometryCollection';
|
|
534
|
+
json.geometry.geometries = [];
|
|
535
|
+
if (shapes) {
|
|
536
|
+
for (let shape of Array.from(shapes)) {
|
|
537
|
+
json.geometry.geometries.push(ContextMenu.Util._geometry2geojson(shape, source, dest, options.transform));
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
else if (shapes && shapes.length > 0) {
|
|
542
|
+
json.geometry = ContextMenu.Util._geometry2geojson(shapes[0], source, dest, options.transform);
|
|
543
|
+
}
|
|
544
|
+
return json;
|
|
545
|
+
}
|
|
546
|
+
click() {
|
|
547
|
+
let g = this._groupEl, rect = g.getBoundingClientRect();
|
|
548
|
+
let event = new MouseEvent('click', {
|
|
549
|
+
clientX: rect.x + rect.width / 2,
|
|
550
|
+
clientY: rect.y + rect.height / 2,
|
|
551
|
+
button: 0
|
|
552
|
+
});
|
|
553
|
+
let properties = this.el.querySelector('map-properties');
|
|
554
|
+
if (g.getAttribute('role') === 'link') {
|
|
555
|
+
for (let path of g.children) {
|
|
556
|
+
path.mousedown?.call(this._geometry, event);
|
|
557
|
+
path.mouseup?.call(this._geometry, event);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
let clickEv = new PointerEvent('click', { cancelable: true });
|
|
561
|
+
clickEv.originalEvent = event;
|
|
562
|
+
this.el.dispatchEvent(clickEv);
|
|
563
|
+
if (properties && this.el.isConnected) {
|
|
564
|
+
let geometry = this._geometry, shapes = geometry._layers;
|
|
565
|
+
for (let id in shapes) {
|
|
566
|
+
if (shapes[id].isPopupOpen()) {
|
|
567
|
+
shapes[id].closePopup();
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
if (geometry.isPopupOpen()) {
|
|
571
|
+
geometry.closePopup();
|
|
572
|
+
}
|
|
573
|
+
else if (!clickEv.originalEvent.cancelBubble) {
|
|
574
|
+
geometry.openPopup();
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
focus(options) {
|
|
579
|
+
this._groupEl?.focus(options);
|
|
580
|
+
}
|
|
581
|
+
blur() {
|
|
582
|
+
if (document.activeElement?.shadowRoot?.activeElement === this._groupEl ||
|
|
583
|
+
document.activeElement?.shadowRoot?.activeElement?.parentNode ===
|
|
584
|
+
this._groupEl) {
|
|
585
|
+
this._groupEl.blur();
|
|
586
|
+
this.getMapEl()?._map?.getContainer().focus();
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
zoomTo() {
|
|
590
|
+
let extent = this.extent, map = this.getMapEl()._map;
|
|
591
|
+
let tL = extent.topLeft.pcrs, bR = extent.bottomRight.pcrs, bound = ContextMenu.leafletSrcExports.bounds(ContextMenu.leafletSrcExports.point(tL.horizontal, tL.vertical), ContextMenu.leafletSrcExports.point(bR.horizontal, bR.vertical)), center = map.options.crs.unproject(bound.getCenter(true));
|
|
592
|
+
map.setView(center, this.getZoomToZoom(), { animate: false });
|
|
593
|
+
}
|
|
594
|
+
async whenReady() {
|
|
595
|
+
return new Promise((resolve, reject) => {
|
|
596
|
+
let interval, failureTimer;
|
|
597
|
+
// Check if addFeature has been published (indicating connectedCallback completed)
|
|
598
|
+
if (this.el.addFeature) {
|
|
599
|
+
resolve();
|
|
600
|
+
}
|
|
601
|
+
else {
|
|
602
|
+
let featureElement = this.el;
|
|
603
|
+
interval = setInterval(testForFeature, 200, featureElement);
|
|
604
|
+
failureTimer = setTimeout(featureNotDefined, 5000);
|
|
605
|
+
}
|
|
606
|
+
function testForFeature(featureElement) {
|
|
607
|
+
if (featureElement.addFeature) {
|
|
608
|
+
clearInterval(interval);
|
|
609
|
+
clearTimeout(failureTimer);
|
|
610
|
+
resolve();
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
function featureNotDefined() {
|
|
614
|
+
clearInterval(interval);
|
|
615
|
+
clearTimeout(failureTimer);
|
|
616
|
+
reject('Timeout reached waiting for feature to be ready');
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
render() {
|
|
621
|
+
return null;
|
|
622
|
+
}
|
|
623
|
+
static get watchers() { return {
|
|
624
|
+
"zoom": [{
|
|
625
|
+
"zoomChanged": 0
|
|
626
|
+
}],
|
|
627
|
+
"min": [{
|
|
628
|
+
"minChanged": 0
|
|
629
|
+
}],
|
|
630
|
+
"max": [{
|
|
631
|
+
"maxChanged": 0
|
|
632
|
+
}]
|
|
633
|
+
}; }
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
exports.map_feature = MapFeature;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ContextMenu = require('./index-CW_WOSnc.js');
|
|
4
|
+
|
|
5
|
+
const MapFeaturecaption = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
ContextMenu.registerInstance(this, hostRef);
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.map_featurecaption = MapFeaturecaption;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ContextMenu = require('./index-CW_WOSnc.js');
|
|
4
|
+
|
|
5
|
+
const MapGeometry = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
ContextMenu.registerInstance(this, hostRef);
|
|
8
|
+
}
|
|
9
|
+
get el() { return ContextMenu.getElement(this); }
|
|
10
|
+
cs;
|
|
11
|
+
csChanged(newValue, oldValue) {
|
|
12
|
+
}
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
// Publish cs getter/setter on element for MapML compatibility
|
|
15
|
+
Object.defineProperty(this.el, 'cs', {
|
|
16
|
+
get: () => this.el.getAttribute('cs'),
|
|
17
|
+
set: (val) => {
|
|
18
|
+
if (['tcrs', 'tilematrix', 'pcrs', 'gcrs', 'map', 'tile'].includes(val)) {
|
|
19
|
+
this.cs = val;
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
configurable: true,
|
|
23
|
+
enumerable: true
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
return ContextMenu.h("slot", { key: '419b5956ada9cc1d59880ed9168b1d539301ff85' });
|
|
28
|
+
}
|
|
29
|
+
static get watchers() { return {
|
|
30
|
+
"cs": [{
|
|
31
|
+
"csChanged": 0
|
|
32
|
+
}]
|
|
33
|
+
}; }
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.map_geometry = MapGeometry;
|