@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
package/dist/collection/components/utils/mapml/elementSupport/extents/createLayerControlForExtent.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { DomUtil, SVG, DomEvent, stamp } from 'leaflet';
|
|
2
|
+
import { Util } from '../../Util.js';
|
|
3
|
+
|
|
4
|
+
export var createLayerControlExtentHTML = function () {
|
|
5
|
+
var extent = DomUtil.create('fieldset', 'mapml-layer-extent'),
|
|
6
|
+
extentProperties = DomUtil.create(
|
|
7
|
+
'div',
|
|
8
|
+
'mapml-layer-item-properties',
|
|
9
|
+
extent
|
|
10
|
+
),
|
|
11
|
+
extentSettings = DomUtil.create('div', 'mapml-layer-item-settings', extent),
|
|
12
|
+
extentLabel = DomUtil.create(
|
|
13
|
+
'label',
|
|
14
|
+
'mapml-layer-item-toggle',
|
|
15
|
+
extentProperties
|
|
16
|
+
),
|
|
17
|
+
input = DomUtil.create('input'),
|
|
18
|
+
svgExtentControlIcon = SVG.create('svg'),
|
|
19
|
+
extentControlPath1 = SVG.create('path'),
|
|
20
|
+
extentControlPath2 = SVG.create('path'),
|
|
21
|
+
extentNameIcon = DomUtil.create('span'),
|
|
22
|
+
extentItemControls = DomUtil.create(
|
|
23
|
+
'div',
|
|
24
|
+
'mapml-layer-item-controls',
|
|
25
|
+
extentProperties
|
|
26
|
+
),
|
|
27
|
+
opacityControl = DomUtil.create(
|
|
28
|
+
'details',
|
|
29
|
+
'mapml-layer-item-details mapml-control-layers',
|
|
30
|
+
extentSettings
|
|
31
|
+
),
|
|
32
|
+
extentOpacitySummary = DomUtil.create('summary', '', opacityControl),
|
|
33
|
+
mapEl = this.getMapEl(),
|
|
34
|
+
layerEl = this.getLayerEl(),
|
|
35
|
+
opacity = DomUtil.create('input', '', opacityControl);
|
|
36
|
+
extentSettings.hidden = true;
|
|
37
|
+
extent.setAttribute('aria-grabbed', 'false');
|
|
38
|
+
|
|
39
|
+
// append the svg paths
|
|
40
|
+
svgExtentControlIcon.setAttribute('viewBox', '0 0 24 24');
|
|
41
|
+
svgExtentControlIcon.setAttribute('height', '22');
|
|
42
|
+
svgExtentControlIcon.setAttribute('width', '22');
|
|
43
|
+
extentControlPath1.setAttribute('d', 'M0 0h24v24H0z');
|
|
44
|
+
extentControlPath1.setAttribute('fill', 'none');
|
|
45
|
+
extentControlPath2.setAttribute(
|
|
46
|
+
'd',
|
|
47
|
+
'M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z'
|
|
48
|
+
);
|
|
49
|
+
svgExtentControlIcon.appendChild(extentControlPath1);
|
|
50
|
+
svgExtentControlIcon.appendChild(extentControlPath2);
|
|
51
|
+
|
|
52
|
+
let mapSelects = this.el.querySelectorAll('map-select');
|
|
53
|
+
if (mapSelects.length) {
|
|
54
|
+
// map-select Stencil components may not have initialized yet;
|
|
55
|
+
// wait for each to be ready before accessing selectdetails
|
|
56
|
+
Promise.all(
|
|
57
|
+
Array.from(mapSelects).map((s) => s.whenReady())
|
|
58
|
+
).then(() => {
|
|
59
|
+
var frag = document.createDocumentFragment();
|
|
60
|
+
for (var i = 0; i < mapSelects.length; i++) {
|
|
61
|
+
frag.appendChild(mapSelects[i].selectdetails);
|
|
62
|
+
}
|
|
63
|
+
extentSettings.appendChild(frag);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let removeExtentButton = DomUtil.create(
|
|
68
|
+
'button',
|
|
69
|
+
'mapml-layer-item-remove-control',
|
|
70
|
+
extentItemControls
|
|
71
|
+
);
|
|
72
|
+
removeExtentButton.type = 'button';
|
|
73
|
+
removeExtentButton.title = mapEl.locale.lmRemoveExtent;
|
|
74
|
+
removeExtentButton.innerHTML = "<span aria-hidden='true'>✕</span>";
|
|
75
|
+
removeExtentButton.classList.add('mapml-button');
|
|
76
|
+
removeExtentButton.addEventListener('click', (e) => {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
e.stopPropagation();
|
|
79
|
+
this.el.remove();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
let extentsettingsButton = DomUtil.create(
|
|
83
|
+
'button',
|
|
84
|
+
'mapml-layer-item-settings-control',
|
|
85
|
+
extentItemControls
|
|
86
|
+
);
|
|
87
|
+
extentsettingsButton.type = 'button';
|
|
88
|
+
extentsettingsButton.title = mapEl.locale.lmExtentSettings;
|
|
89
|
+
extentsettingsButton.setAttribute('aria-expanded', false);
|
|
90
|
+
extentsettingsButton.classList.add('mapml-button');
|
|
91
|
+
DomEvent.on(
|
|
92
|
+
extentsettingsButton,
|
|
93
|
+
'click',
|
|
94
|
+
(e) => {
|
|
95
|
+
if (extentSettings.hidden === true) {
|
|
96
|
+
extentsettingsButton.setAttribute('aria-expanded', true);
|
|
97
|
+
extentSettings.hidden = false;
|
|
98
|
+
} else {
|
|
99
|
+
extentsettingsButton.setAttribute('aria-expanded', false);
|
|
100
|
+
extentSettings.hidden = true;
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
this
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
extentNameIcon.setAttribute('aria-hidden', true);
|
|
107
|
+
extentLabel.appendChild(input);
|
|
108
|
+
extentsettingsButton.appendChild(extentNameIcon);
|
|
109
|
+
extentNameIcon.appendChild(svgExtentControlIcon);
|
|
110
|
+
extentOpacitySummary.innerText = mapEl.locale.lcOpacity;
|
|
111
|
+
extentOpacitySummary.id =
|
|
112
|
+
'mapml-extent-item-opacity-' + stamp(extentOpacitySummary);
|
|
113
|
+
opacity.setAttribute('type', 'range');
|
|
114
|
+
opacity.setAttribute('min', '0');
|
|
115
|
+
opacity.setAttribute('max', '1.0');
|
|
116
|
+
opacity.setAttribute('step', '0.1');
|
|
117
|
+
opacity.setAttribute(
|
|
118
|
+
'aria-labelledby',
|
|
119
|
+
'mapml-extent-item-opacity-' + stamp(extentOpacitySummary)
|
|
120
|
+
);
|
|
121
|
+
const changeOpacity = function (e) {
|
|
122
|
+
if (e && e.target && e.target.value >= 0 && e.target.value <= 1.0) {
|
|
123
|
+
this._extentLayer.changeOpacity(e.target.value);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
opacity.setAttribute('value', this.opacity);
|
|
127
|
+
opacity.value = this._extentLayer._container.style.opacity || '1.0';
|
|
128
|
+
opacity.addEventListener('change', changeOpacity.bind(this));
|
|
129
|
+
|
|
130
|
+
var extentItemNameSpan = DomUtil.create(
|
|
131
|
+
'span',
|
|
132
|
+
'mapml-extent-item-name',
|
|
133
|
+
extentLabel
|
|
134
|
+
);
|
|
135
|
+
input.type = 'checkbox';
|
|
136
|
+
input.defaultChecked = this.checked;
|
|
137
|
+
extentItemNameSpan.innerHTML = this.label;
|
|
138
|
+
const changeCheck = function () {
|
|
139
|
+
this.checked = !this.checked;
|
|
140
|
+
this.el.dispatchEvent(new CustomEvent('map-change'));
|
|
141
|
+
};
|
|
142
|
+
// save for later access by API
|
|
143
|
+
this._layerControlCheckbox = input;
|
|
144
|
+
input.addEventListener('change', changeCheck.bind(this));
|
|
145
|
+
extentItemNameSpan.id =
|
|
146
|
+
'mapml-extent-item-name-{' + stamp(extentItemNameSpan) + '}';
|
|
147
|
+
extent.setAttribute('aria-labelledby', extentItemNameSpan.id);
|
|
148
|
+
extentItemNameSpan.extent = this.el;
|
|
149
|
+
|
|
150
|
+
extent.ontouchstart = extent.onmousedown = (downEvent) => {
|
|
151
|
+
if (
|
|
152
|
+
(downEvent.target.parentElement.tagName.toLowerCase() === 'label' &&
|
|
153
|
+
downEvent.target.tagName.toLowerCase() !== 'input') ||
|
|
154
|
+
downEvent.target.tagName.toLowerCase() === 'label'
|
|
155
|
+
) {
|
|
156
|
+
downEvent.stopPropagation();
|
|
157
|
+
downEvent =
|
|
158
|
+
downEvent instanceof TouchEvent ? downEvent.touches[0] : downEvent;
|
|
159
|
+
|
|
160
|
+
let control = extent,
|
|
161
|
+
controls = extent.parentNode,
|
|
162
|
+
moving = false,
|
|
163
|
+
yPos = downEvent.clientY,
|
|
164
|
+
originalPosition = Array.from(
|
|
165
|
+
extent.parentElement.querySelectorAll('fieldset')
|
|
166
|
+
).indexOf(extent);
|
|
167
|
+
|
|
168
|
+
document.body.ontouchmove = document.body.onmousemove = (moveEvent) => {
|
|
169
|
+
moveEvent.preventDefault();
|
|
170
|
+
moveEvent =
|
|
171
|
+
moveEvent instanceof TouchEvent ? moveEvent.touches[0] : moveEvent;
|
|
172
|
+
|
|
173
|
+
// Fixes flickering by only moving element when there is enough space
|
|
174
|
+
let offset = moveEvent.clientY - yPos;
|
|
175
|
+
moving = Math.abs(offset) > 15 || moving;
|
|
176
|
+
if (
|
|
177
|
+
(controls && !moving) ||
|
|
178
|
+
(controls && controls.childElementCount <= 1) ||
|
|
179
|
+
controls.getBoundingClientRect().top >
|
|
180
|
+
control.getBoundingClientRect().bottom ||
|
|
181
|
+
controls.getBoundingClientRect().bottom <
|
|
182
|
+
control.getBoundingClientRect().top
|
|
183
|
+
) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
controls.classList.add('mapml-draggable');
|
|
188
|
+
control.style.transform = 'translateY(' + offset + 'px)';
|
|
189
|
+
control.style.pointerEvents = 'none';
|
|
190
|
+
|
|
191
|
+
let x = moveEvent.clientX,
|
|
192
|
+
y = moveEvent.clientY,
|
|
193
|
+
root =
|
|
194
|
+
mapEl.tagName === 'GCDS-EXT-MAP'
|
|
195
|
+
? mapEl.shadowRoot
|
|
196
|
+
: mapEl.querySelector('.mapml-web-map').shadowRoot,
|
|
197
|
+
elementAt = root.elementFromPoint(x, y),
|
|
198
|
+
swapControl =
|
|
199
|
+
!elementAt || !elementAt.closest('fieldset')
|
|
200
|
+
? control
|
|
201
|
+
: elementAt.closest('fieldset');
|
|
202
|
+
|
|
203
|
+
swapControl =
|
|
204
|
+
Math.abs(offset) <= swapControl.offsetHeight ? control : swapControl;
|
|
205
|
+
|
|
206
|
+
control.setAttribute('aria-grabbed', 'true');
|
|
207
|
+
control.setAttribute('aria-dropeffect', 'move');
|
|
208
|
+
if (swapControl && controls === swapControl.parentNode) {
|
|
209
|
+
swapControl =
|
|
210
|
+
swapControl !== control.nextSibling
|
|
211
|
+
? swapControl
|
|
212
|
+
: swapControl.nextSibling;
|
|
213
|
+
if (control !== swapControl) {
|
|
214
|
+
yPos = moveEvent.clientY;
|
|
215
|
+
control.style.transform = null;
|
|
216
|
+
}
|
|
217
|
+
controls.insertBefore(control, swapControl);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
document.body.ontouchend = document.body.onmouseup = () => {
|
|
222
|
+
let newPosition = Array.from(
|
|
223
|
+
extent.parentElement.querySelectorAll('fieldset')
|
|
224
|
+
).indexOf(extent);
|
|
225
|
+
control.setAttribute('aria-grabbed', 'false');
|
|
226
|
+
control.removeAttribute('aria-dropeffect');
|
|
227
|
+
control.style.pointerEvents = null;
|
|
228
|
+
control.style.transform = null;
|
|
229
|
+
if (originalPosition !== newPosition) {
|
|
230
|
+
let controlsElems = controls.children,
|
|
231
|
+
zIndex = 0;
|
|
232
|
+
for (let c of controlsElems) {
|
|
233
|
+
let extentEl = c.querySelector('span').extent;
|
|
234
|
+
|
|
235
|
+
extentEl.setAttribute('data-moving', '');
|
|
236
|
+
const node = layerEl.src ? layerEl.shadowRoot : layerEl;
|
|
237
|
+
node.append(extentEl);
|
|
238
|
+
extentEl.removeAttribute('data-moving');
|
|
239
|
+
|
|
240
|
+
extentEl.extentZIndex = zIndex;
|
|
241
|
+
extentEl._extentLayer.setZIndex(zIndex);
|
|
242
|
+
zIndex++;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
controls.classList.remove('mapml-draggable');
|
|
246
|
+
document.body.ontouchmove =
|
|
247
|
+
document.body.onmousemove =
|
|
248
|
+
document.body.ontouchend =
|
|
249
|
+
document.body.onmouseup =
|
|
250
|
+
null;
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
this._extentRootFieldset = extent;
|
|
255
|
+
this._opacitySlider = opacity;
|
|
256
|
+
this._opacityControl = opacityControl;
|
|
257
|
+
this._layerControlLabel = extentLabel;
|
|
258
|
+
return extent;
|
|
259
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class HeightInput {
|
|
2
|
+
name;
|
|
3
|
+
layer;
|
|
4
|
+
constructor(name, layer) {
|
|
5
|
+
this.name = name;
|
|
6
|
+
this.layer = layer;
|
|
7
|
+
}
|
|
8
|
+
validateInput() {
|
|
9
|
+
// name is required
|
|
10
|
+
if (!this.name) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
getValue() {
|
|
16
|
+
return this.layer._map.getSize().y;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class HiddenInput {
|
|
2
|
+
name;
|
|
3
|
+
value;
|
|
4
|
+
constructor(name, value) {
|
|
5
|
+
this.name = name;
|
|
6
|
+
this.value = value;
|
|
7
|
+
}
|
|
8
|
+
validateInput() {
|
|
9
|
+
// name is required
|
|
10
|
+
// value is required
|
|
11
|
+
if (!this.name || !this.value) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
getValue() {
|
|
17
|
+
return this.value;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Point } from "leaflet";
|
|
2
|
+
import { Util } from "../../Util";
|
|
3
|
+
export class LocationInput {
|
|
4
|
+
name;
|
|
5
|
+
position;
|
|
6
|
+
axis;
|
|
7
|
+
units;
|
|
8
|
+
min;
|
|
9
|
+
max;
|
|
10
|
+
rel;
|
|
11
|
+
layer;
|
|
12
|
+
constructor(name, position, axis, units, min, max, rel, layer) {
|
|
13
|
+
this.name = name;
|
|
14
|
+
this.position = position;
|
|
15
|
+
this.axis = axis;
|
|
16
|
+
// if unit/cs not present, find it
|
|
17
|
+
if (!units && axis && !['i', 'j'].includes(axis)) {
|
|
18
|
+
this.units = Util.axisToCS(axis).toLowerCase();
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this.units = units; // cs
|
|
22
|
+
}
|
|
23
|
+
this.min = min;
|
|
24
|
+
this.max = max;
|
|
25
|
+
this.rel = rel;
|
|
26
|
+
this.layer = layer;
|
|
27
|
+
}
|
|
28
|
+
validateInput() {
|
|
29
|
+
// name is required
|
|
30
|
+
// axis is required
|
|
31
|
+
if (!this.name || !this.axis) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
// cs/units is only required when the axis is i/j. To differentiate between the units/cs
|
|
35
|
+
if ((this.axis === 'i' || this.axis === 'j') &&
|
|
36
|
+
!['map', 'tile'].includes(this.units)) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
// check if axis match the units/cs
|
|
40
|
+
if (this.units) {
|
|
41
|
+
let axisCS = Util.axisToCS(this.axis);
|
|
42
|
+
if (typeof axisCS === 'string' &&
|
|
43
|
+
axisCS.toUpperCase() !== this.units.toUpperCase()) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// position is not required, will default to top-left
|
|
48
|
+
// min max fallbacks, map-meta -> projection
|
|
49
|
+
// rel not required, default is image/extent
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
_TCRSToPCRS(coords, zoom) {
|
|
53
|
+
// TCRS pixel point to Projected CRS point (in meters, presumably)
|
|
54
|
+
const map = this.layer._map;
|
|
55
|
+
const crs = map.options.crs;
|
|
56
|
+
const loc = crs.transformation.untransform(coords, crs.scale(zoom));
|
|
57
|
+
return loc;
|
|
58
|
+
}
|
|
59
|
+
getValue(zoom, bounds) {
|
|
60
|
+
// units = cs
|
|
61
|
+
//<input name="..." units="pcrs" type="location" position="top|bottom-left|right" axis="northing|easting|latitude|longitude">
|
|
62
|
+
if (zoom === undefined)
|
|
63
|
+
zoom = this.layer._map.getZoom();
|
|
64
|
+
if (bounds === undefined)
|
|
65
|
+
bounds = this.layer._map.getPixelBounds();
|
|
66
|
+
if (this.units === 'pcrs' || this.units === 'gcrs') {
|
|
67
|
+
switch (this.axis) {
|
|
68
|
+
case 'longitude':
|
|
69
|
+
case 'easting':
|
|
70
|
+
if (this.position) {
|
|
71
|
+
if (this.position.match(/.*?-left/i)) {
|
|
72
|
+
return this._TCRSToPCRS(bounds.min, zoom).x;
|
|
73
|
+
}
|
|
74
|
+
else if (this.position.match(/.*?-right/i)) {
|
|
75
|
+
return this._TCRSToPCRS(bounds.max, zoom).x;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
// position is not required, will default to top-left
|
|
80
|
+
return this._TCRSToPCRS(bounds.min, zoom).x;
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
case 'latitude':
|
|
84
|
+
case 'northing':
|
|
85
|
+
if (this.position) {
|
|
86
|
+
if (this.position.match(/top-.*?/i)) {
|
|
87
|
+
return this._TCRSToPCRS(bounds.min, zoom).y;
|
|
88
|
+
}
|
|
89
|
+
else if (this.position.match(/bottom-.*?/i)) {
|
|
90
|
+
return this._TCRSToPCRS(bounds.max, zoom).y;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
// position is not required, will default to top-left
|
|
95
|
+
return this._TCRSToPCRS(bounds.min, zoom).y;
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else if (this.units === 'tilematrix') {
|
|
101
|
+
// Value is retrieved from the createTile method of TemplatedTileLayer, on move end.
|
|
102
|
+
// Different values for each tile when filling in the map tiles on the map.
|
|
103
|
+
// Currently storing all x,y,z within one object,
|
|
104
|
+
// TODO: change return value as needed based on usage by map-input
|
|
105
|
+
// https://github.com/Leaflet/Leaflet/blob/6994baf25f267db1c8b720c28a61e0700d0aa0e8/src/layer/tile/GridLayer.js#L652
|
|
106
|
+
const center = this.layer._map.getCenter();
|
|
107
|
+
const templatedTileLayer = this.layer._extentLayer._templates[0].layer;
|
|
108
|
+
const pixelBounds = templatedTileLayer._getTiledPixelBounds(center);
|
|
109
|
+
const tileRange = templatedTileLayer._pxBoundsToTileRange(pixelBounds);
|
|
110
|
+
const obj = [];
|
|
111
|
+
for (let j = tileRange.min.y; j <= tileRange.max.y; j++) {
|
|
112
|
+
for (let i = tileRange.min.x; i <= tileRange.max.x; i++) {
|
|
113
|
+
const coords = new Point(i, j);
|
|
114
|
+
coords.z = templatedTileLayer._tileZoom;
|
|
115
|
+
obj.push(coords);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return obj;
|
|
119
|
+
}
|
|
120
|
+
else if (this.units === 'tile' || this.units === 'map') {
|
|
121
|
+
// used for query handler on map enter or click.
|
|
122
|
+
// mapi, tilei, mapj, tilej used for query handling, value is derived from the mouse click event
|
|
123
|
+
// or center of the map when used with keyboard.
|
|
124
|
+
}
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class WidthInput {
|
|
2
|
+
name;
|
|
3
|
+
layer;
|
|
4
|
+
constructor(name, layer) {
|
|
5
|
+
this.name = name;
|
|
6
|
+
this.layer = layer;
|
|
7
|
+
}
|
|
8
|
+
validateInput() {
|
|
9
|
+
// name is required
|
|
10
|
+
if (!this.name) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
getValue() {
|
|
16
|
+
return this.layer._map.getSize().x;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export class ZoomInput {
|
|
2
|
+
name;
|
|
3
|
+
min;
|
|
4
|
+
max;
|
|
5
|
+
value;
|
|
6
|
+
step;
|
|
7
|
+
layer;
|
|
8
|
+
constructor(name, min, max, value, step, layer) {
|
|
9
|
+
this.name = name;
|
|
10
|
+
this.min = min;
|
|
11
|
+
this.max = max;
|
|
12
|
+
this.value = value;
|
|
13
|
+
this.step = step;
|
|
14
|
+
this.layer = layer;
|
|
15
|
+
}
|
|
16
|
+
validateInput() {
|
|
17
|
+
// name is required
|
|
18
|
+
if (!this.name) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
// min and max can not be present
|
|
22
|
+
// fallback would be layer's meta, -> projection min, max
|
|
23
|
+
// don't need value, map-meta max value, -> fallback is max zoom of projection
|
|
24
|
+
// don't need step, defaults to 1
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
getValue() {
|
|
28
|
+
return this.layer._map.options.mapEl.zoom;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate the sequence position for map elements based on their position in a
|
|
3
|
+
* sequence of target elements (map-tile, map-feature, map-extent).
|
|
4
|
+
* - map-extent: Each element gets its own unique position (each is its own MapExtentLayer)
|
|
5
|
+
* - map-tile/map-feature: Adjacent elements of same type share the same position (they share a MapTileLayer/MapFeatureLayer)
|
|
6
|
+
* - used to set the zIndex for the LayerGroup's _container (rendering).
|
|
7
|
+
*
|
|
8
|
+
* @param {HTMLElement} element - The element to calculate position for (map-tile, map-extent, or map-feature)
|
|
9
|
+
* @returns {number} The position of this element's LayerGroup
|
|
10
|
+
*/
|
|
11
|
+
export function calculatePosition(element) {
|
|
12
|
+
const tagName = element.tagName.toLowerCase();
|
|
13
|
+
const validTags = ['map-tile', 'map-extent', 'map-feature'];
|
|
14
|
+
|
|
15
|
+
// Validate element type
|
|
16
|
+
if (!validTags.includes(tagName)) {
|
|
17
|
+
console.warn(`calculatePosition: Invalid element type ${tagName}`);
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Get parent - could be Element or ShadowRoot
|
|
22
|
+
const parent = element.parentNode;
|
|
23
|
+
if (!parent) return 1;
|
|
24
|
+
|
|
25
|
+
// Get children - works for both Element and ShadowRoot
|
|
26
|
+
// For ShadowRoot, we need to filter to get only element nodes
|
|
27
|
+
const children =
|
|
28
|
+
parent.children ||
|
|
29
|
+
Array.from(parent.childNodes).filter(
|
|
30
|
+
(node) => node.nodeType === Node.ELEMENT_NODE
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
if (!children || children.length === 0) return 1;
|
|
34
|
+
|
|
35
|
+
let position = 0;
|
|
36
|
+
let lastTag = null;
|
|
37
|
+
let foundTarget = false;
|
|
38
|
+
|
|
39
|
+
// Iterate through all child elements
|
|
40
|
+
for (const child of children) {
|
|
41
|
+
// Skip non-element nodes (shouldn't happen with .children, but safe for childNodes)
|
|
42
|
+
if (child.nodeType !== Node.ELEMENT_NODE) continue;
|
|
43
|
+
|
|
44
|
+
const childTag = child.tagName.toLowerCase();
|
|
45
|
+
|
|
46
|
+
// Skip non-map elements
|
|
47
|
+
if (!validTags.includes(childTag)) continue;
|
|
48
|
+
|
|
49
|
+
// Check if we've reached our target element
|
|
50
|
+
if (child === element) {
|
|
51
|
+
foundTarget = true;
|
|
52
|
+
|
|
53
|
+
// map-extent always needs a new z-index
|
|
54
|
+
if (childTag === 'map-extent') {
|
|
55
|
+
position++;
|
|
56
|
+
return position;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// For map-tile and map-feature:
|
|
60
|
+
// If this element continues a sequence of the same type, return the current z-index
|
|
61
|
+
if (lastTag === childTag) {
|
|
62
|
+
return position;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// This element starts a new layer group
|
|
66
|
+
position++;
|
|
67
|
+
return position;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Before reaching target, count layer group transitions
|
|
71
|
+
if (!foundTarget) {
|
|
72
|
+
if (childTag === 'map-extent') {
|
|
73
|
+
// Each map-extent increments z-index
|
|
74
|
+
position++;
|
|
75
|
+
} else if (lastTag !== null && lastTag !== childTag) {
|
|
76
|
+
// Transition between different types (excluding map-extent)
|
|
77
|
+
position++;
|
|
78
|
+
} else if (lastTag === null) {
|
|
79
|
+
// First valid element starts at z-index 1
|
|
80
|
+
position = 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
lastTag = childTag;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Element not found (shouldn't happen in normal usage)
|
|
87
|
+
return 0;
|
|
88
|
+
}
|