@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,367 @@
|
|
|
1
|
+
// Detect the locale from the iframe URL's ?lang= query param so that story
|
|
2
|
+
// assets (and the code shown in "Show Code") match the surrounding page's
|
|
3
|
+
// language. Defaults to 'en' when the param is absent or unrecognized.
|
|
4
|
+
const lang = new URLSearchParams(typeof window !== 'undefined' ? window.location.search : '').get('lang') === 'fr'
|
|
5
|
+
? 'fr'
|
|
6
|
+
: 'en';
|
|
7
|
+
const LAYER_OPTIONS = [
|
|
8
|
+
[`./dist/gcds-ext-map/assets/mapml/${lang}/cbmtile/toporama`, 'Toporama', 'Toporama'],
|
|
9
|
+
[`./dist/gcds-ext-map/assets/mapml/${lang}/cbmtile/cbmt`, 'Canada Base Map - Transportation', 'Carte de base du Canada - Transport'],
|
|
10
|
+
[`./dist/gcds-ext-map/assets/mapml/${lang}/osmtile/osm`, 'OpenStreetMap', 'OpenStreetMap'],
|
|
11
|
+
[`./dist/gcds-ext-map/assets/mapml/${lang}/apstile/arctic`, 'Arctic Ocean Basemap MapML Service', "Service MapML de la carte de base de l'océan Arctique"]
|
|
12
|
+
];
|
|
13
|
+
// Build a mapping object so we can show titles in the dropdown but store the URL as the actual value
|
|
14
|
+
const layerMap = LAYER_OPTIONS.reduce((obj, [url, titleEn, titleFr]) => {
|
|
15
|
+
obj[lang === 'fr' ? titleFr : titleEn] = url;
|
|
16
|
+
return obj;
|
|
17
|
+
}, {});
|
|
18
|
+
export default {
|
|
19
|
+
title: 'Components/Map',
|
|
20
|
+
argTypes: {
|
|
21
|
+
lat: {
|
|
22
|
+
name: 'lat',
|
|
23
|
+
control: { type: 'number' },
|
|
24
|
+
description: 'A decimal number between +/- 90. Positive numbers are north of the equator. Latitudes which are meaningful depend on the projection system used. | Un nombre décimal entre +/- 90. Les nombres positifs sont au nord de l\'équateur. Les latitudes significatives dépendent du système de projection utilisé.',
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: 'number' },
|
|
27
|
+
defaultValue: { summary: '0' }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
lon: {
|
|
31
|
+
name: 'lon',
|
|
32
|
+
control: { type: 'number', min: -180.0, max: +180.0 },
|
|
33
|
+
description: 'A decimal number between +/- 180. Positive numbers are east of the meridian at Greenwich, UK. Longitudes which are meaningful depend on the projection system used. | Un nombre décimal entre +/- 180. Les nombres positifs sont à l\'est du méridien de Greenwich, R.-U. Les longitudes significatives dépendent du système de projection utilisé.',
|
|
34
|
+
table: {
|
|
35
|
+
type: { summary: 'number' },
|
|
36
|
+
defaultValue: { summary: '0' }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
zoom: {
|
|
40
|
+
name: 'zoom',
|
|
41
|
+
control: { type: 'number' },
|
|
42
|
+
description: 'A non-negative integer, up to 26, used as a proxy for map scale. The map scale associated to a zoom value depends on the tiled coordinate reference system. | Un entier non négatif, jusqu\'à 26, utilisé comme indicateur de l\'échelle de la carte. L\'échelle associée à une valeur de zoom dépend du système de référence de coordonnées tuilé.',
|
|
43
|
+
table: {
|
|
44
|
+
type: { summary: 'number' },
|
|
45
|
+
defaultValue: { summary: '0' }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
projection: {
|
|
49
|
+
name: 'projection',
|
|
50
|
+
control: { type: 'select' },
|
|
51
|
+
options: ['OSMTILE', 'CBMTILE', 'APSTILE', 'WGS84'],
|
|
52
|
+
description: 'A case-sensitive string token identifier of a standard or custom MapML tiled coordinate reference system. The ":" character is not allowed. | Un identifiant de jeton de chaîne sensible à la casse d\'un système de référence de coordonnées tuilé MapML standard ou personnalisé. Le caractère « : » n\'est pas autorisé.',
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: 'string' },
|
|
55
|
+
defaultValue: { summary: 'OSMTILE' }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
layer: {
|
|
59
|
+
name: '\<map-layer\>',
|
|
60
|
+
control: 'select',
|
|
61
|
+
options: Object.keys(layerMap),
|
|
62
|
+
mapping: layerMap,
|
|
63
|
+
description: 'Layers are specified by one or more \<map-layer\> elements. | Les couches sont spécifiées par un ou plusieurs éléments \<map-layer\>.',
|
|
64
|
+
table: {
|
|
65
|
+
type: { summary: 'element' },
|
|
66
|
+
defaultValue: { summary: '-' }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
lang: {
|
|
70
|
+
name: 'lang',
|
|
71
|
+
control: { type: 'select' },
|
|
72
|
+
options: ['en', 'fr'],
|
|
73
|
+
description: 'The language of the map viewer user interface. May be specified on any ancestor element, especially \<html lang=\>. | La langue de l\'interface utilisateur du visualiseur de carte. Peut être spécifiée sur tout élément ancêtre, en particulier \<html lang=\>.',
|
|
74
|
+
table: {
|
|
75
|
+
type: { summary: 'string' },
|
|
76
|
+
defaultValue: { summary: 'en' },
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
controls: {
|
|
80
|
+
name: 'controls',
|
|
81
|
+
control: 'boolean',
|
|
82
|
+
description: 'Enables or removes optional map controls. | Active ou supprime les contrôles de carte facultatifs.',
|
|
83
|
+
table: {
|
|
84
|
+
type: { summary: 'boolean' },
|
|
85
|
+
defaultValue: { summary: 'false' },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
static: {
|
|
89
|
+
name: 'static',
|
|
90
|
+
control: 'boolean',
|
|
91
|
+
description: 'Disables map events and most interactive behaviour. Typically used in conjunction with controls attribute. | Désactive les événements de la carte et la plupart des comportements interactifs. Généralement utilisé conjointement avec l\'attribut controls.',
|
|
92
|
+
table: {
|
|
93
|
+
type: { summary: 'boolean' },
|
|
94
|
+
defaultValue: { summary: 'false' }
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
controlslist: {
|
|
98
|
+
name: 'controlslist',
|
|
99
|
+
control: 'multi-select',
|
|
100
|
+
options: ['geolocation', 'search', 'nofullscreen', 'nozoom', 'nolayer', 'noreload', 'noscale'],
|
|
101
|
+
description: 'Space-separated list of case-insensitive string tokens of control name or "no"+control name. | Liste de jetons de chaîne insensibles à la casse séparés par des espaces, composée du nom du contrôle ou de « no » + le nom du contrôle.',
|
|
102
|
+
table: {
|
|
103
|
+
type: { summary: 'string' },
|
|
104
|
+
defaultValue: { summary: "''" },
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
caption: {
|
|
108
|
+
name: '\<map-caption\>',
|
|
109
|
+
control: { type: 'text' },
|
|
110
|
+
description: 'A string describing the purpose of the map. The \<map-caption\> element can be used to provide a screen reader-friendly caption or title for the map. | Une chaîne décrivant l\'objectif de la carte. L\'élément \<map-caption\> peut être utilisé pour fournir un titre ou une légende accessible aux lecteurs d\'écran.',
|
|
111
|
+
table: {
|
|
112
|
+
type: { summary: 'element' },
|
|
113
|
+
defaultValue: { summary: '-' },
|
|
114
|
+
},
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
// spacing and indentation is visually significant in the template (it's visible in the
|
|
119
|
+
// "Show Code" disclosure widget; don't change it without testing the result...)
|
|
120
|
+
const TemplateBasic = (args) => {
|
|
121
|
+
return `<gcds-ext-map lat="${args.lat}" lon="${args.lon}" zoom="${args.zoom}" lang="${args.lang}" projection="${args.projection}"${args.controls ? ' controls' : ''}${args.static ? ' static' : ''}${args.controlslist.length > 0 ? ` controlslist="${args.controlslist.join(' ')}"` : ''}>
|
|
122
|
+
|
|
123
|
+
<map-caption>${args.caption}</map-caption>
|
|
124
|
+
|
|
125
|
+
<map-layer src="${args.layer}" ${`checked`}></map-layer>
|
|
126
|
+
|
|
127
|
+
</gcds-ext-map>`;
|
|
128
|
+
};
|
|
129
|
+
export const Default = TemplateBasic.bind({});
|
|
130
|
+
Default.args = {
|
|
131
|
+
lat: 48.474287,
|
|
132
|
+
lon: -123.390541,
|
|
133
|
+
zoom: 11,
|
|
134
|
+
projection: 'OSMTILE',
|
|
135
|
+
controls: true,
|
|
136
|
+
static: false,
|
|
137
|
+
lang: lang,
|
|
138
|
+
controlslist: ['geolocation', 'search'],
|
|
139
|
+
layer: `./dist/gcds-ext-map/assets/mapml/${lang}/osmtile/cbmt`,
|
|
140
|
+
caption: lang === 'fr' ? 'Une carte de Victoria, Canada' : 'A map of Victoria, Canada'
|
|
141
|
+
};
|
|
142
|
+
export const HiddenBasemap = (args) => {
|
|
143
|
+
return `<gcds-ext-map lat="${args.lat}" lon="${args.lon}" zoom="${args.zoom}" projection="${args.projection}"${args.controls ? ' controls' : ''}>
|
|
144
|
+
|
|
145
|
+
<map-layer src="${args.layer}" checked hidden></map-layer>
|
|
146
|
+
|
|
147
|
+
<map-layer src="./dist/gcds-ext-map/assets/mapml/${lang}/osmtile/current_conditions" checked></map-layer>
|
|
148
|
+
|
|
149
|
+
</gcds-ext-map>`;
|
|
150
|
+
};
|
|
151
|
+
HiddenBasemap.args = {
|
|
152
|
+
lat: 53.087426,
|
|
153
|
+
lon: -91.275330,
|
|
154
|
+
zoom: 4,
|
|
155
|
+
projection: 'OSMTILE',
|
|
156
|
+
controls: true,
|
|
157
|
+
layer: `./dist/gcds-ext-map/assets/mapml/${lang}/osmtile/cbmt`,
|
|
158
|
+
caption: lang === 'fr' ? 'Conditions météorologiques actuelles au Canada' : "Canada's current weather conditions"
|
|
159
|
+
};
|
|
160
|
+
export const Playground = args => `<gcds-ext-map lat="${args.lat}" lon="${args.lon}" zoom="${args.zoom}" lang="${args.lang}" projection="${args.projection}"${args.controls ? ' controls' : ''}${args.static ? ' static' : ''}${args.controlslist.length > 0 ? ` controlslist="${args.controlslist.join(' ')}"` : ''}>
|
|
161
|
+
|
|
162
|
+
<map-layer src="${args.layer}" checked hidden></map-layer>
|
|
163
|
+
|
|
164
|
+
<map-layer src="./dist/gcds-ext-map/assets/mapml/${lang}/osmtile/current_conditions" checked></map-layer>
|
|
165
|
+
|
|
166
|
+
</gcds-ext-map>`;
|
|
167
|
+
Playground.args = {
|
|
168
|
+
lat: 53.087426,
|
|
169
|
+
lon: -91.275330,
|
|
170
|
+
zoom: 4,
|
|
171
|
+
projection: 'OSMTILE',
|
|
172
|
+
controls: true,
|
|
173
|
+
static: false,
|
|
174
|
+
lang: lang,
|
|
175
|
+
controlslist: ['geolocation', 'search'],
|
|
176
|
+
layer: `./dist/gcds-ext-map/assets/mapml/${lang}/osmtile/cbmt`,
|
|
177
|
+
caption: lang === 'fr' ? 'Conditions météorologiques actuelles au Canada' : "Canada's current weather conditions"
|
|
178
|
+
};
|
|
179
|
+
export const GeoJSON2MapMLExample = {
|
|
180
|
+
render: (args, { loaded }) => {
|
|
181
|
+
const container = document.createElement('div');
|
|
182
|
+
container.innerHTML = `<gcds-ext-map id="np" lat="${args.lat}" lon="${args.lon}" zoom="${args.zoom}" lang="${args.lang}" projection="${args.projection}"${args.controls ? ' controls' : ''}${args.static ? ' static' : ''}${args.controlslist.length > 0 ? ` controlslist="${args.controlslist.join(' ')}"` : ''}>
|
|
183
|
+
<map-layer src="${args.layer}" checked hidden></map-layer>
|
|
184
|
+
</gcds-ext-map>`;
|
|
185
|
+
const mapEl = container.querySelector('#np');
|
|
186
|
+
// Add the GeoJSON layer after the map is ready
|
|
187
|
+
customElements.whenDefined('gcds-ext-map').then(async () => {
|
|
188
|
+
// Wait for map to be fully initialized
|
|
189
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
190
|
+
const { geoJsonData } = loaded;
|
|
191
|
+
if (!geoJsonData)
|
|
192
|
+
return;
|
|
193
|
+
const mapmlGlobal = window;
|
|
194
|
+
if (typeof mapmlGlobal.M === 'undefined') {
|
|
195
|
+
console.log('M not found! Unable to generate GeoJSON example layer.');
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
// Configure MapML options for the geojson2mapml api
|
|
199
|
+
let provOptions = {
|
|
200
|
+
projection: "OSMTILE",
|
|
201
|
+
label: lang === 'fr' ? 'Provinces et territoires du Canada' : 'Provinces and Territories of Canada',
|
|
202
|
+
caption: lang === 'fr' ? 'PRFNAME' : 'PRENAME',
|
|
203
|
+
geometryFunction: function (g, f) {
|
|
204
|
+
if (g.nodeName === "MAP-MULTIPOLYGON") {
|
|
205
|
+
let polys = g.querySelectorAll("map-polygon");
|
|
206
|
+
for (let i = 0; i < polys.length; i++) {
|
|
207
|
+
polys[i].setAttribute("class", "h");
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
g.setAttribute("class", "h");
|
|
212
|
+
}
|
|
213
|
+
switch (f.properties.PRUID) {
|
|
214
|
+
case '10':
|
|
215
|
+
g.className = 'canada nl';
|
|
216
|
+
break;
|
|
217
|
+
case '11':
|
|
218
|
+
g.className = 'canada pei';
|
|
219
|
+
break;
|
|
220
|
+
case '12':
|
|
221
|
+
g.className = 'canada ns';
|
|
222
|
+
break;
|
|
223
|
+
case '13':
|
|
224
|
+
g.className = 'canada nb';
|
|
225
|
+
break;
|
|
226
|
+
case '24':
|
|
227
|
+
g.className = 'canada qc';
|
|
228
|
+
break;
|
|
229
|
+
case '35':
|
|
230
|
+
g.className = 'canada on';
|
|
231
|
+
break;
|
|
232
|
+
case '46':
|
|
233
|
+
g.className = 'canada mb';
|
|
234
|
+
break;
|
|
235
|
+
case '47':
|
|
236
|
+
g.className = 'canada sk';
|
|
237
|
+
break;
|
|
238
|
+
case '48':
|
|
239
|
+
g.className = 'canada ab';
|
|
240
|
+
break;
|
|
241
|
+
case '59':
|
|
242
|
+
g.className = 'canada bc';
|
|
243
|
+
break;
|
|
244
|
+
case '60':
|
|
245
|
+
g.className = 'canada yk';
|
|
246
|
+
break;
|
|
247
|
+
case '61':
|
|
248
|
+
g.className = 'canada nwt';
|
|
249
|
+
break;
|
|
250
|
+
case '62':
|
|
251
|
+
g.className = 'canada nt';
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
return g;
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
// Convert GeoJSON to MapML
|
|
258
|
+
let provs = mapmlGlobal.M.geojson2mapml(geoJsonData, provOptions);
|
|
259
|
+
// Post-process the layer
|
|
260
|
+
const features = provs.querySelectorAll('map-feature');
|
|
261
|
+
features.forEach(feature => {
|
|
262
|
+
const taggedGeometry = feature.querySelector('.canada');
|
|
263
|
+
feature.setAttribute('class', taggedGeometry.getAttribute('class'));
|
|
264
|
+
taggedGeometry.removeAttribute('class');
|
|
265
|
+
});
|
|
266
|
+
provs.setAttribute('media', '(0 < map-zoom < 7)');
|
|
267
|
+
provs.setAttribute('opacity', '0.65');
|
|
268
|
+
let mapStyle = document.createElement('map-style');
|
|
269
|
+
mapStyle.innerHTML = `.canada { fill-opacity: 0.7; stroke-width: 1; stroke: white; stroke-opacity: 1; stroke-dasharray: 3; }
|
|
270
|
+
.bc { fill: #ffdeb2; stroke: #e6c8a1; } .ab { fill: #facad6; stroke: #e8708e; } .sk { fill: #b5ffe4; stroke: #9ad9c2;} .mb { fill: #e6e6fa; stroke: #cdcdde; }
|
|
271
|
+
.on { fill: #facad6; stroke: #e8708e; } .qc { fill: #b5ffe4; stroke: #9ad9c2;} .nb { fill: #ffdeb2; } .pei { fill: #e6e6fa; stroke: #cdcdde;}
|
|
272
|
+
.ns { fill: #facad6; stroke: #e8708e; } .nl { fill: #ebc798; stroke: #d0a368; }
|
|
273
|
+
.yk { fill: #ebc798; stroke: #d0a368; } .nwt { fill: #e6e6fa; stroke: #cdcdde; } .nt { fill: #ffdeb2; stroke: #e6c8a1; }`;
|
|
274
|
+
provs.insertAdjacentElement('afterbegin', mapStyle);
|
|
275
|
+
mapEl.appendChild(provs);
|
|
276
|
+
console.log('Added GeoJSON layer to map');
|
|
277
|
+
});
|
|
278
|
+
return container.firstElementChild;
|
|
279
|
+
},
|
|
280
|
+
args: {
|
|
281
|
+
lat: 53.087426,
|
|
282
|
+
lon: -91.275330,
|
|
283
|
+
zoom: 4,
|
|
284
|
+
projection: 'OSMTILE',
|
|
285
|
+
controls: true,
|
|
286
|
+
static: false,
|
|
287
|
+
lang: lang,
|
|
288
|
+
controlslist: ['geolocation', 'search'],
|
|
289
|
+
layer: `./dist/gcds-ext-map/assets/mapml/${lang}/osmtile/cbmt`,
|
|
290
|
+
caption: lang === 'fr' ? 'Provinces et territoires du Canada en GeoJSON stylisé' : "Canada's Provinces and Territories in styled GeoJSON"
|
|
291
|
+
},
|
|
292
|
+
loaders: [
|
|
293
|
+
async () => {
|
|
294
|
+
try {
|
|
295
|
+
const response = await fetch('./dist/gcds-ext-map/assets/canada.json');
|
|
296
|
+
if (!response.ok) {
|
|
297
|
+
throw new Error(`Response status: ${response.status}`);
|
|
298
|
+
}
|
|
299
|
+
const geoJsonData = await response.json();
|
|
300
|
+
// Return the data for use in the story
|
|
301
|
+
return { geoJsonData };
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
console.error('Error loading GeoJSON data:', error);
|
|
305
|
+
return { geoJsonData: null, error };
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
parameters: {
|
|
310
|
+
docs: {
|
|
311
|
+
source: {
|
|
312
|
+
type: 'code',
|
|
313
|
+
language: 'html',
|
|
314
|
+
code: `<gcds-ext-map id="np" lat="53.087426" lon="-91.275330" zoom="4" lang="${lang}" projection="OSMTILE" controls controlslist="geolocation">
|
|
315
|
+
|
|
316
|
+
<map-caption>${lang === 'fr' ? 'Provinces et territoires du Canada en GeoJSON stylisé' : "Canada's Provinces and Territories in styled GeoJSON"}</map-caption>
|
|
317
|
+
|
|
318
|
+
<map-layer src="./dist/gcds-ext-map/assets/mapml/${lang}/osmtile/cbmt" checked hidden></map-layer>
|
|
319
|
+
|
|
320
|
+
<!-- ${lang === 'fr' ? 'cette couche est créée via javascript, en utilisant les fonctions de l’API M.geojson2mapml' : 'this layer created via javascript, using M.geojson2mapml API functions'} -->
|
|
321
|
+
<map-layer label="${lang === 'fr' ? 'Provinces et territoires du Canada' : 'Provinces and territories of Canada'}" checked media="(0 < map-zoom < 7)" opacity="0.65">
|
|
322
|
+
<map-style>
|
|
323
|
+
.canada { fill-opacity: 0.7; stroke-width: 1; stroke: white; stroke-opacity: 1; stroke-dasharray: 3; }
|
|
324
|
+
.bc { fill: #ffdeb2; stroke: #e6c8a1; } .ab { fill: #facad6; stroke: #e8708e; }
|
|
325
|
+
.sk { fill: #b5ffe4; stroke: #9ad9c2;} .mb { fill: #e6e6fa; stroke: #cdcdde; }
|
|
326
|
+
.on { fill: #facad6; stroke: #e8708e; } .qc { fill: #b5ffe4; stroke: #9ad9c2;}
|
|
327
|
+
.nb { fill: #ffdeb2; } .pei { fill: #e6e6fa; stroke: #cdcdde;}
|
|
328
|
+
.ns { fill: #facad6; stroke: #e8708e; } .nl { fill: #ebc798; stroke: #d0a368; }
|
|
329
|
+
.yk { fill: #ebc798; stroke: #d0a368; } .nwt { fill: #e6e6fa; stroke: #cdcdde; }
|
|
330
|
+
.nt { fill: #ffdeb2; stroke: #e6c8a1; }
|
|
331
|
+
</map-style>
|
|
332
|
+
<map-meta name="extent" content="top-left-longitude=-141.01143, top-left-latitude=41.71096, bottom-right-longitude=-52.61941,bottom-right-latitude=83.13505"></map-meta>
|
|
333
|
+
<map-meta name="projection" content="OSMTILE"></map-meta>
|
|
334
|
+
<map-meta name="cs" content="gcrs"></map-meta>
|
|
335
|
+
<map-feature class="canada nl">
|
|
336
|
+
<map-featurecaption>${lang === 'fr' ? 'Terre-Neuve-et-Labrador' : 'Newfoundland and Labrador'}</map-featurecaption>
|
|
337
|
+
<map-geometry>...</map-geometry>
|
|
338
|
+
<map-properties>...</map-properties>
|
|
339
|
+
</map-feature>
|
|
340
|
+
... etc ...
|
|
341
|
+
</map-layer>
|
|
342
|
+
|
|
343
|
+
</gcds-ext-map>`
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
export const DarkMode = {
|
|
349
|
+
render: (args) => `<gcds-ext-map lat="${args.lat}" lon="${args.lon}" zoom="${args.zoom}" lang="${args.lang}" projection="${args.projection}"${args.controls ? ' controls' : ''}${args.static ? ' static' : ''}${args.controlslist.length > 0 ? ` controlslist="${args.controlslist.join(' ')}"` : ''}>
|
|
350
|
+
|
|
351
|
+
<map-layer media="(prefers-color-scheme: dark)" src="./dist/gcds-ext-map/assets/mapml/${lang}/osmtile/dark.mapml" checked></map-layer>
|
|
352
|
+
|
|
353
|
+
<map-layer media="(prefers-color-scheme: light)" src="./dist/gcds-ext-map/assets/mapml/${lang}/osmtile/light.mapml" checked></map-layer>
|
|
354
|
+
|
|
355
|
+
</gcds-ext-map>`,
|
|
356
|
+
args: {
|
|
357
|
+
lat: 53.087426,
|
|
358
|
+
lon: -91.275330,
|
|
359
|
+
zoom: 4,
|
|
360
|
+
projection: 'OSMTILE',
|
|
361
|
+
controls: true,
|
|
362
|
+
static: false,
|
|
363
|
+
lang: lang,
|
|
364
|
+
controlslist: ['geolocation', 'search'],
|
|
365
|
+
caption: lang === 'fr' ? "OpenStreetMap au format d'archive pmtiles, démontrant les cartes en mode clair et sombre" : "OpenStreetMap in pmtiles archive format, demonstrating light and dark mode maps"
|
|
366
|
+
}
|
|
367
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export class MapA {
|
|
2
|
+
el;
|
|
3
|
+
href;
|
|
4
|
+
target;
|
|
5
|
+
type;
|
|
6
|
+
inplace;
|
|
7
|
+
static get is() { return "map-a"; }
|
|
8
|
+
static get properties() {
|
|
9
|
+
return {
|
|
10
|
+
"href": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"mutable": false,
|
|
13
|
+
"complexType": {
|
|
14
|
+
"original": "string",
|
|
15
|
+
"resolved": "string",
|
|
16
|
+
"references": {}
|
|
17
|
+
},
|
|
18
|
+
"required": false,
|
|
19
|
+
"optional": true,
|
|
20
|
+
"docs": {
|
|
21
|
+
"tags": [],
|
|
22
|
+
"text": ""
|
|
23
|
+
},
|
|
24
|
+
"getter": false,
|
|
25
|
+
"setter": false,
|
|
26
|
+
"reflect": true,
|
|
27
|
+
"attribute": "href"
|
|
28
|
+
},
|
|
29
|
+
"target": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"mutable": false,
|
|
32
|
+
"complexType": {
|
|
33
|
+
"original": "string",
|
|
34
|
+
"resolved": "string",
|
|
35
|
+
"references": {}
|
|
36
|
+
},
|
|
37
|
+
"required": false,
|
|
38
|
+
"optional": true,
|
|
39
|
+
"docs": {
|
|
40
|
+
"tags": [],
|
|
41
|
+
"text": ""
|
|
42
|
+
},
|
|
43
|
+
"getter": false,
|
|
44
|
+
"setter": false,
|
|
45
|
+
"reflect": true,
|
|
46
|
+
"attribute": "target"
|
|
47
|
+
},
|
|
48
|
+
"type": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"mutable": false,
|
|
51
|
+
"complexType": {
|
|
52
|
+
"original": "string",
|
|
53
|
+
"resolved": "string",
|
|
54
|
+
"references": {}
|
|
55
|
+
},
|
|
56
|
+
"required": false,
|
|
57
|
+
"optional": true,
|
|
58
|
+
"docs": {
|
|
59
|
+
"tags": [],
|
|
60
|
+
"text": ""
|
|
61
|
+
},
|
|
62
|
+
"getter": false,
|
|
63
|
+
"setter": false,
|
|
64
|
+
"reflect": true,
|
|
65
|
+
"attribute": "type"
|
|
66
|
+
},
|
|
67
|
+
"inplace": {
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"mutable": false,
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "boolean",
|
|
72
|
+
"resolved": "boolean",
|
|
73
|
+
"references": {}
|
|
74
|
+
},
|
|
75
|
+
"required": false,
|
|
76
|
+
"optional": true,
|
|
77
|
+
"docs": {
|
|
78
|
+
"tags": [],
|
|
79
|
+
"text": ""
|
|
80
|
+
},
|
|
81
|
+
"getter": false,
|
|
82
|
+
"setter": false,
|
|
83
|
+
"reflect": true,
|
|
84
|
+
"attribute": "inplace"
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
static get elementRef() { return "el"; }
|
|
89
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
implemented for both mapml-viewer and web-map; however web-map does not focus on map element in the browser resulting in NVDA
|
|
3
|
+
not being able to read out map-caption and stating that it's an interactive map region
|
|
4
|
+
*/
|
|
5
|
+
export class MapCaption {
|
|
6
|
+
el;
|
|
7
|
+
observer;
|
|
8
|
+
connectedCallback() {
|
|
9
|
+
if (this.el.parentElement.nodeName === 'GCDS-EXT-MAP') {
|
|
10
|
+
// Wait a tick for Stencil to finish rendering/hydrating the element's content
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
// Only the first map-caption child should manage the aria-label
|
|
13
|
+
const firstMapCaption = this.el.parentElement.querySelector('map-caption');
|
|
14
|
+
const isFirstCaption = firstMapCaption === this.el;
|
|
15
|
+
if (!isFirstCaption) {
|
|
16
|
+
// Not the first caption, don't set up observer or aria-label
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// calls MutationObserver; needed to observe changes to content between <map-caption> tags and update to aria-label
|
|
20
|
+
let mapcaption = this.el.innerText;
|
|
21
|
+
this.observer = new MutationObserver(() => {
|
|
22
|
+
let mapcaptionupdate = this.el.innerText;
|
|
23
|
+
if (mapcaptionupdate !== mapcaption) {
|
|
24
|
+
this.el.parentElement.setAttribute('aria-label', mapcaptionupdate);
|
|
25
|
+
mapcaption = mapcaptionupdate;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
this.observer.observe(this.el, {
|
|
29
|
+
characterData: true,
|
|
30
|
+
subtree: true,
|
|
31
|
+
attributes: true,
|
|
32
|
+
childList: true
|
|
33
|
+
});
|
|
34
|
+
// don't change aria-label if one already exists from user (checks when element is first created)
|
|
35
|
+
if (!this.el.parentElement.hasAttribute('aria-label')) {
|
|
36
|
+
const ariaLabel = this.el.innerText;
|
|
37
|
+
this.el.parentElement.setAttribute('aria-label', ariaLabel);
|
|
38
|
+
}
|
|
39
|
+
}, 0);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
disconnectedCallback() {
|
|
43
|
+
if (this.observer) {
|
|
44
|
+
this.observer.disconnect();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
static get is() { return "map-caption"; }
|
|
51
|
+
static get elementRef() { return "el"; }
|
|
52
|
+
}
|