@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,342 @@
|
|
|
1
|
+
import { SVG, DomUtil, stamp } from 'leaflet';
|
|
2
|
+
|
|
3
|
+
import { Util } from '../Util.js';
|
|
4
|
+
/**
|
|
5
|
+
* Returns a new Feature Renderer
|
|
6
|
+
* @param {Object} options - Options for the renderer
|
|
7
|
+
* @returns {*}
|
|
8
|
+
*/
|
|
9
|
+
export var FeatureRenderer = SVG.extend({
|
|
10
|
+
/**
|
|
11
|
+
* Override method of same name from SVG, use the this._container property
|
|
12
|
+
* to set up the role="none presentation" on featureGroupu container,
|
|
13
|
+
* per this recommendation:
|
|
14
|
+
* https://github.com/Maps4HTML/MapMjs/pull/471#issuecomment-845192246
|
|
15
|
+
* @private overrides ancestor method so that we have a _container to work with
|
|
16
|
+
*/
|
|
17
|
+
_initContainer: function () {
|
|
18
|
+
// call the method we're overriding, per https://leafletjs.com/examples/extending/extending-1-classes.html#methods-of-the-parent-class
|
|
19
|
+
// note you have to pass 'this' as the first arg
|
|
20
|
+
SVG.prototype._initContainer.call(this);
|
|
21
|
+
// knowing that the previous method call creates the this._container, we
|
|
22
|
+
// access it and set the role="none presetation" which suppresses the
|
|
23
|
+
// announcement of "Graphic" on each feature focus.
|
|
24
|
+
this._container.setAttribute('role', 'none presentation');
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Creates all the appropriate path elements for a M.Path
|
|
29
|
+
* @param {M.Path} layer - The M.Path that needs paths generated
|
|
30
|
+
* @param {boolean} stampLayer - Whether or not a layer should be stamped and stored in the renderer layers
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
_initPath: function (layer, stampLayer = true) {
|
|
34
|
+
if (layer._outline) {
|
|
35
|
+
let outlinePath = SVG.create('path');
|
|
36
|
+
if (layer.options.className)
|
|
37
|
+
DomUtil.addClass(
|
|
38
|
+
outlinePath,
|
|
39
|
+
layer.featureAttributes.class || layer.options.className
|
|
40
|
+
);
|
|
41
|
+
DomUtil.addClass(outlinePath, 'mapml-feature-outline');
|
|
42
|
+
outlinePath.style.fill = 'none';
|
|
43
|
+
layer.outlinePath = outlinePath;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//creates the main parts and sub parts paths
|
|
47
|
+
for (let p of layer._parts) {
|
|
48
|
+
if (p.rings) {
|
|
49
|
+
this._createPath(
|
|
50
|
+
p,
|
|
51
|
+
layer.options.className,
|
|
52
|
+
layer.featureAttributes['aria-label'],
|
|
53
|
+
layer.options.interactive,
|
|
54
|
+
layer.featureAttributes
|
|
55
|
+
);
|
|
56
|
+
if (layer.outlinePath) p.path.style.stroke = 'none';
|
|
57
|
+
}
|
|
58
|
+
if (p.subrings) {
|
|
59
|
+
for (let r of p.subrings) {
|
|
60
|
+
this._createPath(
|
|
61
|
+
r,
|
|
62
|
+
layer.options.className,
|
|
63
|
+
r.attr['aria-label'],
|
|
64
|
+
r.link !== undefined,
|
|
65
|
+
r.attr
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
this._updateStyle(layer);
|
|
70
|
+
}
|
|
71
|
+
if (stampLayer) {
|
|
72
|
+
let s = stamp(layer);
|
|
73
|
+
this._layers[s] = layer;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Creates paths for either mainParts, subParts or outline of a feature
|
|
79
|
+
* @param {Object} ring - The ring the current path is being generated for
|
|
80
|
+
* @param {string} title - The accessible aria-label of a path
|
|
81
|
+
* @param {string} cls - The class of the path
|
|
82
|
+
* @param {boolean} interactive - The boolean representing whether a feature is interactive or not
|
|
83
|
+
* @param {Object} attr - Attributes map
|
|
84
|
+
* @private
|
|
85
|
+
*/
|
|
86
|
+
_createPath: function (
|
|
87
|
+
ring,
|
|
88
|
+
cls,
|
|
89
|
+
title,
|
|
90
|
+
interactive = false,
|
|
91
|
+
attr = undefined
|
|
92
|
+
) {
|
|
93
|
+
let p = SVG.create('path');
|
|
94
|
+
ring.path = p;
|
|
95
|
+
if (!attr) {
|
|
96
|
+
if (title) p.setAttribute('aria-label', title);
|
|
97
|
+
} else {
|
|
98
|
+
for (let [name, value] of Object.entries(attr)) {
|
|
99
|
+
if (name === 'id' || name === 'tabindex') continue;
|
|
100
|
+
p.setAttribute(name, value);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (ring.cls || cls) {
|
|
104
|
+
DomUtil.addClass(p, ring.cls || cls);
|
|
105
|
+
}
|
|
106
|
+
if (interactive) {
|
|
107
|
+
DomUtil.addClass(p, 'leaflet-interactive');
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Adds all the paths needed for a feature
|
|
113
|
+
* @param {M.Path} layer - The feature that needs it's paths added
|
|
114
|
+
* @param {HTMLElement} container - The location the paths need to be added to
|
|
115
|
+
* @param {boolean} interactive - Whether a feature is interactive or not
|
|
116
|
+
* @private
|
|
117
|
+
*/
|
|
118
|
+
_addPath: function (layer, container = undefined, interactive = true) {
|
|
119
|
+
if (!this._rootGroup && !container) {
|
|
120
|
+
this._initContainer();
|
|
121
|
+
}
|
|
122
|
+
let c = container || this._rootGroup,
|
|
123
|
+
outlineAdded = false;
|
|
124
|
+
if (interactive) {
|
|
125
|
+
layer.addInteractiveTarget(layer.group);
|
|
126
|
+
}
|
|
127
|
+
for (let p of layer._parts) {
|
|
128
|
+
if (p.path) layer.group.appendChild(p.path);
|
|
129
|
+
if (interactive) {
|
|
130
|
+
if (layer.options.link)
|
|
131
|
+
layer.attachLinkHandler(
|
|
132
|
+
p.path,
|
|
133
|
+
layer.options.link,
|
|
134
|
+
layer.options._leafletLayer
|
|
135
|
+
);
|
|
136
|
+
layer.addInteractiveTarget(p.path);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (!outlineAdded && layer.pixelOutline) {
|
|
140
|
+
layer.group.appendChild(layer.outlinePath);
|
|
141
|
+
outlineAdded = true;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
for (let subP of p.subrings) {
|
|
145
|
+
if (subP.path) {
|
|
146
|
+
if (subP.link) {
|
|
147
|
+
layer.attachLinkHandler(
|
|
148
|
+
subP.path,
|
|
149
|
+
subP.link,
|
|
150
|
+
layer.options._leafletLayer
|
|
151
|
+
);
|
|
152
|
+
layer.addInteractiveTarget(subP.path);
|
|
153
|
+
}
|
|
154
|
+
layer.group.appendChild(subP.path);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
c.appendChild(layer.group);
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Removes all the paths related to a feature
|
|
163
|
+
* @param {M.Path} layer - The feature who's paths need to be removed
|
|
164
|
+
* @private
|
|
165
|
+
*/
|
|
166
|
+
_removePath: function (layer) {
|
|
167
|
+
for (let p of layer._parts) {
|
|
168
|
+
if (p.path) {
|
|
169
|
+
layer.removeInteractiveTarget(p.path);
|
|
170
|
+
DomUtil.remove(p.path);
|
|
171
|
+
}
|
|
172
|
+
for (let subP of p.subrings) {
|
|
173
|
+
if (subP.path) DomUtil.remove(subP.path);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (layer.outlinePath) DomUtil.remove(layer.outlinePath);
|
|
177
|
+
layer.removeInteractiveTarget(layer.group);
|
|
178
|
+
DomUtil.remove(layer.group);
|
|
179
|
+
delete this._layers[stamp(layer)];
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Updates the d attribute of all paths of a feature
|
|
184
|
+
* @param {M.Path} layer - The Feature that needs updating
|
|
185
|
+
* @private
|
|
186
|
+
*/
|
|
187
|
+
_updateFeature: function (layer) {
|
|
188
|
+
if (layer.pixelOutline)
|
|
189
|
+
this._setPath(
|
|
190
|
+
layer.outlinePath,
|
|
191
|
+
this.geometryToPath(layer.pixelOutline, false)
|
|
192
|
+
);
|
|
193
|
+
for (let p of layer._parts) {
|
|
194
|
+
this._setPath(p.path, this.geometryToPath(p.pixelRings, layer.isClosed));
|
|
195
|
+
for (let subP of p.subrings) {
|
|
196
|
+
this._setPath(
|
|
197
|
+
subP.path,
|
|
198
|
+
this.geometryToPath(subP.pixelSubrings, false)
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Generates the marker d attribute for a given point
|
|
206
|
+
* @param {Point} p - The point of the marker
|
|
207
|
+
* @returns {string}
|
|
208
|
+
* @private
|
|
209
|
+
*/
|
|
210
|
+
_pointToMarker: function (p) {
|
|
211
|
+
return `M${p.x} ${p.y} L${p.x - 12.5} ${p.y - 30} C${p.x - 12.5} ${
|
|
212
|
+
p.y - 50
|
|
213
|
+
}, ${p.x + 12.5} ${p.y - 50}, ${p.x + 12.5} ${p.y - 30} L${p.x} ${p.y}z`;
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Updates the styles of all paths of a feature
|
|
218
|
+
* @param {M.Path} layer - The feature that needs styles updated
|
|
219
|
+
* @private
|
|
220
|
+
*/
|
|
221
|
+
_updateStyle: function (layer) {
|
|
222
|
+
this._updatePathStyle(layer.outlinePath, layer, false, true);
|
|
223
|
+
for (let p of layer._parts) {
|
|
224
|
+
if (p.path) {
|
|
225
|
+
this._updatePathStyle(p.path, layer, true);
|
|
226
|
+
}
|
|
227
|
+
for (let subP of p.subrings) {
|
|
228
|
+
if (subP.path) this._updatePathStyle(subP.path, layer);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Updates the style of a single path
|
|
235
|
+
* @param {HTMLElement} path - The path that needs updating
|
|
236
|
+
* @param {M.Path} layer - The feature layer
|
|
237
|
+
* @param {boolean} isMain - Whether it's the main parts or not
|
|
238
|
+
* @param {boolean} isOutline - Whether a path is an outline or not
|
|
239
|
+
* @private
|
|
240
|
+
*/
|
|
241
|
+
_updatePathStyle: function (path, layer, isMain = false, isOutline = false) {
|
|
242
|
+
if (!path || !layer) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
let options = layer.options,
|
|
246
|
+
isClosed = layer.isClosed;
|
|
247
|
+
if (
|
|
248
|
+
(options.stroke && (!isClosed || isOutline)) ||
|
|
249
|
+
(isMain && !layer.outlinePath)
|
|
250
|
+
) {
|
|
251
|
+
path.setAttribute('stroke', options.color);
|
|
252
|
+
path.setAttribute('stroke-opacity', options.opacity);
|
|
253
|
+
path.setAttribute('stroke-width', options.weight);
|
|
254
|
+
path.setAttribute('stroke-linecap', options.lineCap);
|
|
255
|
+
path.setAttribute('stroke-linejoin', options.lineJoin);
|
|
256
|
+
|
|
257
|
+
if (options.dashArray) {
|
|
258
|
+
path.setAttribute('stroke-dasharray', options.dashArray);
|
|
259
|
+
} else {
|
|
260
|
+
path.removeAttribute('stroke-dasharray');
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (options.dashOffset) {
|
|
264
|
+
path.setAttribute('stroke-dashoffset', options.dashOffset);
|
|
265
|
+
} else {
|
|
266
|
+
path.removeAttribute('stroke-dashoffset');
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (options.link) {
|
|
270
|
+
path.setAttribute(
|
|
271
|
+
'stroke',
|
|
272
|
+
options.link.visited ? '#6c00a2' : '#0000EE'
|
|
273
|
+
);
|
|
274
|
+
path.setAttribute('stroke-opacity', '1');
|
|
275
|
+
path.setAttribute('stroke-width', '1px');
|
|
276
|
+
path.setAttribute('stroke-dasharray', 'none');
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
path.setAttribute('stroke', 'none');
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (isClosed && !isOutline) {
|
|
283
|
+
if (!options.fill) {
|
|
284
|
+
path.setAttribute('fill', options.fillColor || options.color);
|
|
285
|
+
path.setAttribute('fill-opacity', options.fillOpacity);
|
|
286
|
+
path.setAttribute('fill-rule', options.fillRule || 'evenodd');
|
|
287
|
+
} else {
|
|
288
|
+
path.setAttribute('fill', options.color);
|
|
289
|
+
}
|
|
290
|
+
} else {
|
|
291
|
+
path.setAttribute('fill', 'none');
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Sets the d attribute of a path
|
|
297
|
+
* @param {HTMLElement} path - The path that is being updated
|
|
298
|
+
* @param {string} def - The new d attribute of the path
|
|
299
|
+
* @private
|
|
300
|
+
*/
|
|
301
|
+
_setPath: function (path, def) {
|
|
302
|
+
path.setAttribute('d', def);
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Generates the d string of a feature part
|
|
307
|
+
* @param {Point[]} rings - The points making up a given part of a feature
|
|
308
|
+
* @param {boolean} closed - Whether a feature is closed or not
|
|
309
|
+
* @returns {string}
|
|
310
|
+
*/
|
|
311
|
+
geometryToPath: function (rings, closed) {
|
|
312
|
+
let str = '',
|
|
313
|
+
i,
|
|
314
|
+
j,
|
|
315
|
+
len,
|
|
316
|
+
len2,
|
|
317
|
+
points,
|
|
318
|
+
p;
|
|
319
|
+
|
|
320
|
+
for (i = 0, len = rings.length; i < len; i++) {
|
|
321
|
+
points = rings[i];
|
|
322
|
+
if (points.length === 1) {
|
|
323
|
+
return this._pointToMarker(points[0]);
|
|
324
|
+
}
|
|
325
|
+
for (j = 0, len2 = points.length; j < len2; j++) {
|
|
326
|
+
p = points[j];
|
|
327
|
+
str += (j ? 'L' : 'M') + p.x + ' ' + p.y;
|
|
328
|
+
}
|
|
329
|
+
str += closed ? 'z' : '';
|
|
330
|
+
}
|
|
331
|
+
return str || 'M0 0';
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Returns new FeatureRenderer
|
|
337
|
+
* @param {Object} options - Options for the renderer
|
|
338
|
+
* @returns {FeatureRenderer}
|
|
339
|
+
*/
|
|
340
|
+
export var featureRenderer = function (options) {
|
|
341
|
+
return new FeatureRenderer(options);
|
|
342
|
+
};
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { FeatureGroup, DomUtil, DomEvent, bounds } from 'leaflet';
|
|
2
|
+
|
|
3
|
+
import { Path, path } from './path.js';
|
|
4
|
+
|
|
5
|
+
export var Geometry = FeatureGroup.extend({
|
|
6
|
+
/**
|
|
7
|
+
* Initialize the feature group
|
|
8
|
+
* @param {M.Path[]} layers
|
|
9
|
+
* @param {Object} options
|
|
10
|
+
*/
|
|
11
|
+
initialize: function (layers, options) {
|
|
12
|
+
if (options.wrappers && options.wrappers.length > 0)
|
|
13
|
+
options = Object.assign(
|
|
14
|
+
Path.prototype._convertWrappers(options.wrappers),
|
|
15
|
+
options
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
FeatureGroup.prototype.initialize.call(this, layers, options);
|
|
19
|
+
this._featureEl = this.options.mapmlFeature;
|
|
20
|
+
|
|
21
|
+
this.layerBounds = options.layerBounds;
|
|
22
|
+
this.zoomBounds = options.zoomBounds;
|
|
23
|
+
|
|
24
|
+
let firstLayer = layers[Object.keys(layers)[0]];
|
|
25
|
+
if (layers.length === 1 && firstLayer.options.link)
|
|
26
|
+
this.options.link = firstLayer.options.link;
|
|
27
|
+
if (
|
|
28
|
+
(this.options.onEachFeature && this.options.properties) ||
|
|
29
|
+
this.options.link
|
|
30
|
+
) {
|
|
31
|
+
DomUtil.addClass(this.options.group, 'leaflet-interactive');
|
|
32
|
+
if (this.options.link) {
|
|
33
|
+
Path.prototype.attachLinkHandler.call(
|
|
34
|
+
this,
|
|
35
|
+
this.options.group,
|
|
36
|
+
this.options.link,
|
|
37
|
+
this.options._leafletLayer
|
|
38
|
+
);
|
|
39
|
+
this.options.group.setAttribute('role', 'link');
|
|
40
|
+
} else {
|
|
41
|
+
this.options.group.setAttribute('aria-expanded', 'false');
|
|
42
|
+
this.options.group.setAttribute('role', 'button');
|
|
43
|
+
this.options.onEachFeature(this.options.properties, this);
|
|
44
|
+
this.off('click', this._openPopup);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
DomEvent.on(this.options.group, 'keyup keydown', this._handleFocus, this);
|
|
49
|
+
this.options.group.setAttribute('aria-label', this.options.accessibleTitle);
|
|
50
|
+
if (this.options.featureID)
|
|
51
|
+
this.options.group.setAttribute('data-fid', this.options.featureID);
|
|
52
|
+
for (let feature of layers) {
|
|
53
|
+
feature._groupLayer = this;
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
onAdd: function (map) {
|
|
58
|
+
FeatureGroup.prototype.onAdd.call(this, map);
|
|
59
|
+
this.updateInteraction();
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
updateInteraction: function () {
|
|
63
|
+
let map = this._map || this.options._leafletLayer._map;
|
|
64
|
+
if (this.options.onEachFeature || this.options.link)
|
|
65
|
+
map.featureIndex.addToIndex(
|
|
66
|
+
this,
|
|
67
|
+
this.getPCRSCenter(),
|
|
68
|
+
this.options.group
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
for (let layerID in this._layers) {
|
|
72
|
+
let layer = this._layers[layerID];
|
|
73
|
+
for (let part of layer._parts) {
|
|
74
|
+
if (layer.featureAttributes && layer.featureAttributes.tabindex)
|
|
75
|
+
map.featureIndex.addToIndex(layer, layer.getPCRSCenter(), part.path);
|
|
76
|
+
for (let subPart of part.subrings) {
|
|
77
|
+
if (subPart.attr && subPart.attr.tabindex)
|
|
78
|
+
map.featureIndex.addToIndex(layer, subPart.center, subPart.path);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Check whether the feature group should be rendered at current map zoom level
|
|
86
|
+
* @param {Number} zoom - current map zoom
|
|
87
|
+
* @param {Object} vectorMinZoom - the minimum zoom bound of vector layer
|
|
88
|
+
* @param {Object} vectorMaxZoom - the maximum zoom bound of vector layer
|
|
89
|
+
* @returns {Boolean}
|
|
90
|
+
* @private
|
|
91
|
+
*/
|
|
92
|
+
_checkRender: function (zoom, vectorMinZoom, vectorMaxZoom) {
|
|
93
|
+
let minZoom = this._featureEl.min,
|
|
94
|
+
maxZoom = this._featureEl.max;
|
|
95
|
+
// if the current map zoom falls below/above the zoom bounds of the vector layer
|
|
96
|
+
if (zoom > vectorMaxZoom || zoom < vectorMinZoom) return false;
|
|
97
|
+
// if the current map zoom falls below/above the [min, max] range
|
|
98
|
+
if (
|
|
99
|
+
(minZoom !== null && zoom < +minZoom) ||
|
|
100
|
+
(maxZoom !== null && zoom > +maxZoom)
|
|
101
|
+
) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
return true;
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Handler for focus events
|
|
109
|
+
* @param {DOMEvent} e - Event that occurred
|
|
110
|
+
* @private
|
|
111
|
+
*/
|
|
112
|
+
_handleFocus: function (e) {
|
|
113
|
+
// tab, shift, cr, esc, up, left, down, right,
|
|
114
|
+
if (
|
|
115
|
+
[9, 16, 27, 37, 38, 39, 40].includes(e.keyCode) &&
|
|
116
|
+
e.type === 'keydown'
|
|
117
|
+
) {
|
|
118
|
+
let index = this._map.featureIndex.currentIndex;
|
|
119
|
+
// Down/right arrow keys replicate tabbing through the feature index
|
|
120
|
+
// Up/left arrow keys replicate shift-tabbing through the feature index
|
|
121
|
+
if (e.keyCode === 37 || e.keyCode === 38) {
|
|
122
|
+
DomEvent.stop(e);
|
|
123
|
+
this._map.featureIndex.inBoundFeatures[index].path.setAttribute(
|
|
124
|
+
'tabindex',
|
|
125
|
+
-1
|
|
126
|
+
);
|
|
127
|
+
if (index === 0) {
|
|
128
|
+
this._map.featureIndex.inBoundFeatures[
|
|
129
|
+
this._map.featureIndex.inBoundFeatures.length - 1
|
|
130
|
+
].path.focus();
|
|
131
|
+
this._map.featureIndex.currentIndex =
|
|
132
|
+
this._map.featureIndex.inBoundFeatures.length - 1;
|
|
133
|
+
} else {
|
|
134
|
+
this._map.featureIndex.inBoundFeatures[index - 1].path.focus();
|
|
135
|
+
this._map.featureIndex.currentIndex--;
|
|
136
|
+
}
|
|
137
|
+
} else if (e.keyCode === 39 || e.keyCode === 40) {
|
|
138
|
+
DomEvent.stop(e);
|
|
139
|
+
this._map.featureIndex.inBoundFeatures[index].path.setAttribute(
|
|
140
|
+
'tabindex',
|
|
141
|
+
-1
|
|
142
|
+
);
|
|
143
|
+
if (index === this._map.featureIndex.inBoundFeatures.length - 1) {
|
|
144
|
+
this._map.featureIndex.inBoundFeatures[0].path.focus();
|
|
145
|
+
this._map.featureIndex.currentIndex = 0;
|
|
146
|
+
} else {
|
|
147
|
+
this._map.featureIndex.inBoundFeatures[index + 1].path.focus();
|
|
148
|
+
this._map.featureIndex.currentIndex++;
|
|
149
|
+
}
|
|
150
|
+
} else if (e.keyCode === 27) {
|
|
151
|
+
let shadowRoot = this._map.options.mapEl.shadowRoot
|
|
152
|
+
? this._map.options.mapEl.shadowRoot
|
|
153
|
+
: this._map.options.mapEl.querySelector('.mapml-web-map').shadowRoot;
|
|
154
|
+
if (shadowRoot.activeElement.nodeName !== 'g') return;
|
|
155
|
+
this._map._container.focus();
|
|
156
|
+
} else if (e.keyCode === 9) {
|
|
157
|
+
let obj = this;
|
|
158
|
+
setTimeout(function () {
|
|
159
|
+
obj._map.featureIndex.inBoundFeatures[0].path.setAttribute(
|
|
160
|
+
'tabindex',
|
|
161
|
+
0
|
|
162
|
+
);
|
|
163
|
+
}, 0);
|
|
164
|
+
}
|
|
165
|
+
// tab, shift, cr, esc, right, left, up, down,
|
|
166
|
+
// 1, 2, 3, 4, 5, 6, 7 (featureIndexOverlay available index items
|
|
167
|
+
// [8, 9] being allocated to next, previous menu items).
|
|
168
|
+
} else if (
|
|
169
|
+
![9, 16, 13, 27, 37, 38, 39, 40, 49, 50, 51, 52, 53, 54, 55].includes(
|
|
170
|
+
e.keyCode
|
|
171
|
+
)
|
|
172
|
+
) {
|
|
173
|
+
this._map.featureIndex.currentIndex = 0;
|
|
174
|
+
this._map.featureIndex.inBoundFeatures[0].path.focus();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// 27 added so that the tooltip opens when dismissing popup with 'esc' key
|
|
178
|
+
if (e.target.tagName.toUpperCase() !== 'G') return;
|
|
179
|
+
if (
|
|
180
|
+
[9, 13, 16, 37, 38, 39, 40, 49, 50, 51, 52, 53, 54, 55, 27].includes(
|
|
181
|
+
e.keyCode
|
|
182
|
+
) &&
|
|
183
|
+
e.type === 'keyup'
|
|
184
|
+
) {
|
|
185
|
+
this.openTooltip();
|
|
186
|
+
} else if (e.keyCode === 13 || e.keyCode === 32) {
|
|
187
|
+
this.closeTooltip();
|
|
188
|
+
if (!this.options.link && this.options.onEachFeature) {
|
|
189
|
+
DomEvent.stop(e);
|
|
190
|
+
this.openPopup();
|
|
191
|
+
}
|
|
192
|
+
} else {
|
|
193
|
+
this.closeTooltip();
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Add a Path to the Geometry
|
|
199
|
+
* @param layer
|
|
200
|
+
*/
|
|
201
|
+
addLayer: function (layer) {
|
|
202
|
+
if (!layer.options.link && layer.options.interactive) {
|
|
203
|
+
this.options.onEachFeature(this.options.properties, layer);
|
|
204
|
+
}
|
|
205
|
+
FeatureGroup.prototype.addLayer.call(this, layer);
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Focuses the previous function in the sequence on previous button press
|
|
210
|
+
* @param e
|
|
211
|
+
* @private
|
|
212
|
+
*/
|
|
213
|
+
_previousFeature: function (e) {
|
|
214
|
+
DomEvent.stop(e);
|
|
215
|
+
this._map.featureIndex.currentIndex = Math.max(
|
|
216
|
+
this._map.featureIndex.currentIndex - 1,
|
|
217
|
+
0
|
|
218
|
+
);
|
|
219
|
+
let prevFocus =
|
|
220
|
+
this._map.featureIndex.inBoundFeatures[
|
|
221
|
+
this._map.featureIndex.currentIndex
|
|
222
|
+
];
|
|
223
|
+
prevFocus.path.focus();
|
|
224
|
+
this._map.closePopup();
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Focuses next feature in sequence
|
|
229
|
+
* @param e
|
|
230
|
+
* @private
|
|
231
|
+
*/
|
|
232
|
+
_nextFeature: function (e) {
|
|
233
|
+
DomEvent.stop(e);
|
|
234
|
+
this._map.featureIndex.currentIndex = Math.min(
|
|
235
|
+
this._map.featureIndex.currentIndex + 1,
|
|
236
|
+
this._map.featureIndex.inBoundFeatures.length - 1
|
|
237
|
+
);
|
|
238
|
+
let nextFocus =
|
|
239
|
+
this._map.featureIndex.inBoundFeatures[
|
|
240
|
+
this._map.featureIndex.currentIndex
|
|
241
|
+
];
|
|
242
|
+
nextFocus.path.focus();
|
|
243
|
+
this._map.closePopup();
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
getPCRSCenter: function () {
|
|
247
|
+
let bnds;
|
|
248
|
+
for (let l in this._layers) {
|
|
249
|
+
let layer = this._layers[l];
|
|
250
|
+
if (!bnds) {
|
|
251
|
+
bnds = bounds(layer.getPCRSCenter(), layer.getPCRSCenter());
|
|
252
|
+
} else {
|
|
253
|
+
bnds.extend(layer.getPCRSCenter());
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return bnds.getCenter();
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Returns new Geometry
|
|
262
|
+
* @param {M.Path[]} layers - Layers belonging to feature group
|
|
263
|
+
* @param {Object} options - Options for the feature group
|
|
264
|
+
* @returns {Geometry}
|
|
265
|
+
*/
|
|
266
|
+
export var geometry = function (layers, options) {
|
|
267
|
+
return new Geometry(layers, options);
|
|
268
|
+
};
|