@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,370 @@
|
|
|
1
|
+
import { Util } from "../utils/mapml/Util.js";
|
|
2
|
+
import { mapTileLayer } from "../utils/mapml/layers/MapTileLayer.js";
|
|
3
|
+
import { calculatePosition } from "../utils/mapml/elementSupport/layers/calculatePosition.js";
|
|
4
|
+
export class MapTile {
|
|
5
|
+
el;
|
|
6
|
+
// "Set once" properties - these are set once at connection and never change
|
|
7
|
+
row;
|
|
8
|
+
col;
|
|
9
|
+
zoom;
|
|
10
|
+
src;
|
|
11
|
+
_parentEl;
|
|
12
|
+
_tileLayer;
|
|
13
|
+
_extent;
|
|
14
|
+
// Store initial values to prevent changes after connection
|
|
15
|
+
_initialRow;
|
|
16
|
+
_initialCol;
|
|
17
|
+
_initialZoom;
|
|
18
|
+
_hasConnected = false;
|
|
19
|
+
srcChanged(newValue, oldValue) {
|
|
20
|
+
if (oldValue !== newValue) {
|
|
21
|
+
if (this._extent)
|
|
22
|
+
this._calculateExtent();
|
|
23
|
+
if (this._tileLayer) {
|
|
24
|
+
this._tileLayer.removeMapTile(this.el);
|
|
25
|
+
this._tileLayer.addMapTile(this.el);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
// Capture initial values before anything else - these won't change
|
|
31
|
+
// Read from attributes first, then fall back to props
|
|
32
|
+
this._initialRow = this.el.hasAttribute('row') ? +this.el.getAttribute('row') : (this.row ?? 0);
|
|
33
|
+
this._initialCol = this.el.hasAttribute('col') ? +this.el.getAttribute('col') : (this.col ?? 0);
|
|
34
|
+
// For zoom, check: explicit attribute -> prop -> map-meta value -> map zoom -> 0
|
|
35
|
+
let zoomValue = 0;
|
|
36
|
+
if (this.el.hasAttribute('zoom')) {
|
|
37
|
+
zoomValue = +this.el.getAttribute('zoom');
|
|
38
|
+
}
|
|
39
|
+
else if (this.zoom !== undefined) {
|
|
40
|
+
zoomValue = this.zoom;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// Try to get zoom from map-meta element
|
|
44
|
+
const metaZoom = this._getMetaZoomValue();
|
|
45
|
+
if (metaZoom !== null) {
|
|
46
|
+
zoomValue = metaZoom;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
zoomValue = this.getMapEl()?.zoom || 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
this._initialZoom = zoomValue;
|
|
53
|
+
this._hasConnected = true;
|
|
54
|
+
// Override getAttribute/setAttribute on the element to prevent row/col/zoom changes
|
|
55
|
+
const originalGetAttribute = this.el.getAttribute.bind(this.el);
|
|
56
|
+
const originalSetAttribute = this.el.setAttribute.bind(this.el);
|
|
57
|
+
this.el.getAttribute = (name) => {
|
|
58
|
+
if (this._hasConnected) {
|
|
59
|
+
switch (name) {
|
|
60
|
+
case 'row':
|
|
61
|
+
return String(this._initialRow);
|
|
62
|
+
case 'col':
|
|
63
|
+
return String(this._initialCol);
|
|
64
|
+
case 'zoom':
|
|
65
|
+
return String(this._initialZoom);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return originalGetAttribute(name);
|
|
69
|
+
};
|
|
70
|
+
this.el.setAttribute = (name, value) => {
|
|
71
|
+
if (this._hasConnected) {
|
|
72
|
+
switch (name) {
|
|
73
|
+
case 'row':
|
|
74
|
+
case 'col':
|
|
75
|
+
case 'zoom':
|
|
76
|
+
return; // Ignore changes to these after connection
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
originalSetAttribute(name, value);
|
|
80
|
+
};
|
|
81
|
+
// Override property accessors on the element to return initial values
|
|
82
|
+
Object.defineProperties(this.el, {
|
|
83
|
+
row: {
|
|
84
|
+
get: () => this._initialRow,
|
|
85
|
+
configurable: true
|
|
86
|
+
},
|
|
87
|
+
col: {
|
|
88
|
+
get: () => this._initialCol,
|
|
89
|
+
configurable: true
|
|
90
|
+
},
|
|
91
|
+
zoom: {
|
|
92
|
+
get: () => this._initialZoom,
|
|
93
|
+
configurable: true
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
// Find parent element (handle shadow DOM)
|
|
97
|
+
const parentNode = this.el.parentNode;
|
|
98
|
+
this._parentEl =
|
|
99
|
+
parentNode.nodeName === 'MAP-LAYER' ||
|
|
100
|
+
parentNode.nodeName === 'LAYER-' ||
|
|
101
|
+
parentNode.nodeName === 'MAP-LINK'
|
|
102
|
+
? parentNode
|
|
103
|
+
: parentNode.host;
|
|
104
|
+
// Preload image
|
|
105
|
+
const imgObj = new Image();
|
|
106
|
+
imgObj.src = this.src || '';
|
|
107
|
+
this._createOrGetTileLayer();
|
|
108
|
+
}
|
|
109
|
+
disconnectedCallback() {
|
|
110
|
+
if (this._tileLayer) {
|
|
111
|
+
this._tileLayer.removeMapTile(this.el);
|
|
112
|
+
if (this._tileLayer._mapTiles && this._tileLayer._mapTiles.length === 0) {
|
|
113
|
+
this._tileLayer.remove();
|
|
114
|
+
this._tileLayer = null;
|
|
115
|
+
delete this._tileLayer;
|
|
116
|
+
const entry = this?._parentEl?._layerRegistry?.get(this.position);
|
|
117
|
+
if (entry) {
|
|
118
|
+
entry.count--;
|
|
119
|
+
if (entry.count === 0) {
|
|
120
|
+
this._parentEl._layerRegistry.delete(this.position);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// "Set once" property pattern for row, col, zoom
|
|
127
|
+
// After connection, always return the initial values
|
|
128
|
+
get rowValue() {
|
|
129
|
+
return this._hasConnected ? this._initialRow : +this.row;
|
|
130
|
+
}
|
|
131
|
+
get colValue() {
|
|
132
|
+
return this._hasConnected ? this._initialCol : +this.col;
|
|
133
|
+
}
|
|
134
|
+
get zoomValue() {
|
|
135
|
+
return this._hasConnected ? this._initialZoom : +this.zoom;
|
|
136
|
+
}
|
|
137
|
+
get extent() {
|
|
138
|
+
if (!this._extent)
|
|
139
|
+
this._calculateExtent();
|
|
140
|
+
return this._extent;
|
|
141
|
+
}
|
|
142
|
+
get position() {
|
|
143
|
+
return calculatePosition(this.el);
|
|
144
|
+
}
|
|
145
|
+
isFirst() {
|
|
146
|
+
return !this._parentEl._layerRegistry.has(this.position);
|
|
147
|
+
}
|
|
148
|
+
getPrevious() {
|
|
149
|
+
if (this.isFirst())
|
|
150
|
+
return null;
|
|
151
|
+
return this.el.previousElementSibling;
|
|
152
|
+
}
|
|
153
|
+
async zoomTo() {
|
|
154
|
+
const extent = this.extent;
|
|
155
|
+
const map = this.getMapEl()?._map;
|
|
156
|
+
if (!extent || !map)
|
|
157
|
+
return;
|
|
158
|
+
const xmin = extent.topLeft.pcrs.horizontal, xmax = extent.bottomRight.pcrs.horizontal, ymin = extent.bottomRight.pcrs.vertical, ymax = extent.topLeft.pcrs.vertical, bounds = window.L.bounds(window.L.point(xmin, ymin), window.L.point(xmax, ymax)), center = map.options.crs.unproject(bounds.getCenter(true)), maxZoom = extent.zoom.maxZoom, minZoom = extent.zoom.minZoom;
|
|
159
|
+
map.setView(center, Util.getMaxZoom(bounds, map, minZoom, maxZoom), { animate: false });
|
|
160
|
+
}
|
|
161
|
+
getMapEl() {
|
|
162
|
+
return Util.getClosest(this.el, 'gcds-ext-map');
|
|
163
|
+
}
|
|
164
|
+
getLayerEl() {
|
|
165
|
+
return Util.getClosest(this.el, 'map-layer,layer-');
|
|
166
|
+
}
|
|
167
|
+
_getMetaZoomValue() {
|
|
168
|
+
// Look for <map-meta name="zoom" content="...value=N..."> in parent layer
|
|
169
|
+
const layerEl = this.getLayerEl();
|
|
170
|
+
if (!layerEl)
|
|
171
|
+
return null;
|
|
172
|
+
const metaZoom = layerEl.querySelector('map-meta[name="zoom"][content]');
|
|
173
|
+
if (!metaZoom)
|
|
174
|
+
return null;
|
|
175
|
+
const content = metaZoom.getAttribute('content');
|
|
176
|
+
if (!content)
|
|
177
|
+
return null;
|
|
178
|
+
// Parse content like "min=1,max=4,value=2"
|
|
179
|
+
const valueMatch = content.match(/value=(\d+)/);
|
|
180
|
+
if (valueMatch && valueMatch[1]) {
|
|
181
|
+
return parseInt(valueMatch[1], 10);
|
|
182
|
+
}
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
getMeta(metaName) {
|
|
186
|
+
const name = metaName.toLowerCase();
|
|
187
|
+
if (name !== 'cs' && name !== 'zoom' && name !== 'projection')
|
|
188
|
+
return;
|
|
189
|
+
const sdMeta = this._parentEl?.shadowRoot?.querySelector(`map-meta[name=${name}][content]`);
|
|
190
|
+
if (this._parentEl?.nodeName === 'MAP-LINK') {
|
|
191
|
+
return sdMeta || this._parentEl.parentElement?.getMeta(metaName);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
return this._parentEl?.src
|
|
195
|
+
? this._parentEl.shadowRoot?.querySelector(`map-meta[name=${name}][content]`)
|
|
196
|
+
: this._parentEl.querySelector(`map-meta[name=${name}][content]`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
async _createOrGetTileLayer() {
|
|
200
|
+
if (!this._parentEl?.whenReady)
|
|
201
|
+
return;
|
|
202
|
+
await this._parentEl.whenReady();
|
|
203
|
+
const parentElement = this._parentEl;
|
|
204
|
+
if (this.isFirst()) {
|
|
205
|
+
this._tileLayer = mapTileLayer({
|
|
206
|
+
projection: this.getMapEl()?.projection,
|
|
207
|
+
opacity: 1,
|
|
208
|
+
pane: parentElement._templatedLayer?.getContainer?.() ||
|
|
209
|
+
parentElement._layer?.getContainer?.(),
|
|
210
|
+
zIndex: this.position
|
|
211
|
+
});
|
|
212
|
+
this._tileLayer.addMapTile(this.el);
|
|
213
|
+
if (parentElement._templatedLayer?.addLayer) {
|
|
214
|
+
parentElement._templatedLayer.addLayer(this._tileLayer);
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
parentElement._layer?.addLayer?.(this._tileLayer);
|
|
218
|
+
}
|
|
219
|
+
// Publish _tileLayer on the element for test access
|
|
220
|
+
this.el._tileLayer = this._tileLayer;
|
|
221
|
+
// Add this position to the parent's _layerRegistry with layer reference and count = 1
|
|
222
|
+
parentElement._layerRegistry.set(this.position, { layer: this._tileLayer, count: 1 });
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
// get the previously registered TileLayer for this position
|
|
226
|
+
const entry = parentElement._layerRegistry.get(this.position);
|
|
227
|
+
this._tileLayer = entry?.layer;
|
|
228
|
+
if (entry) {
|
|
229
|
+
entry.count++;
|
|
230
|
+
}
|
|
231
|
+
if (this._tileLayer) {
|
|
232
|
+
this._tileLayer.addMapTile(this.el);
|
|
233
|
+
// Publish _tileLayer on the element for test access
|
|
234
|
+
this.el._tileLayer = this._tileLayer;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
_calculateExtent() {
|
|
239
|
+
const mapEl = this.getMapEl();
|
|
240
|
+
if (!mapEl || !mapEl._map)
|
|
241
|
+
return;
|
|
242
|
+
const map = mapEl._map;
|
|
243
|
+
const projection = map.options.projection;
|
|
244
|
+
const tileSize = window.M[projection].options.crs.tile.bounds.max.x;
|
|
245
|
+
const pixelX = this.colValue * tileSize;
|
|
246
|
+
const pixelY = this.rowValue * tileSize;
|
|
247
|
+
const pixelBounds = window.L.bounds(window.L.point(pixelX, pixelY), window.L.point(pixelX + tileSize, pixelY + tileSize));
|
|
248
|
+
const pcrsBounds = Util.pixelToPCRSBounds(pixelBounds, this.zoomValue, projection);
|
|
249
|
+
this._extent = Util._convertAndFormatPCRS(pcrsBounds, map.options.crs, projection);
|
|
250
|
+
this._extent.zoom = {
|
|
251
|
+
minZoom: this.zoomValue,
|
|
252
|
+
maxZoom: this.zoomValue,
|
|
253
|
+
minNativeZoom: this.zoomValue,
|
|
254
|
+
maxNativeZoom: this.zoomValue
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
render() {
|
|
258
|
+
// This component does not render any visible DOM
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
static get is() { return "map-tile"; }
|
|
262
|
+
static get properties() {
|
|
263
|
+
return {
|
|
264
|
+
"row": {
|
|
265
|
+
"type": "number",
|
|
266
|
+
"mutable": false,
|
|
267
|
+
"complexType": {
|
|
268
|
+
"original": "number",
|
|
269
|
+
"resolved": "number",
|
|
270
|
+
"references": {}
|
|
271
|
+
},
|
|
272
|
+
"required": false,
|
|
273
|
+
"optional": true,
|
|
274
|
+
"docs": {
|
|
275
|
+
"tags": [],
|
|
276
|
+
"text": ""
|
|
277
|
+
},
|
|
278
|
+
"getter": false,
|
|
279
|
+
"setter": false,
|
|
280
|
+
"reflect": true,
|
|
281
|
+
"attribute": "row"
|
|
282
|
+
},
|
|
283
|
+
"col": {
|
|
284
|
+
"type": "number",
|
|
285
|
+
"mutable": false,
|
|
286
|
+
"complexType": {
|
|
287
|
+
"original": "number",
|
|
288
|
+
"resolved": "number",
|
|
289
|
+
"references": {}
|
|
290
|
+
},
|
|
291
|
+
"required": false,
|
|
292
|
+
"optional": true,
|
|
293
|
+
"docs": {
|
|
294
|
+
"tags": [],
|
|
295
|
+
"text": ""
|
|
296
|
+
},
|
|
297
|
+
"getter": false,
|
|
298
|
+
"setter": false,
|
|
299
|
+
"reflect": true,
|
|
300
|
+
"attribute": "col"
|
|
301
|
+
},
|
|
302
|
+
"zoom": {
|
|
303
|
+
"type": "number",
|
|
304
|
+
"mutable": false,
|
|
305
|
+
"complexType": {
|
|
306
|
+
"original": "number",
|
|
307
|
+
"resolved": "number",
|
|
308
|
+
"references": {}
|
|
309
|
+
},
|
|
310
|
+
"required": false,
|
|
311
|
+
"optional": true,
|
|
312
|
+
"docs": {
|
|
313
|
+
"tags": [],
|
|
314
|
+
"text": ""
|
|
315
|
+
},
|
|
316
|
+
"getter": false,
|
|
317
|
+
"setter": false,
|
|
318
|
+
"reflect": true,
|
|
319
|
+
"attribute": "zoom"
|
|
320
|
+
},
|
|
321
|
+
"src": {
|
|
322
|
+
"type": "string",
|
|
323
|
+
"mutable": false,
|
|
324
|
+
"complexType": {
|
|
325
|
+
"original": "string",
|
|
326
|
+
"resolved": "string",
|
|
327
|
+
"references": {}
|
|
328
|
+
},
|
|
329
|
+
"required": false,
|
|
330
|
+
"optional": true,
|
|
331
|
+
"docs": {
|
|
332
|
+
"tags": [],
|
|
333
|
+
"text": ""
|
|
334
|
+
},
|
|
335
|
+
"getter": false,
|
|
336
|
+
"setter": false,
|
|
337
|
+
"reflect": true,
|
|
338
|
+
"attribute": "src"
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
static get methods() {
|
|
343
|
+
return {
|
|
344
|
+
"zoomTo": {
|
|
345
|
+
"complexType": {
|
|
346
|
+
"signature": "() => Promise<void>",
|
|
347
|
+
"parameters": [],
|
|
348
|
+
"references": {
|
|
349
|
+
"Promise": {
|
|
350
|
+
"location": "global",
|
|
351
|
+
"id": "global::Promise"
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
"return": "Promise<void>"
|
|
355
|
+
},
|
|
356
|
+
"docs": {
|
|
357
|
+
"text": "",
|
|
358
|
+
"tags": []
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
static get elementRef() { return "el"; }
|
|
364
|
+
static get watchers() {
|
|
365
|
+
return [{
|
|
366
|
+
"propName": "src",
|
|
367
|
+
"methodName": "srcChanged"
|
|
368
|
+
}];
|
|
369
|
+
}
|
|
370
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// Export the class directly as DOMTokenList for easy use
|
|
2
|
+
export class CustomDOMTokenList {
|
|
3
|
+
// Private properties using TypeScript private fields
|
|
4
|
+
element;
|
|
5
|
+
valueSet;
|
|
6
|
+
attribute;
|
|
7
|
+
domain;
|
|
8
|
+
domtokenlist;
|
|
9
|
+
constructor(initialValue, element, attribute, domain) {
|
|
10
|
+
// create donor/host div to extract DomTokenList from
|
|
11
|
+
const hostingElement = document.createElement('div');
|
|
12
|
+
this.domtokenlist = hostingElement.classList;
|
|
13
|
+
// to check if value is being set, protects from infinite recursion
|
|
14
|
+
// from attributeChangedCallback of mapml-viewer and web-map
|
|
15
|
+
this.valueSet = false;
|
|
16
|
+
this.domtokenlist.value = initialValue ?? '';
|
|
17
|
+
this.element = element;
|
|
18
|
+
this.attribute = attribute;
|
|
19
|
+
this.domain = domain;
|
|
20
|
+
}
|
|
21
|
+
get isValueSet() {
|
|
22
|
+
return this.valueSet;
|
|
23
|
+
}
|
|
24
|
+
get length() {
|
|
25
|
+
return this.domtokenlist.length;
|
|
26
|
+
}
|
|
27
|
+
get value() {
|
|
28
|
+
return this.domtokenlist.value;
|
|
29
|
+
}
|
|
30
|
+
set value(val) {
|
|
31
|
+
if (val === null) {
|
|
32
|
+
// when attribute is being removed
|
|
33
|
+
this.domtokenlist.value = '';
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.domtokenlist.value = val.toLowerCase();
|
|
37
|
+
this.valueSet = true;
|
|
38
|
+
this.element.setAttribute(this.attribute, this.domtokenlist.value);
|
|
39
|
+
this.valueSet = false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
item(index) {
|
|
43
|
+
return this.domtokenlist.item(index);
|
|
44
|
+
}
|
|
45
|
+
contains(token) {
|
|
46
|
+
return this.domtokenlist.contains(token);
|
|
47
|
+
}
|
|
48
|
+
// Modified default behavior
|
|
49
|
+
add(token) {
|
|
50
|
+
this.domtokenlist.add(token);
|
|
51
|
+
this.element.setAttribute(this.attribute, this.domtokenlist.value);
|
|
52
|
+
}
|
|
53
|
+
// Modified default behavior
|
|
54
|
+
remove(token) {
|
|
55
|
+
this.domtokenlist.remove(token);
|
|
56
|
+
this.element.setAttribute(this.attribute, this.domtokenlist.value);
|
|
57
|
+
}
|
|
58
|
+
// Modified default behavior
|
|
59
|
+
replace(oldToken, newToken) {
|
|
60
|
+
const result = this.domtokenlist.replace(oldToken, newToken);
|
|
61
|
+
this.element.setAttribute(this.attribute, this.domtokenlist.value);
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
// Modified default behavior
|
|
65
|
+
supports(token) {
|
|
66
|
+
return this.domain.includes(token);
|
|
67
|
+
}
|
|
68
|
+
// Modified default behavior
|
|
69
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/toggle
|
|
70
|
+
toggle(token, force) {
|
|
71
|
+
const result = this.domtokenlist.toggle(token, force);
|
|
72
|
+
this.element.setAttribute(this.attribute, this.domtokenlist.value);
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
entries() {
|
|
76
|
+
const tokenList = this.domtokenlist;
|
|
77
|
+
return tokenList.entries ? tokenList.entries() : this._manualEntries();
|
|
78
|
+
}
|
|
79
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/forEach
|
|
80
|
+
forEach(callback, thisArg) {
|
|
81
|
+
if (this.domtokenlist.forEach) {
|
|
82
|
+
this.domtokenlist.forEach((value, key) => callback.call(thisArg, value, key, this));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
for (let i = 0; i < this.domtokenlist.length; i++) {
|
|
86
|
+
callback.call(thisArg, this.domtokenlist[i], i, this);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/keys
|
|
91
|
+
keys() {
|
|
92
|
+
const tokenList = this.domtokenlist;
|
|
93
|
+
return tokenList.keys ? tokenList.keys() : this._manualKeys();
|
|
94
|
+
}
|
|
95
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/values
|
|
96
|
+
values() {
|
|
97
|
+
const tokenList = this.domtokenlist;
|
|
98
|
+
return tokenList.values ? tokenList.values() : this._manualValues();
|
|
99
|
+
}
|
|
100
|
+
// Make it iterable
|
|
101
|
+
[Symbol.iterator]() {
|
|
102
|
+
return this.values();
|
|
103
|
+
}
|
|
104
|
+
// Fallback implementations for older browsers
|
|
105
|
+
*_manualEntries() {
|
|
106
|
+
for (let i = 0; i < this.domtokenlist.length; i++) {
|
|
107
|
+
yield [i, this.domtokenlist[i]];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
*_manualKeys() {
|
|
111
|
+
for (let i = 0; i < this.domtokenlist.length; i++) {
|
|
112
|
+
yield i;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
*_manualValues() {
|
|
116
|
+
for (let i = 0; i < this.domtokenlist.length; i++) {
|
|
117
|
+
yield this.domtokenlist[i];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Export for easier import
|
|
122
|
+
export { CustomDOMTokenList as DOMTokenList };
|
|
123
|
+
export default CustomDOMTokenList;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { locale, localeFr } from '../../../generated/locale.js';
|
|
2
|
+
|
|
3
|
+
export var Options = {
|
|
4
|
+
featureIndexOverlayOption: false,
|
|
5
|
+
announceMovement: false,
|
|
6
|
+
announceScale: { metric: true, imperial: false },
|
|
7
|
+
defaultExtCoor: 'pcrs',
|
|
8
|
+
defaultLocCoor: 'gcrs',
|
|
9
|
+
locale,
|
|
10
|
+
localeFr
|
|
11
|
+
};
|