@defra/interactive-map 0.0.55-alpha → 0.0.57-alpha
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/assets/templates/style-switcher.njk +2 -2
- package/dist/esm/im-core.js +1 -1
- package/dist/esm/im-shell.js +1 -1
- package/dist/umd/im-core.js +1 -1
- package/dist/umd/index.js +1 -1
- package/docs/api/button-definition.md +11 -0
- package/docs/api/context.md +4 -0
- package/docs/api.md +20 -2
- package/docs/architecture/interactive-map.likec4 +4 -4
- package/docs/plugins/datasets.md +11 -0
- package/docs/plugins/draw.md +197 -35
- package/docs/plugins/interact.md +24 -1
- package/docs/plugins/search.md +2 -2
- package/docusaurus.config.cjs +25 -3
- package/govuk-prototype-kit.config.json +6 -7
- package/package.json +20 -23
- package/plugins/datasets/dist/esm/im-datasets-esri-adapter.js +1 -1
- package/plugins/datasets/dist/esm/im-datasets-ml-adapter.js +1 -1
- package/plugins/datasets/dist/esm/im-datasets-ol-adapter.js +1 -1
- package/plugins/datasets/dist/esm/im-datasets-plugin.js +1 -1
- package/plugins/datasets/dist/esm/index.js +1 -1
- package/plugins/datasets/dist/esm/mapboxStyleLayerAdapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-ol-adapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
- package/plugins/datasets/dist/umd/index.js +1 -1
- package/plugins/datasets/src/adapters/esri/esriLayerAdapter.js +18 -16
- package/plugins/datasets/src/adapters/esri/esriLayerAdapter.test.js +2 -2
- package/plugins/datasets/src/adapters/esri/registry/esriDataset.js +2 -3
- package/plugins/datasets/src/adapters/esri/registry/esriDataset.test.js +1 -1
- package/plugins/datasets/src/adapters/loadLayerAdapter.js +2 -20
- package/plugins/datasets/src/adapters/loadLayerAdapter.test.js +9 -9
- package/plugins/datasets/src/adapters/mapboxStyleLayerAdapter.js +7 -7
- package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.js +19 -19
- package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.test.js +1 -1
- package/plugins/datasets/src/adapters/maplibre/registry/mapLibreDataset.test.js +1 -1
- package/plugins/datasets/src/adapters/openlayers/canvasPatternStyle.test.js +2 -2
- package/plugins/datasets/src/adapters/openlayers/layerBuilders.test.js +1 -1
- package/plugins/datasets/src/adapters/openlayers/openlayersLayerAdapter.js +21 -21
- package/plugins/datasets/src/adapters/openlayers/openlayersLayerAdapter.test.js +5 -5
- package/plugins/datasets/src/adapters/openlayers/registry/openLayersDataset.js +2 -3
- package/plugins/datasets/src/adapters/openlayers/registry/openLayersDataset.test.js +2 -2
- package/plugins/datasets/src/api/getOpacity.js +1 -2
- package/plugins/datasets/src/api/getOpacity.test.js +9 -12
- package/plugins/datasets/src/api/getStyle.js +1 -2
- package/plugins/datasets/src/api/getStyle.test.js +5 -8
- package/plugins/datasets/src/api/removeDataset.js +2 -4
- package/plugins/datasets/src/api/removeDataset.test.js +5 -10
- package/plugins/datasets/src/api/setData.js +2 -4
- package/plugins/datasets/src/api/setData.test.js +6 -14
- package/plugins/datasets/src/api/setFeatureVisibility.js +1 -2
- package/plugins/datasets/src/api/setFeatureVisibility.test.js +8 -11
- package/plugins/datasets/src/components/LayersMenu/LayersMenu.jsx +1 -0
- package/plugins/datasets/src/components/LayersMenu/LayersMenuCheckbox.jsx +1 -3
- package/plugins/datasets/src/components/LayersMenu/LayersMenuCheckbox.test.jsx +13 -18
- package/plugins/datasets/src/index.js +2 -2
- package/plugins/datasets/src/index.test.js +8 -1
- package/plugins/datasets/src/initialise/DatasetsInit.jsx +37 -26
- package/plugins/datasets/src/initialise/DatasetsInit.test.jsx +120 -89
- package/plugins/datasets/src/initialise/initialiseDatasets.js +2 -3
- package/plugins/datasets/src/initialise/initialiseDatasets.test.js +23 -10
- package/plugins/datasets/src/manifest.js +53 -44
- package/plugins/datasets/src/manifest.test.js +36 -4
- package/plugins/datasets/src/reducers/pluginState.js +5 -5
- package/plugins/datasets/src/reducers/pluginState.test.js +21 -20
- package/plugins/datasets/src/registry/__mocks__/datasetRegistry.js +7 -6
- package/plugins/datasets/src/registry/createDataset.js +2 -2
- package/plugins/datasets/src/registry/dataset.js +9 -10
- package/plugins/datasets/src/registry/dataset.test.js +63 -64
- package/plugins/datasets/src/registry/datasetRegistry.js +39 -10
- package/plugins/datasets/src/registry/datasetRegistry.test.js +83 -1
- package/plugins/datasets/src/registry/globalDataset.js +9 -17
- package/plugins/datasets/src/registry/isVisibleWhen.js +9 -17
- package/plugins/datasets/src/registry/isVisibleWhen.test.js +27 -20
- package/plugins/datasets/src/registry/mapboxStyleDataset.test.js +26 -27
- package/plugins/datasets/src/utils/hasLayersMenu.js +13 -0
- package/plugins/datasets/src/utils/hasLayersMenu.test.js +25 -0
- package/plugins/draw/dist/esm/im-draw-ml-adapter.js +1 -1
- package/plugins/draw/dist/esm/im-draw-ol-adapter.js +1 -1
- package/plugins/draw/dist/esm/im-draw-plugin.js +1 -1
- package/plugins/draw/dist/esm/index.js +1 -1
- package/plugins/draw/dist/esm/liveDrawChecks.js +1 -1
- package/plugins/draw/dist/umd/im-draw-ml-adapter.js +1 -1
- package/plugins/draw/dist/umd/im-draw-ol-adapter.js +1 -1
- package/plugins/draw/dist/umd/im-draw-plugin.js +1 -1
- package/plugins/draw/dist/umd/index.js +1 -1
- package/plugins/draw/src/DrawInit.jsx +53 -29
- package/plugins/draw/src/DrawInit.test.jsx +105 -2
- package/plugins/draw/src/adapterEvents.js +78 -44
- package/plugins/draw/src/adapters/adapterContract.test.js +3 -3
- package/plugins/draw/src/adapters/maplibre/MaplibreDrawAdapter.js +18 -10
- package/plugins/draw/src/adapters/maplibre/MaplibreDrawAdapter.test.js +31 -22
- package/plugins/draw/src/adapters/maplibre/drawEvents.js +2 -1
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/clickHandlers.js +13 -12
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/clickHandlers.test.js +5 -5
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/undoHandlers.js +1 -1
- package/plugins/draw/src/adapters/maplibre/modes/drawMode/undoHandlers.test.js +2 -2
- package/plugins/draw/src/adapters/maplibre/modes/drawPointMode.js +6 -9
- package/plugins/draw/src/adapters/maplibre/modes/drawPointMode.test.js +4 -4
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointerHandlers.js +6 -9
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointerHandlers.test.js +1 -1
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/undoHandlers.js +8 -14
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode/undoHandlers.test.js +37 -8
- package/plugins/draw/src/adapters/maplibre/modes/editPointMode.js +11 -1
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/undoHandlers.js +14 -19
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/undoHandlers.test.js +41 -4
- package/plugins/draw/src/adapters/maplibre/modes/editVertexMode.js +12 -1
- package/plugins/draw/src/adapters/maplibre/utils/editModeEvents.js +3 -1
- package/plugins/draw/src/adapters/maplibre/utils/geometryValidation.js +9 -10
- package/plugins/draw/src/adapters/maplibre/utils/geometryValidation.test.js +5 -24
- package/plugins/draw/src/adapters/openlayers/OLDrawAdapter.js +10 -7
- package/plugins/draw/src/adapters/openlayers/OLDrawAdapter.test.js +12 -7
- package/plugins/draw/src/adapters/openlayers/core/OLDrawManager.js +5 -0
- package/plugins/draw/src/adapters/openlayers/core/OLDrawManager.test.js +7 -3
- package/plugins/draw/src/adapters/openlayers/core/styles.test.js +1 -1
- package/plugins/draw/src/adapters/openlayers/draw/DrawMode.js +11 -11
- package/plugins/draw/src/adapters/openlayers/draw/DrawMode.test.js +15 -15
- package/plugins/draw/src/adapters/openlayers/edit/EditMode.js +21 -28
- package/plugins/draw/src/adapters/openlayers/edit/EditMode.test.js +26 -5
- package/plugins/draw/src/adapters/openlayers/edit/selectionState.js +5 -6
- package/plugins/draw/src/adapters/openlayers/edit/selectionState.test.js +2 -12
- package/plugins/draw/src/adapters/openlayers/edit/undoOps.js +9 -0
- package/plugins/draw/src/adapters/openlayers/edit/undoOps.test.js +7 -0
- package/plugins/draw/src/adapters/openlayers/point/drawPointMode.js +6 -9
- package/plugins/draw/src/adapters/openlayers/point/drawPointMode.test.js +3 -3
- package/plugins/draw/src/adapters/openlayers/point/editPointMode.js +18 -9
- package/plugins/draw/src/adapters/openlayers/point/editPointMode.test.js +29 -4
- package/plugins/draw/src/adapters/openlayers/point/pointOps.js +3 -2
- package/plugins/draw/src/adapters/openlayers/point/pointOps.test.js +6 -0
- package/plugins/draw/src/adapters/openlayers/point/pointSelectionState.js +3 -4
- package/plugins/draw/src/adapters/openlayers/point/pointSelectionState.test.js +2 -12
- package/plugins/draw/src/adapters/openlayers/point/pointSymbolImages.test.js +1 -1
- package/plugins/draw/src/api/createNewShape.js +4 -4
- package/plugins/draw/src/api/createNewShape.test.js +1 -1
- package/plugins/draw/src/api/editFeature.js +8 -11
- package/plugins/draw/src/api/editFeature.test.js +33 -22
- package/plugins/draw/src/api/newLine.test.js +3 -3
- package/plugins/draw/src/api/newPoint.js +4 -5
- package/plugins/draw/src/api/newPoint.test.js +3 -3
- package/plugins/draw/src/api/newPolygon.test.js +3 -3
- package/plugins/draw/src/api/recheckGeometry.js +32 -0
- package/plugins/draw/src/api/recheckGeometry.test.js +55 -0
- package/plugins/draw/src/api/setGeometry.js +33 -0
- package/plugins/draw/src/api/setGeometry.test.js +48 -0
- package/plugins/draw/src/api/split.js +23 -22
- package/plugins/draw/src/api/split.test.js +33 -18
- package/plugins/draw/src/events.js +265 -77
- package/plugins/draw/src/events.test.js +708 -34
- package/plugins/draw/src/hooks/useSpatialList.js +10 -11
- package/plugins/draw/src/hooks/useSpatialList.test.js +3 -3
- package/plugins/draw/src/manifest.js +33 -17
- package/plugins/draw/src/manifest.test.js +104 -10
- package/plugins/draw/src/reducer.js +31 -9
- package/plugins/draw/src/reducer.test.js +35 -3
- package/plugins/draw/src/utils/drawModes.js +27 -0
- package/plugins/draw/src/utils/drawModes.test.js +27 -0
- package/plugins/draw/src/utils/needsDrawTarget.js +18 -0
- package/plugins/draw/src/utils/needsDrawTarget.test.js +32 -0
- package/plugins/draw/src/utils/touchTarget.js +34 -26
- package/plugins/draw/src/utils/touchTarget.test.js +32 -20
- package/plugins/draw/src/validation/commitChecks.js +185 -0
- package/plugins/draw/src/validation/commitChecks.test.js +205 -0
- package/plugins/draw/src/validation/liveDrawChecks.js +11 -11
- package/plugins/draw/src/validation/liveDrawChecks.test.js +37 -37
- package/plugins/draw/src/validation/liveStroke.js +6 -6
- package/plugins/draw/src/validation/liveStroke.test.js +27 -27
- package/plugins/draw/src/validation/rules.js +16 -14
- package/plugins/draw/src/validation/rules.test.js +5 -5
- package/plugins/draw/src/validation/validateGeometry.js +58 -31
- package/plugins/draw/src/validation/validateGeometry.test.js +68 -44
- package/plugins/draw-es/dist/esm/index.js +1 -0
- package/plugins/{beta/draw-es → draw-es}/src/DrawInit.jsx +1 -1
- package/plugins/{beta/draw-es → draw-es}/src/events.test.js +1 -1
- package/plugins/{beta/draw-es → draw-es}/src/graphic.js +1 -1
- package/plugins/frame/dist/esm/index.js +1 -0
- package/plugins/{beta/frame → frame}/dist/umd/im-frame-plugin.js +1 -1
- package/plugins/{beta/frame → frame}/dist/umd/index.js +1 -1
- package/plugins/{beta/frame → frame}/package.json +2 -2
- package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/esm/index.js +1 -1
- package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/index.js +1 -1
- package/plugins/interact/src/InteractInit.jsx +3 -3
- package/plugins/interact/src/api/enable.test.js +13 -0
- package/plugins/interact/src/defaults.js +1 -0
- package/plugins/interact/src/hooks/useCrossHairVisibility.js +27 -17
- package/plugins/interact/src/hooks/useCrossHairVisibility.test.js +72 -7
- package/plugins/interact/src/hooks/useInteractionHandlers.js +3 -5
- package/plugins/interact/src/hooks/useInteractionHandlers.test.js +4 -3
- package/plugins/interact/src/hooks/useSpatialList.js +16 -17
- package/plugins/interact/src/hooks/useSpatialList.test.js +9 -9
- package/plugins/interact/src/manifest.js +4 -4
- package/plugins/interact/src/manifest.test.js +29 -0
- package/plugins/interact/src/reducer.js +7 -2
- package/plugins/interact/src/reducer.test.js +12 -2
- package/plugins/interact/src/utils/needsTarget.js +20 -0
- package/plugins/interact/src/utils/needsTarget.test.js +36 -0
- package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -1
- package/plugins/map-key/dist/esm/index.js +1 -1
- package/plugins/map-key/dist/umd/im-map-key-plugin.js +1 -1
- package/plugins/map-key/dist/umd/index.js +1 -1
- package/plugins/map-key/src/components/Key/KeySvgSymbol.jsx +4 -0
- package/plugins/map-key/src/components/Key/MapKey.jsx +15 -15
- package/plugins/map-key/src/components/Key/MapKey.test.jsx +29 -15
- package/plugins/map-key/src/initialise/MapKeyInit.jsx +5 -8
- package/plugins/map-key/src/initialise/MapKeyInit.test.jsx +9 -7
- package/plugins/map-key/src/manifest.test.js +0 -1
- package/plugins/map-key/src/reducers/mergeKeyGroupItems.js +14 -33
- package/plugins/map-key/src/reducers/mergeKeyGroupItems.test.js +34 -50
- package/plugins/map-key/src/reducers/pluginState.js +6 -1
- package/plugins/map-key/src/reducers/pluginState.test.js +13 -4
- package/plugins/map-styles/dist/esm/im-map-styles-plugin.js +1 -0
- package/plugins/map-styles/dist/esm/index.js +1 -0
- package/plugins/map-styles/dist/umd/im-map-styles-plugin.js +1 -0
- package/plugins/{beta/map-styles → map-styles}/dist/umd/index.js +1 -1
- package/plugins/{beta/map-styles → map-styles}/src/MapStyles.jsx +3 -3
- package/plugins/{beta/map-styles → map-styles}/src/MapStylesInit.jsx +1 -1
- package/plugins/menu/dist/esm/index.js +1 -1
- package/plugins/scale-bar/dist/esm/index.js +1 -0
- package/plugins/{beta/scale-bar → scale-bar}/dist/umd/im-scale-bar-plugin.js +1 -1
- package/plugins/{beta/scale-bar → scale-bar}/dist/umd/index.js +1 -1
- package/plugins/{beta/scale-bar → scale-bar}/package.json +2 -2
- package/plugins/search/dist/esm/im-search-plugin.js +1 -1
- package/plugins/search/dist/esm/index.js +1 -1
- package/plugins/search/dist/umd/im-search-plugin.js +1 -1
- package/plugins/search/dist/umd/index.js +1 -1
- package/plugins/search/src/components/Suggestions/Suggestions.jsx +3 -1
- package/plugins/search/src/components/Suggestions/Suggestions.test.jsx +11 -0
- package/plugins/search/src/utils/markedToElements.jsx +25 -0
- package/plugins/search/src/utils/markedToElements.test.jsx +49 -0
- package/plugins/search/src/utils/parseOsNamesResults.js +6 -4
- package/plugins/search/src/utils/parseOsNamesResults.test.js +18 -0
- package/plugins/use-location/dist/esm/index.js +1 -0
- package/plugins/{beta/use-location → use-location}/dist/umd/im-use-location-plugin.js +1 -1
- package/plugins/{beta/use-location → use-location}/dist/umd/index.js +1 -1
- package/providers/esri/dist/esm/index.js +1 -0
- package/providers/{beta/esri → esri}/src/esriProvider.js +1 -1
- package/providers/{beta/esri → esri}/src/mapEvents.js +2 -2
- package/providers/maplibre/dist/esm/index.js +1 -1
- package/providers/maplibre/dist/umd/index.js +1 -1
- package/providers/maplibre/src/index.js +11 -2
- package/providers/maplibre/src/index.test.js +23 -1
- package/providers/maplibre/src/utils/detectModuleWorker.js +8 -19
- package/providers/maplibre/src/utils/detectModuleWorker.test.js +19 -23
- package/providers/maplibre/src/utils/workerUrl.js +12 -0
- package/providers/maplibre/src/utils/workerUrl.test.js +14 -1
- package/providers/open-names/dist/esm/index.js +1 -0
- package/providers/{beta/open-names → open-names}/dist/umd/im-reverse-geocode.js +1 -1
- package/providers/{beta/open-names → open-names}/dist/umd/index.js +1 -1
- package/providers/openlayers/dist/esm/index.js +1 -0
- package/providers/openlayers/dist/umd/im-openlayers-provider.js +2 -0
- package/providers/{beta/openlayers → openlayers}/dist/umd/index.js +1 -1
- package/providers/{beta/openlayers → openlayers}/src/index.js +4 -4
- package/providers/{beta/openlayers → openlayers}/src/mapEvents.js +2 -2
- package/providers/{beta/openlayers → openlayers}/src/mapEvents.test.js +2 -2
- package/providers/{beta/openlayers → openlayers}/src/openlayersProvider.js +3 -3
- package/providers/{beta/openlayers → openlayers}/src/utils/highlightFeatures.js +1 -1
- package/providers/{beta/openlayers → openlayers}/src/utils/patternImages.js +1 -1
- package/providers/{beta/openlayers → openlayers}/src/utils/symbolImages.js +1 -1
- package/rollup.esm.mjs +43 -47
- package/sonar-project.properties +1 -1
- package/src/App/App.jsx +4 -1
- package/src/App/App.test.jsx +6 -0
- package/src/App/components/MapButton/MapButton.jsx +6 -0
- package/src/App/components/MapButton/MapButton.test.jsx +10 -0
- package/src/App/components/Markers/Markers.jsx +3 -5
- package/src/App/components/Markers/Markers.test.jsx +9 -11
- package/src/App/components/Panel/Panel.jsx +2 -9
- package/src/App/hooks/useInterfaceAPI.js +16 -4
- package/src/App/hooks/useInterfaceAPI.test.js +66 -1
- package/src/App/renderer/PluginInits.jsx +8 -7
- package/src/App/renderer/PluginInits.test.jsx +20 -5
- package/src/App/renderer/SlotItemsProvider.jsx +33 -0
- package/src/App/renderer/SlotItemsProvider.test.jsx +59 -0
- package/src/App/renderer/SlotRenderer.jsx +3 -14
- package/src/App/renderer/SlotRenderer.test.jsx +11 -44
- package/src/App/renderer/mapButtons.js +24 -12
- package/src/App/renderer/mapButtons.test.js +32 -1
- package/src/App/renderer/mapControls.js +6 -8
- package/src/App/renderer/mapControls.test.js +10 -0
- package/src/App/renderer/mapPanels.js +16 -19
- package/src/App/renderer/mapPanels.test.js +37 -9
- package/src/App/renderer/pluginWrapper.js +10 -8
- package/src/App/renderer/pluginWrapper.test.js +23 -9
- package/src/App/renderer/slotAggregator.js +18 -5
- package/src/App/renderer/slotAggregator.test.js +68 -25
- package/src/App/renderer/slotHelpers.js +13 -0
- package/src/App/renderer/slotHelpers.test.js +16 -1
- package/src/App/store/AppProvider.jsx +19 -1
- package/src/App/store/AppProvider.test.jsx +41 -0
- package/src/App/store/MapProvider.jsx +3 -0
- package/src/App/store/MapProvider.test.jsx +24 -0
- package/src/App/store/appActionsMap.js +10 -1
- package/src/App/store/appActionsMap.test.js +21 -0
- package/src/App/store/appDispatchMiddleware.js +29 -17
- package/src/App/store/appDispatchMiddleware.test.js +31 -0
- package/src/InteractiveMap/parseDataProperties.js +4 -4
- package/src/InteractiveMap/parseDataProperties.test.js +62 -6
- package/src/config/events.js +4 -2
- package/src/config/mapSizeScales.js +3 -0
- package/src/scss/tools/_govuk-content.scss +4 -3
- package/src/types.js +4 -0
- package/src/utils/focusAfterPanelClose.js +9 -0
- package/src/utils/focusAfterPanelClose.test.js +40 -0
- package/webpack.dev.mjs +9 -3
- package/webpack.prod.mjs +11 -4
- package/webpack.umd.mjs +6 -7
- package/plugins/beta/draw-es/dist/esm/index.js +0 -1
- package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +0 -1
- package/plugins/beta/draw-ml/dist/esm/index.js +0 -1
- package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +0 -1
- package/plugins/beta/draw-ml/dist/umd/index.js +0 -2
- package/plugins/beta/draw-ml/src/DrawInit.jsx +0 -85
- package/plugins/beta/draw-ml/src/api/addFeature.js +0 -27
- package/plugins/beta/draw-ml/src/api/deleteFeature.js +0 -13
- package/plugins/beta/draw-ml/src/api/editFeature.js +0 -75
- package/plugins/beta/draw-ml/src/api/merge.js +0 -9
- package/plugins/beta/draw-ml/src/api/newLine.js +0 -68
- package/plugins/beta/draw-ml/src/api/newPolygon.js +0 -68
- package/plugins/beta/draw-ml/src/api/split.js +0 -81
- package/plugins/beta/draw-ml/src/defaults.js +0 -17
- package/plugins/beta/draw-ml/src/draw.scss +0 -26
- package/plugins/beta/draw-ml/src/events.js +0 -185
- package/plugins/beta/draw-ml/src/index.js +0 -13
- package/plugins/beta/draw-ml/src/manifest.js +0 -110
- package/plugins/beta/draw-ml/src/mapboxDraw.js +0 -143
- package/plugins/beta/draw-ml/src/mapboxSnap.js +0 -321
- package/plugins/beta/draw-ml/src/modes/createDrawMode.js +0 -552
- package/plugins/beta/draw-ml/src/modes/disabledMode.js +0 -23
- package/plugins/beta/draw-ml/src/modes/drawLineMode.js +0 -18
- package/plugins/beta/draw-ml/src/modes/drawPolygonMode.js +0 -16
- package/plugins/beta/draw-ml/src/modes/editVertex/geometryHelpers.js +0 -135
- package/plugins/beta/draw-ml/src/modes/editVertex/helpers.js +0 -2
- package/plugins/beta/draw-ml/src/modes/editVertex/touchHandlers.js +0 -142
- package/plugins/beta/draw-ml/src/modes/editVertex/undoHandlers.js +0 -133
- package/plugins/beta/draw-ml/src/modes/editVertex/vertexOperations.js +0 -142
- package/plugins/beta/draw-ml/src/modes/editVertex/vertexQueries.js +0 -121
- package/plugins/beta/draw-ml/src/modes/editVertexMode.js +0 -495
- package/plugins/beta/draw-ml/src/reducer.js +0 -90
- package/plugins/beta/draw-ml/src/styles.js +0 -190
- package/plugins/beta/draw-ml/src/undoStack.js +0 -50
- package/plugins/beta/draw-ml/src/utils/debounce.js +0 -16
- package/plugins/beta/draw-ml/src/utils/flattenStyleProperties.js +0 -49
- package/plugins/beta/draw-ml/src/utils/snapHelpers.js +0 -200
- package/plugins/beta/draw-ml/src/utils/spatial.js +0 -258
- package/plugins/beta/draw-ol/dist/css/index.css +0 -1
- package/plugins/beta/draw-ol/dist/esm/DrawMode.js +0 -1
- package/plugins/beta/draw-ol/dist/esm/EditMode.js +0 -1
- package/plugins/beta/draw-ol/dist/esm/geometryHelpers.js +0 -1
- package/plugins/beta/draw-ol/dist/esm/im-draw-ol-plugin.js +0 -1
- package/plugins/beta/draw-ol/dist/esm/index.js +0 -1
- package/plugins/beta/draw-ol/src/DrawInit.jsx +0 -65
- package/plugins/beta/draw-ol/src/api/addFeature.js +0 -29
- package/plugins/beta/draw-ol/src/api/deleteFeature.js +0 -11
- package/plugins/beta/draw-ol/src/api/editFeature.js +0 -50
- package/plugins/beta/draw-ol/src/api/newLine.js +0 -44
- package/plugins/beta/draw-ol/src/api/newPolygon.js +0 -44
- package/plugins/beta/draw-ol/src/core/OLDrawManager.js +0 -153
- package/plugins/beta/draw-ol/src/core/featureStore.js +0 -65
- package/plugins/beta/draw-ol/src/core/styles.js +0 -98
- package/plugins/beta/draw-ol/src/core/undoStack.js +0 -31
- package/plugins/beta/draw-ol/src/defaults.js +0 -16
- package/plugins/beta/draw-ol/src/draw/DrawMode.js +0 -121
- package/plugins/beta/draw-ol/src/draw/drawInput.js +0 -243
- package/plugins/beta/draw-ol/src/draw.scss +0 -17
- package/plugins/beta/draw-ol/src/edit/EditMode.js +0 -424
- package/plugins/beta/draw-ol/src/edit/keyboardHandler.js +0 -229
- package/plugins/beta/draw-ol/src/edit/midpointLayer.js +0 -57
- package/plugins/beta/draw-ol/src/edit/touchHandler.js +0 -171
- package/plugins/beta/draw-ol/src/edit/undoOps.js +0 -95
- package/plugins/beta/draw-ol/src/edit/vertexHitTest.js +0 -72
- package/plugins/beta/draw-ol/src/edit/vertexLayer.js +0 -49
- package/plugins/beta/draw-ol/src/edit/vertexOps.js +0 -99
- package/plugins/beta/draw-ol/src/events.js +0 -114
- package/plugins/beta/draw-ol/src/index.js +0 -12
- package/plugins/beta/draw-ol/src/manifest.js +0 -125
- package/plugins/beta/draw-ol/src/olDraw.js +0 -38
- package/plugins/beta/draw-ol/src/reducer.js +0 -41
- package/plugins/beta/draw-ol/src/snap/snapEngine.js +0 -153
- package/plugins/beta/draw-ol/src/snap/snapGeometry.js +0 -177
- package/plugins/beta/draw-ol/src/snap/snapIndicator.js +0 -81
- package/plugins/beta/draw-ol/src/snap/snapInteraction.js +0 -57
- package/plugins/beta/draw-ol/src/snap/snapManager.js +0 -99
- package/plugins/beta/draw-ol/src/utils/flattenStyleProperties.js +0 -47
- package/plugins/beta/draw-ol/src/utils/geometryHelpers.js +0 -103
- package/plugins/beta/draw-ol/src/utils/olCoords.js +0 -35
- package/plugins/beta/draw-ol/src/utils/resolveColors.js +0 -39
- package/plugins/beta/draw-ol/src/utils/spatial.js +0 -24
- package/plugins/beta/draw-ol/src/utils/touchTarget.js +0 -61
- package/plugins/beta/frame/dist/esm/index.js +0 -1
- package/plugins/beta/map-styles/dist/esm/im-map-styles-plugin.js +0 -1
- package/plugins/beta/map-styles/dist/esm/index.js +0 -1
- package/plugins/beta/map-styles/dist/umd/im-map-styles-plugin.js +0 -1
- package/plugins/beta/scale-bar/dist/esm/index.js +0 -1
- package/plugins/beta/use-location/dist/esm/index.js +0 -1
- package/plugins/map-key/src/registry/getDatasetRegistry.js +0 -6
- package/plugins/map-key/src/registry/getDatasetRegistry.test.js +0 -23
- package/plugins/map-key/src/registry/index.js +0 -1
- package/plugins/map-key/src/registry/index.test.js +0 -7
- package/providers/beta/esri/dist/esm/index.js +0 -1
- package/providers/beta/open-names/dist/esm/index.js +0 -1
- package/providers/beta/openlayers/dist/esm/index.js +0 -1
- package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +0 -2
- package/providers/beta/openlayers/dist/umd/index.js.LICENSE.txt +0 -1
- /package/plugins/{beta/draw-es → draw-es}/dist/esm/im-draw-es-plugin.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/api/addFeature.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/api/deleteFeature.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/api/editFeature.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/api/newPolygon.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/api/removeSafeZone.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/events.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/index.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/manifest.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/reducer.js +0 -0
- /package/plugins/{beta/draw-es → draw-es}/src/sketchViewModel.js +0 -0
- /package/plugins/{beta/frame → frame}/dist/css/index.css +0 -0
- /package/plugins/{beta/frame → frame}/dist/esm/im-frame-plugin.js +0 -0
- /package/plugins/{beta/draw-ml → frame}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{beta/frame → frame}/src/Frame.jsx +0 -0
- /package/plugins/{beta/frame → frame}/src/FrameInit.jsx +0 -0
- /package/plugins/{beta/frame → frame}/src/api/addFrame.js +0 -0
- /package/plugins/{beta/frame → frame}/src/api/editFeature.js +0 -0
- /package/plugins/{beta/frame → frame}/src/config.js +0 -0
- /package/plugins/{beta/frame → frame}/src/frame.scss +0 -0
- /package/plugins/{beta/frame → frame}/src/index.js +0 -0
- /package/plugins/{beta/frame → frame}/src/manifest.js +0 -0
- /package/plugins/{beta/frame → frame}/src/reducer.js +0 -0
- /package/plugins/{beta/frame → frame}/src/utils.js +0 -0
- /package/plugins/{beta/map-styles → map-styles}/dist/css/index.css +0 -0
- /package/plugins/{beta/frame → map-styles}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{beta/map-styles → map-styles}/src/config.js +0 -0
- /package/plugins/{beta/map-styles → map-styles}/src/index.js +0 -0
- /package/plugins/{beta/map-styles → map-styles}/src/manifest.js +0 -0
- /package/plugins/{beta/map-styles → map-styles}/src/mapStyles.scss +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/dist/css/index.css +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/dist/esm/im-scale-bar-plugin.js +0 -0
- /package/plugins/{beta/map-styles → scale-bar}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/ScaleBar.jsx +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/ScaleBar.test.jsx +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/index.js +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/index.test.js +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/manifest.js +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/scaleBar.scss +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/utils.js +0 -0
- /package/plugins/{beta/scale-bar → scale-bar}/src/utils.test.js +0 -0
- /package/plugins/{beta/use-location → use-location}/dist/esm/im-use-location-plugin.js +0 -0
- /package/plugins/{beta/scale-bar → use-location}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/plugins/{beta/use-location → use-location}/src/UseLocation.jsx +0 -0
- /package/plugins/{beta/use-location → use-location}/src/UseLocationInit.jsx +0 -0
- /package/plugins/{beta/use-location → use-location}/src/defaults.js +0 -0
- /package/plugins/{beta/use-location → use-location}/src/events.js +0 -0
- /package/plugins/{beta/use-location → use-location}/src/index.js +0 -0
- /package/plugins/{beta/use-location → use-location}/src/manifest.js +0 -0
- /package/plugins/{beta/use-location → use-location}/src/reducer.js +0 -0
- /package/providers/{beta/esri → esri}/dist/css/index.css +0 -0
- /package/providers/{beta/esri → esri}/dist/esm/im-esri-provider.js +0 -0
- /package/providers/{beta/esri → esri}/src/appEvents.js +0 -0
- /package/providers/{beta/esri → esri}/src/defaults.js +0 -0
- /package/providers/{beta/esri → esri}/src/esriProvider.scss +0 -0
- /package/providers/{beta/esri → esri}/src/index.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/coords.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/coords.test.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/detectWebGL.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/esriFixes.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/query.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/spatial.js +0 -0
- /package/providers/{beta/esri → esri}/src/utils/spatial.test.js +0 -0
- /package/providers/{beta/open-names → open-names}/dist/esm/im-reverse-geocode.js +0 -0
- /package/providers/{beta/open-names → open-names}/dist/umd/im-reverse-geocode.js.LICENSE.txt +0 -0
- /package/{plugins/beta/use-location → providers/open-names}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/providers/{beta/open-names → open-names}/src/index.js +0 -0
- /package/providers/{beta/open-names → open-names}/src/reverseGeocode.js +0 -0
- /package/providers/{beta/open-names → open-names}/src/utils/mapToLocationModel.js +0 -0
- /package/providers/{beta/open-names → open-names}/src/utils/mapToLocationModel.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/dist/esm/im-openlayers-provider.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/dist/umd/im-openlayers-provider.js.LICENSE.txt +0 -0
- /package/providers/{beta/open-names → openlayers}/dist/umd/index.js.LICENSE.txt +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/appEvents.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/appEvents.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/defaults.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/index.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/openlayersProvider.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/bngProjection.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/filterEvaluator.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/filterEvaluator.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/highlightFeatures.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/hoverCursor.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/hoverCursor.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/openLayersFixes.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/openLayersFixes.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/patternImages.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/queryFeatures.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/queryFeatures.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/spatial.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/spatial.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/symbolImages.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/tileLayers.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/tileLayers.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/vtTileFragments.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/vtTileFragments.test.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/zoom.js +0 -0
- /package/providers/{beta/openlayers → openlayers}/src/utils/zoom.test.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see im-reverse-geocode.js.LICENSE.txt */
|
|
2
|
-
"use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[627],{863:function(t,e,r){r.r(e),r.d(e,{reverseGeocode:function(){return E}});let n=" ";class i{static get separator(){return n}static set separator(t){n=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,a=null,o=null,s=null;switch(e){default:case"d":case"deg":a=t.toFixed(r),a<100&&(a="0"+a),a<10&&(a="0"+a),n=a+"°";break;case"dm":case"deg+min":a=Math.floor(t),o=(60*t%60).toFixed(r),60==o&&(o=(0).toFixed(r),a++),a=("000"+a).slice(-3),o<10&&(o="0"+o),n=a+"°"+i.separator+o+"′";break;case"dms":case"deg+min+sec":a=Math.floor(t),o=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(r),60==s&&(s=(0).toFixed(r),o++),60==o&&(o=0,a++),a=("000"+a).slice(-3),o=("00"+o).slice(-2),s<10&&(s="0"+s),n=a+"°"+i.separator+o+"′"+i.separator+s+"″"}return n}static toLat(t,e,r){const n=i.toDms(i.wrap90(t),e,r);return null===n?"–":n.slice(1)+i.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=i.toDms(i.wrap180(t),e,r);return null===n?"–":n+i.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=i.toDms(i.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=i.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var a=i;class o{constructor(t,e,r){if(isNaN(t)||isNaN(e)||isNaN(r))throw new TypeError(`invalid vector [${t},${e},${r}]`);this.x=Number(t),this.y=Number(e),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");return new o(this.x+t.x,this.y+t.y,this.z+t.z)}minus(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");return new o(this.x-t.x,this.y-t.y,this.z-t.z)}times(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new o(this.x*t,this.y*t,this.z*t)}dividedBy(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new o(this.x/t,this.y/t,this.z/t)}dot(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");const e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,n=this.x*t.y-this.y*t.x;return new o(e,r,n)}negate(){return new o(-this.x,-this.y,-this.z)}unit(){const t=this.length;if(1==t)return this;if(0==t)return this;const e=this.x/t,r=this.y/t,n=this.z/t;return new o(e,r,n)}angleTo(t,e=void 0){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");if(!(e instanceof o||null==e))throw new TypeError("n is not Vector3d object");const r=null==e||this.cross(t).dot(e)>=0?1:-1,n=this.cross(t).length*r,i=this.dot(t);return Math.atan2(n,i)}rotateAround(t,e){if(!(t instanceof o))throw new TypeError("axis is not Vector3d object");const r=e.toRadians(),n=this.unit(),i=t.unit(),a=Math.sin(r),s=Math.cos(r),l=1-s,c=i.x,u=i.y,h=i.z,d=[[l*c*c+s,l*c*u-a*h,l*c*h+a*u],[l*c*u+a*h,l*u*u+s,l*u*h-a*c],[l*c*h-a*u,l*u*h+a*c,l*h*h+s]],p=[d[0][0]*n.x+d[0][1]*n.y+d[0][2]*n.z,d[1][0]*n.x+d[1][1]*n.y+d[1][2]*n.z,d[2][0]*n.x+d[2][1]*n.y+d[2][2]*n.z];return new o(p[0],p[1],p[2])}toString(t=3){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var s=o;const l={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},c={WGS84:{ellipsoid:l.WGS84}};Object.freeze(l.WGS84),Object.freeze(c.WGS84);class u{constructor(t,e,r=0){if(isNaN(t)||null==t)throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e)||null==e)throw new TypeError(`invalid lon ‘${e}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=a.wrap90(Number(t)),this._lon=a.wrap180(Number(e)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?a.wrap90(a.parse(t)):a.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?a.wrap90(a.parse(t)):a.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?a.wrap180(a.parse(t)):a.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?a.wrap180(a.parse(t)):a.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?a.wrap180(a.parse(t)):a.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}get height(){return this._height}set height(t){if(this._height=Number(t),isNaN(this._height))throw new TypeError(`invalid height ‘${t}’`)}get datum(){return this._datum}set datum(t){this._datum=t}static get ellipsoids(){return l}static get datums(){return c}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");let e,r,n;if("object"==typeof t[0]&&(1==t.length||!isNaN(parseFloat(t[1])))){const i=t[0];if("Point"==i.type&&Array.isArray(i.coordinates)?([r,e,n]=i.coordinates,n=n||0):(null!=i.latitude&&(e=i.latitude),null!=i.lat&&(e=i.lat),null!=i.longitude&&(r=i.longitude),null!=i.lng&&(r=i.lng),null!=i.lon&&(r=i.lon),null!=i.height&&(n=i.height),e=a.wrap90(a.parse(e)),r=a.wrap180(a.parse(r))),null!=t[1]&&(n=t[1]),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if("string"==typeof t[0]&&2==t[0].split(",").length&&([e,r]=t[0].split(","),e=a.wrap90(a.parse(e)),r=a.wrap180(a.parse(r)),n=t[1]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(null==e&&null==r&&([e,r]=t,e=a.wrap90(a.parse(e)),r=a.wrap180(a.parse(r)),n=t[2]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);return new this(e,r,n)}toCartesian(){const t=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:l.WGS84,e=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:i,f:a}=t,o=Math.sin(e),s=Math.cos(e),c=Math.sin(r),u=Math.cos(r),d=2*a-a*a,p=i/Math.sqrt(1-d*o*o);return new h((p+n)*s*u,(p+n)*s*c,(p*(1-d)+n)*o)}equals(t){if(!(t instanceof u))throw new TypeError(`invalid point ‘${t}’`);return!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON||Math.abs(this.height-t.height)>Number.EPSILON||this.datum!=t.datum||this.referenceFrame!=t.referenceFrame||this.epoch!=t.epoch)}toString(t="d",e=void 0,r=null){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)}, ${this.lon.toFixed(e)}${null==r?"":n}`):`${a.toLat(this.lat,t,e)}, ${a.toLon(this.lon,t,e)}${null==r?"":n}`}}class h extends s{constructor(t,e,r){super(t,e,r)}toLatLon(t=l.WGS84){if(!t||!t.a)throw new TypeError(`invalid ellipsoid ‘${t}’`);const{x:e,y:r,z:n}=this,{a:i,b:a,f:o}=t,s=2*o-o*o,c=s/(1-s),h=Math.sqrt(e*e+r*r),d=a*n/(i*h)*(1+c*a/Math.sqrt(h*h+n*n)),p=d/Math.sqrt(1+d*d),f=p/d,m=isNaN(f)?0:Math.atan2(n+c*a*p*p*p,h-s*i*f*f*f),g=Math.atan2(r,e),y=Math.sin(m),w=h*Math.cos(m)+n*y-i*i/(i/Math.sqrt(1-s*y*y));return new u(m.toDegrees(),g.toDegrees(),w)}toString(t=0){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}const d={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},p={ED50:{ellipsoid:d.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:d.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:d.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:d.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:d.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:d.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:d.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:d.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:d.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:d.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:d.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(d).forEach(t=>Object.freeze(d[t])),Object.keys(p).forEach(t=>{Object.freeze(p[t]),Object.freeze(p[t].transform)});class f extends u{constructor(t,e,r=0,n=p.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return d}static get datums(){return p}static parse(...t){let e=p.WGS84;if((4==t.length||3==t.length&&"object"==typeof t[2])&&(e=t.pop()),!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.parse(...t);return r._datum=e,r}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);return this.toCartesian().convertDatum(t).toLatLon()}toCartesian(){const t=super.toCartesian();return new m(t.x,t.y,t.z,this.datum)}}class m extends h{constructor(t,e,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);this._datum=t}toLatLon(t=void 0){t&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=t);const e=this.datum||p.WGS84;if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.toLatLon(e.ellipsoid);return new f(r.lat,r.lon,r.height,this.datum)}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let e=null,r=null;null!=this.datum&&this.datum!=p.WGS84||(e=this,r=t.transform),t==p.WGS84&&(e=this,r=this.datum.transform.map(t=>-t)),null==r&&(e=this.convertDatum(p.WGS84),r=t.transform);const n=e.applyTransform(r);return n.datum=t,n}applyTransform(t){const{x:e,y:r,z:n}=this,i=t[0],a=t[1],o=t[2],s=t[3]/1e6+1,l=(t[4]/3600).toRadians(),c=(t[5]/3600).toRadians(),u=(t[6]/3600).toRadians();return new m(i+e*s-r*u+n*c,a+e*u+r*s-n*l,o-e*c+r*l+n*s)}}const g={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:f.ellipsoids.Airy1830};class y{constructor(t,e){if(this.easting=Number(t),this.northing=Number(e),isNaN(t)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${t}’`);if(isNaN(e)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${e}’`)}toLatLon(t=f.datums.WGS84){const{easting:e,northing:r}=this,{a:n,b:i}=g.ellipsoid,a=g.trueOrigin.lat.toRadians(),o=g.trueOrigin.lon.toRadians(),s=-g.falseOrigin.easting,l=-g.falseOrigin.northing,c=g.scaleFactor,u=1-i*i/(n*n),h=(n-i)/(n+i),d=h*h,p=h*h*h;let m=a,y=0;do{m=(r-l-y)/(n*c)+m,y=i*c*((1+h+5/4*d+5/4*p)*(m-a)-(3*h+3*h*h+21/8*p)*Math.sin(m-a)*Math.cos(m+a)+(15/8*d+15/8*p)*Math.sin(2*(m-a))*Math.cos(2*(m+a))-35/24*p*Math.sin(3*(m-a))*Math.cos(3*(m+a)))}while(Math.abs(r-l-y)>=1e-5);const _=Math.cos(m),N=Math.sin(m),b=n*c/Math.sqrt(1-u*N*N),v=n*c*(1-u)/Math.pow(1-u*N*N,1.5),E=b/v-1,S=Math.tan(m),M=S*S,T=M*M,$=1/_,x=b*b*b,G=x*b*b,O=e-s,F=O*O,R=F*O,W=F*F,D=R*F;m=m-S/(2*v*b)*F+S/(24*v*x)*(5+3*M+E-9*M*E)*W-S/(720*v*G)*(61+90*M+45*T)*(W*F);const L=o+$/b*O-$/(6*x)*(b/v+2*M)*R+$/(120*G)*(5+28*M+24*T)*D-$/(G*b*b*5040)*(61+662*M+1320*T+T*M*720)*(D*F);let z=new w(m.toDegrees(),L.toDegrees(),0,f.datums.OSGB36);return t!=f.datums.OSGB36&&(z=z.convertDatum(t),z=new w(z.lat,z.lon,z.height,z.datum)),z}static parse(t){let e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new y(e[1],e[2]);if(e=t.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!e)throw new Error(`invalid grid reference ‘${t}’`);let r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const i=(r-2)%5*5+n%5,a=19-5*Math.floor(r/5)-Math.floor(n/5);let o=t.slice(2).trim().split(/\s+/);if(1==o.length&&(o=[o[0].slice(0,o[0].length/2),o[0].slice(o[0].length/2)]),o[0].length!=o[1].length)throw new Error(`invalid grid reference ‘${t}’`);o[0]=o[0].padEnd(5,"0"),o[1]=o[1].padEnd(5,"0");const s=i+o[0],l=a+o[1];return new y(s,l)}toString(t=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);let{easting:e,northing:r}=this;if(0==t){const t={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${e.toLocaleString("en",t)},${r.toLocaleString("en",t)}`}const n=Math.floor(e/1e5),i=Math.floor(r/1e5);let a=19-i-(19-i)%5+Math.floor((n+10)/5),o=5*(19-i)%25+n%5;a>7&&a++,o>7&&o++;const s=String.fromCharCode(a+"A".charCodeAt(0),o+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),r=Math.floor(r%1e5/Math.pow(10,5-t/2)),e=e.toString().padStart(t/2,"0"),r=r.toString().padStart(t/2,"0"),`${s} ${e} ${r}`}}class w extends f{toOsGrid(){const t=this.datum==f.datums.OSGB36?this:this.convertDatum(f.datums.OSGB36),e=t.lat.toRadians(),r=t.lon.toRadians(),{a:n,b:i}=g.ellipsoid,a=g.trueOrigin.lat.toRadians(),o=g.trueOrigin.lon.toRadians(),s=-g.falseOrigin.easting,l=-g.falseOrigin.northing,c=g.scaleFactor,u=1-i*i/(n*n),h=(n-i)/(n+i),d=h*h,p=h*h*h,m=Math.cos(e),w=Math.sin(e),_=n*c/Math.sqrt(1-u*w*w),N=n*c*(1-u)/Math.pow(1-u*w*w,1.5),b=_/N-1,v=i*c*((1+h+5/4*d+5/4*p)*(e-a)-(3*h+3*h*h+21/8*p)*Math.sin(e-a)*Math.cos(e+a)+(15/8*d+15/8*p)*Math.sin(2*(e-a))*Math.cos(2*(e+a))-35/24*p*Math.sin(3*(e-a))*Math.cos(3*(e+a))),E=m*m*m,S=E*m*m,M=Math.tan(e)*Math.tan(e),T=M*M,$=r-o,x=$*$,G=x*$,O=G*$,F=O*$;let R=v+l+_/2*w*m*x+_/24*w*E*(5-M+9*b)*O+_/720*w*S*(61-58*M+T)*(F*$),W=s+_*m*$+_/6*E*(_/N-M)*G+_/120*S*(5-18*M+T+14*b-58*M*b)*F;R=Number(R.toFixed(3)),W=Number(W.toFixed(3));try{return new y(W,R)}catch(e){throw new Error(`${e.message} from (${t.lat.toFixed(6)},${t.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(t){const e=super.convertDatum(t);return new w(e.lat,e.lon,e.height,e.datum)}}function _(t){var e=t.ID,r=t.NAME1,n=t.POPULATED_PLACE,i=t.COUNTY_UNITARY,a=t.REGION,o=t.GEOMETRY_X,s=t.GEOMETRY_Y;return{id:e||"",place:"".concat(r).concat(n?", "+n:"").concat(i?", "+i:"",", ").concat(a),county:i||"",coordinates:[o,s]}}function N(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return b(c,"_invoke",function(r,n,i){var a,s,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,s=0,l=t,d.n=r,o}};function p(r,n){for(s=r,l=n,e=0;!h&&c&&!i&&e<u.length;e++){var i,a=u[e],p=d.p,f=a[2];r>3?(i=f===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=t):a[0]<=p&&((i=r<2&&p<a[1])?(s=0,d.v=n,d.n=a[1]):p<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,d.n=f,s=0))}if(i||r>1)return o;throw h=!0,n}return function(i,u,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,f),s=u,l=f;(e=s<2?t:l)||!h;){a||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,a){if(s||(i="next"),e=a[i]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=a.return)&&e.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=t}else if((e=(h=d.n<0)?l:r.call(n,d))!==o)break}catch(e){a=t,s=1,l=e}finally{c=1}}return{value:e,done:h}}}(r,i,a),!0),c}var o={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][n]?e(e([][n]())):(b(e={},n,function(){return this}),e),h=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,b(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=c,b(h,"constructor",c),b(c,"constructor",l),l.displayName="GeneratorFunction",b(c,i,"GeneratorFunction"),b(h),b(h,i,"Generator"),b(h,n,function(){return this}),b(h,"toString",function(){return"[object Generator]"}),(N=function(){return{w:a,m:d}})()}function b(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}b=function(t,e,r,n){function a(e,r){b(t,e,function(t){return this._invoke(e,r,t)})}e?i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},b(t,e,r,n)}function v(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}var E=function(){var t,e=(t=N().m(function t(){var e,r,n,i,a,o,s,l,c,u,h,d,p,f,m=arguments;return N().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e=m.length>0&&void 0!==m[0]?m[0]:"https://api.os.uk/search/names/v1/nearest?point={easting},{northing}&radius=1000&fq=local_type:Airfield%20local_type:Airport%20local_type:Bus_Station%20local_type:Chemical_Works%20local_type:City%20local_type:Coach_Station%20local_type:Electricity_Distribution%20local_type:Electricity_Production%20local_type:Further_Education%20local_type:Gas_Distribution_or_Storage%20local_type:Hamlet%20local_type:Harbour%20local_type:Helicopter_Station%20local_type:Heliport%20local_type:Higher_or_University_Education%20local_type:Hill_Or_Mountain%20local_type:Hospice%20local_type:Hospital%20local_type:Medical_Care_Accommodation%20local_type:Named_Road%20local_type:Non_State_Primary_Education%20local_type:Non_State_Secondary_Education%20local_type:Other_Settlement%20local_type:Passenger_Ferry_Terminal%20local_type:Port_Consisting_of_Docks_and_Nautical_Berthing%20local_type:Postcode%20local_type:Primary_Education%20local_type:Railway_Station%20local_type:Road_User_Services%20local_type:Secondary_Education%20local_type:Section_Of_Named_Road%20local_type:Section_Of_Numbered_Road%20local_type:Special_Needs_Education%20local_type:Suburban_Area%20local_type:Town%20local_type:Urban_Greenspace%20local_type:Vehicular_Ferry_Terminal%20local_type:Vehicular_Rail_Terminal%20local_type:Village%20local_type:Waterfall%20",r=m.length>1?m[1]:void 0,a=i=m.length>4?m[4]:void 0,"EPSG:4326"!==(n=m.length>2?m[2]:void 0)){t.n=3;break}t.p=1,a=[(a=new w(i[1],i[0]).toOsGrid()).easting,a.northing].map(function(t){return Math.round(t)}),t.n=3;break;case 2:return t.p=2,p=t.v,console.log(p),t.a(2,null);case 3:if(e=e.replace("{easting}",Math.round(a[0])).replace("{northing}",Math.round(a[1])),o=new Request(e,{method:"GET"}),!r){t.n=7;break}return t.p=4,t.n=5,r(o);case 5:o=t.v,t.n=7;break;case 6:return t.p=6,f=t.v,console.log("Error transforming request:",f),t.a(2,null);case 7:return t.n=8,fetch(o);case 8:return s=t.v,t.n=9,s.json();case 9:return l=t.v,c=_(l.results[0].GAZETTEER_ENTRY),"EPSG:4326"===n&&(u=new y(c.coordinates[0],c.coordinates[1]),h=u.toLatLon(),c.coordinates=[h.lat,h.lon]),d="Approximate centre ".concat(null==c?void 0:c.place),t.a(2,l.results?d:null)}},t,null,[[4,6],[1,2]])}),function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function o(t){v(a,n,i,o,s,"next",t)}function s(t){v(a,n,i,o,s,"throw",t)}o(void 0)})});return function(){return e.apply(this,arguments)}}()}}]);
|
|
2
|
+
"use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[627],{246:function(t,e,r){r.r(e),r.d(e,{reverseGeocode:function(){return E}});let n=" ";class i{static get separator(){return n}static set separator(t){n=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);const e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let r=null;switch(e.length){case 3:r=e[0]/1+e[1]/60+e[2]/3600;break;case 2:r=e[0]/1+e[1]/60;break;case 1:r=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(r=-r),Number(r)}static toDms(t,e="d",r=void 0){if(isNaN(t))return null;if("string"==typeof t&&""==t.trim())return null;if("boolean"==typeof t)return null;if(t==1/0)return null;if(null==t)return null;if(void 0===r)switch(e){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:e="d",r=4}t=Math.abs(t);let n=null,a=null,o=null,s=null;switch(e){default:case"d":case"deg":a=t.toFixed(r),a<100&&(a="0"+a),a<10&&(a="0"+a),n=a+"°";break;case"dm":case"deg+min":a=Math.floor(t),o=(60*t%60).toFixed(r),60==o&&(o=(0).toFixed(r),a++),a=("000"+a).slice(-3),o<10&&(o="0"+o),n=a+"°"+i.separator+o+"′";break;case"dms":case"deg+min+sec":a=Math.floor(t),o=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(r),60==s&&(s=(0).toFixed(r),o++),60==o&&(o=0,a++),a=("000"+a).slice(-3),o=("00"+o).slice(-2),s<10&&(s="0"+s),n=a+"°"+i.separator+o+"′"+i.separator+s+"″"}return n}static toLat(t,e,r){const n=i.toDms(i.wrap90(t),e,r);return null===n?"–":n.slice(1)+i.separator+(t<0?"S":"N")}static toLon(t,e,r){const n=i.toDms(i.wrap180(t),e,r);return null===n?"–":n+i.separator+(t<0?"W":"E")}static toBrng(t,e,r){const n=i.toDms(i.wrap360(t),e,r);return null===n?"–":n.replace("360","0")}static fromLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(t){const e=123456.789.toLocaleString(),r={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=i.wrap360(t);const r=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*r/360)%r*16/r]}static wrap90(t){if(-90<=t&&t<=90)return t;const e=t;return 1*Math.abs(((e-90)%360+360)%360-180)-90}static wrap180(t){if(-180<=t&&t<=180)return t;const e=360;return((360*t/e-180)%e+e)%e-180}static wrap360(t){if(0<=t&&t<360)return t;const e=360;return(360*t/e%e+e)%e}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var a=i;class o{constructor(t,e,r){if(isNaN(t)||isNaN(e)||isNaN(r))throw new TypeError(`invalid vector [${t},${e},${r}]`);this.x=Number(t),this.y=Number(e),this.z=Number(r)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}plus(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");return new o(this.x+t.x,this.y+t.y,this.z+t.z)}minus(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");return new o(this.x-t.x,this.y-t.y,this.z-t.z)}times(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new o(this.x*t,this.y*t,this.z*t)}dividedBy(t){if(isNaN(t))throw new TypeError(`invalid scalar value ‘${t}’`);return new o(this.x/t,this.y/t,this.z/t)}dot(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");const e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,n=this.x*t.y-this.y*t.x;return new o(e,r,n)}negate(){return new o(-this.x,-this.y,-this.z)}unit(){const t=this.length;if(1==t)return this;if(0==t)return this;const e=this.x/t,r=this.y/t,n=this.z/t;return new o(e,r,n)}angleTo(t,e=void 0){if(!(t instanceof o))throw new TypeError("v is not Vector3d object");if(!(e instanceof o||null==e))throw new TypeError("n is not Vector3d object");const r=null==e||this.cross(t).dot(e)>=0?1:-1,n=this.cross(t).length*r,i=this.dot(t);return Math.atan2(n,i)}rotateAround(t,e){if(!(t instanceof o))throw new TypeError("axis is not Vector3d object");const r=e.toRadians(),n=this.unit(),i=t.unit(),a=Math.sin(r),s=Math.cos(r),l=1-s,c=i.x,u=i.y,h=i.z,d=[[l*c*c+s,l*c*u-a*h,l*c*h+a*u],[l*c*u+a*h,l*u*u+s,l*u*h-a*c],[l*c*h-a*u,l*u*h+a*c,l*h*h+s]],p=[d[0][0]*n.x+d[0][1]*n.y+d[0][2]*n.z,d[1][0]*n.x+d[1][1]*n.y+d[1][2]*n.z,d[2][0]*n.x+d[2][1]*n.y+d[2][2]*n.z];return new o(p[0],p[1],p[2])}toString(t=3){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var s=o;const l={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563}},c={WGS84:{ellipsoid:l.WGS84}};Object.freeze(l.WGS84),Object.freeze(c.WGS84);class u{constructor(t,e,r=0){if(isNaN(t)||null==t)throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e)||null==e)throw new TypeError(`invalid lon ‘${e}’`);if(isNaN(r)||null==r)throw new TypeError(`invalid height ‘${r}’`);this._lat=a.wrap90(Number(t)),this._lon=a.wrap180(Number(e)),this._height=Number(r)}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?a.wrap90(a.parse(t)):a.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?a.wrap90(a.parse(t)):a.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?a.wrap180(a.parse(t)):a.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?a.wrap180(a.parse(t)):a.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?a.wrap180(a.parse(t)):a.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}get height(){return this._height}set height(t){if(this._height=Number(t),isNaN(this._height))throw new TypeError(`invalid height ‘${t}’`)}get datum(){return this._datum}set datum(t){this._datum=t}static get ellipsoids(){return l}static get datums(){return c}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");let e,r,n;if("object"==typeof t[0]&&(1==t.length||!isNaN(parseFloat(t[1])))){const i=t[0];if("Point"==i.type&&Array.isArray(i.coordinates)?([r,e,n]=i.coordinates,n=n||0):(null!=i.latitude&&(e=i.latitude),null!=i.lat&&(e=i.lat),null!=i.longitude&&(r=i.longitude),null!=i.lng&&(r=i.lng),null!=i.lon&&(r=i.lon),null!=i.height&&(n=i.height),e=a.wrap90(a.parse(e)),r=a.wrap180(a.parse(r))),null!=t[1]&&(n=t[1]),isNaN(e)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if("string"==typeof t[0]&&2==t[0].split(",").length&&([e,r]=t[0].split(","),e=a.wrap90(a.parse(e)),r=a.wrap180(a.parse(r)),n=t[1]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t[0]}’`);if(null==e&&null==r&&([e,r]=t,e=a.wrap90(a.parse(e)),r=a.wrap180(a.parse(r)),n=t[2]||0,isNaN(e)||isNaN(r)))throw new TypeError(`invalid point ‘${t.toString()}’`);return new this(e,r,n)}toCartesian(){const t=this.datum?this.datum.ellipsoid:this.referenceFrame?this.referenceFrame.ellipsoid:l.WGS84,e=this.lat.toRadians(),r=this.lon.toRadians(),n=this.height,{a:i,f:a}=t,o=Math.sin(e),s=Math.cos(e),c=Math.sin(r),u=Math.cos(r),d=2*a-a*a,p=i/Math.sqrt(1-d*o*o);return new h((p+n)*s*u,(p+n)*s*c,(p*(1-d)+n)*o)}equals(t){if(!(t instanceof u))throw new TypeError(`invalid point ‘${t}’`);return!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON||Math.abs(this.height-t.height)>Number.EPSILON||this.datum!=t.datum||this.referenceFrame!=t.referenceFrame||this.epoch!=t.epoch)}toString(t="d",e=void 0,r=null){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);const n=(this.height>=0?" +":" ")+this.height.toFixed(r)+"m";return"n"==t?(null==e&&(e=4),`${this.lat.toFixed(e)}, ${this.lon.toFixed(e)}${null==r?"":n}`):`${a.toLat(this.lat,t,e)}, ${a.toLon(this.lon,t,e)}${null==r?"":n}`}}class h extends s{constructor(t,e,r){super(t,e,r)}toLatLon(t=l.WGS84){if(!t||!t.a)throw new TypeError(`invalid ellipsoid ‘${t}’`);const{x:e,y:r,z:n}=this,{a:i,b:a,f:o}=t,s=2*o-o*o,c=s/(1-s),h=Math.sqrt(e*e+r*r),d=a*n/(i*h)*(1+c*a/Math.sqrt(h*h+n*n)),p=d/Math.sqrt(1+d*d),f=p/d,m=isNaN(f)?0:Math.atan2(n+c*a*p*p*p,h-s*i*f*f*f),g=Math.atan2(r,e),y=Math.sin(m),w=h*Math.cos(m)+n*y-i*i/(i/Math.sqrt(1-s*y*y));return new u(m.toDegrees(),g.toDegrees(),w)}toString(t=0){return`[${this.x.toFixed(t)},${this.y.toFixed(t)},${this.z.toFixed(t)}]`}}const d={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},p={ED50:{ellipsoid:d.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},ETRS89:{ellipsoid:d.GRS80,transform:[0,0,0,0,0,0,0]},Irl1975:{ellipsoid:d.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,1.042,.214,.631]},NAD27:{ellipsoid:d.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:d.GRS80,transform:[.9956,-1.9103,-.5215,-62e-5,.025915,.009426,.011599]},NTF:{ellipsoid:d.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:d.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:d.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:d.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:d.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:d.WGS84,transform:[0,0,0,0,0,0,0]}};Object.keys(d).forEach(t=>Object.freeze(d[t])),Object.keys(p).forEach(t=>{Object.freeze(p[t]),Object.freeze(p[t].transform)});class f extends u{constructor(t,e,r=0,n=p.WGS84){if(!n||null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),this._datum=n}get datum(){return this._datum}static get ellipsoids(){return d}static get datums(){return p}static parse(...t){let e=p.WGS84;if((4==t.length||3==t.length&&"object"==typeof t[2])&&(e=t.pop()),!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.parse(...t);return r._datum=e,r}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);return this.toCartesian().convertDatum(t).toLatLon()}toCartesian(){const t=super.toCartesian();return new m(t.x,t.y,t.z,this.datum)}}class m extends h{constructor(t,e,r,n=void 0){if(n&&null==n.ellipsoid)throw new TypeError(`unrecognised datum ‘${n}’`);super(t,e,r),n&&(this._datum=n)}get datum(){return this._datum}set datum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);this._datum=t}toLatLon(t=void 0){t&&(console.info("datum parameter to Cartesian_Datum.toLatLon is deprecated: set datum before calling toLatLon()"),this.datum=t);const e=this.datum||p.WGS84;if(!e||null==e.ellipsoid)throw new TypeError(`unrecognised datum ‘${e}’`);const r=super.toLatLon(e.ellipsoid);return new f(r.lat,r.lon,r.height,this.datum)}convertDatum(t){if(!t||null==t.ellipsoid)throw new TypeError(`unrecognised datum ‘${t}’`);if(!this.datum)throw new TypeError("cartesian coordinate has no datum");let e=null,r=null;null!=this.datum&&this.datum!=p.WGS84||(e=this,r=t.transform),t==p.WGS84&&(e=this,r=this.datum.transform.map(t=>-t)),null==r&&(e=this.convertDatum(p.WGS84),r=t.transform);const n=e.applyTransform(r);return n.datum=t,n}applyTransform(t){const{x:e,y:r,z:n}=this,i=t[0],a=t[1],o=t[2],s=t[3]/1e6+1,l=(t[4]/3600).toRadians(),c=(t[5]/3600).toRadians(),u=(t[6]/3600).toRadians();return new m(i+e*s-r*u+n*c,a+e*u+r*s-n*l,o-e*c+r*l+n*s)}}const g={trueOrigin:{lat:49,lon:-2},falseOrigin:{easting:-4e5,northing:1e5},scaleFactor:.9996012717,ellipsoid:f.ellipsoids.Airy1830};class y{constructor(t,e){if(this.easting=Number(t),this.northing=Number(e),isNaN(t)||this.easting<0||this.easting>7e5)throw new RangeError(`invalid easting ‘${t}’`);if(isNaN(e)||this.northing<0||this.northing>13e5)throw new RangeError(`invalid northing ‘${e}’`)}toLatLon(t=f.datums.WGS84){const{easting:e,northing:r}=this,{a:n,b:i}=g.ellipsoid,a=g.trueOrigin.lat.toRadians(),o=g.trueOrigin.lon.toRadians(),s=-g.falseOrigin.easting,l=-g.falseOrigin.northing,c=g.scaleFactor,u=1-i*i/(n*n),h=(n-i)/(n+i),d=h*h,p=h*h*h;let m=a,y=0;do{m=(r-l-y)/(n*c)+m,y=i*c*((1+h+5/4*d+5/4*p)*(m-a)-(3*h+3*h*h+21/8*p)*Math.sin(m-a)*Math.cos(m+a)+(15/8*d+15/8*p)*Math.sin(2*(m-a))*Math.cos(2*(m+a))-35/24*p*Math.sin(3*(m-a))*Math.cos(3*(m+a)))}while(Math.abs(r-l-y)>=1e-5);const _=Math.cos(m),N=Math.sin(m),b=n*c/Math.sqrt(1-u*N*N),v=n*c*(1-u)/Math.pow(1-u*N*N,1.5),E=b/v-1,S=Math.tan(m),M=S*S,T=M*M,$=1/_,x=b*b*b,G=x*b*b,O=e-s,F=O*O,R=F*O,W=F*F,D=R*F;m=m-S/(2*v*b)*F+S/(24*v*x)*(5+3*M+E-9*M*E)*W-S/(720*v*G)*(61+90*M+45*T)*(W*F);const L=o+$/b*O-$/(6*x)*(b/v+2*M)*R+$/(120*G)*(5+28*M+24*T)*D-$/(G*b*b*5040)*(61+662*M+1320*T+T*M*720)*(D*F);let z=new w(m.toDegrees(),L.toDegrees(),0,f.datums.OSGB36);return t!=f.datums.OSGB36&&(z=z.convertDatum(t),z=new w(z.lat,z.lon,z.height,z.datum)),z}static parse(t){let e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new y(e[1],e[2]);if(e=t.match(/^[HNST][ABCDEFGHJKLMNOPQRSTUVWXYZ]\s*[0-9]+\s*[0-9]+$/i),!e)throw new Error(`invalid grid reference ‘${t}’`);let r=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),n=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);r>7&&r--,n>7&&n--;const i=(r-2)%5*5+n%5,a=19-5*Math.floor(r/5)-Math.floor(n/5);let o=t.slice(2).trim().split(/\s+/);if(1==o.length&&(o=[o[0].slice(0,o[0].length/2),o[0].slice(o[0].length/2)]),o[0].length!=o[1].length)throw new Error(`invalid grid reference ‘${t}’`);o[0]=o[0].padEnd(5,"0"),o[1]=o[1].padEnd(5,"0");const s=i+o[0],l=a+o[1];return new y(s,l)}toString(t=10){if(![0,2,4,6,8,10,12,14,16].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);let{easting:e,northing:r}=this;if(0==t){const t={useGrouping:!1,minimumIntegerDigits:6,maximumFractionDigits:3};return`${e.toLocaleString("en",t)},${r.toLocaleString("en",t)}`}const n=Math.floor(e/1e5),i=Math.floor(r/1e5);let a=19-i-(19-i)%5+Math.floor((n+10)/5),o=5*(19-i)%25+n%5;a>7&&a++,o>7&&o++;const s=String.fromCharCode(a+"A".charCodeAt(0),o+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),r=Math.floor(r%1e5/Math.pow(10,5-t/2)),e=e.toString().padStart(t/2,"0"),r=r.toString().padStart(t/2,"0"),`${s} ${e} ${r}`}}class w extends f{toOsGrid(){const t=this.datum==f.datums.OSGB36?this:this.convertDatum(f.datums.OSGB36),e=t.lat.toRadians(),r=t.lon.toRadians(),{a:n,b:i}=g.ellipsoid,a=g.trueOrigin.lat.toRadians(),o=g.trueOrigin.lon.toRadians(),s=-g.falseOrigin.easting,l=-g.falseOrigin.northing,c=g.scaleFactor,u=1-i*i/(n*n),h=(n-i)/(n+i),d=h*h,p=h*h*h,m=Math.cos(e),w=Math.sin(e),_=n*c/Math.sqrt(1-u*w*w),N=n*c*(1-u)/Math.pow(1-u*w*w,1.5),b=_/N-1,v=i*c*((1+h+5/4*d+5/4*p)*(e-a)-(3*h+3*h*h+21/8*p)*Math.sin(e-a)*Math.cos(e+a)+(15/8*d+15/8*p)*Math.sin(2*(e-a))*Math.cos(2*(e+a))-35/24*p*Math.sin(3*(e-a))*Math.cos(3*(e+a))),E=m*m*m,S=E*m*m,M=Math.tan(e)*Math.tan(e),T=M*M,$=r-o,x=$*$,G=x*$,O=G*$,F=O*$;let R=v+l+_/2*w*m*x+_/24*w*E*(5-M+9*b)*O+_/720*w*S*(61-58*M+T)*(F*$),W=s+_*m*$+_/6*E*(_/N-M)*G+_/120*S*(5-18*M+T+14*b-58*M*b)*F;R=Number(R.toFixed(3)),W=Number(W.toFixed(3));try{return new y(W,R)}catch(e){throw new Error(`${e.message} from (${t.lat.toFixed(6)},${t.lon.toFixed(6)}).toOsGrid()`)}}convertDatum(t){const e=super.convertDatum(t);return new w(e.lat,e.lon,e.height,e.datum)}}function _(t){var e=t.ID,r=t.NAME1,n=t.POPULATED_PLACE,i=t.COUNTY_UNITARY,a=t.REGION,o=t.GEOMETRY_X,s=t.GEOMETRY_Y;return{id:e||"",place:"".concat(r).concat(n?", "+n:"").concat(i?", "+i:"",", ").concat(a),county:i||"",coordinates:[o,s]}}function N(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return b(c,"_invoke",function(r,n,i){var a,s,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return a=e,s=0,l=t,d.n=r,o}};function p(r,n){for(s=r,l=n,e=0;!h&&c&&!i&&e<u.length;e++){var i,a=u[e],p=d.p,f=a[2];r>3?(i=f===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=t):a[0]<=p&&((i=r<2&&p<a[1])?(s=0,d.v=n,d.n=a[1]):p<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,d.n=f,s=0))}if(i||r>1)return o;throw h=!0,n}return function(i,u,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,f),s=u,l=f;(e=s<2?t:l)||!h;){a||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,a){if(s||(i="next"),e=a[i]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=a.return)&&e.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=t}else if((e=(h=d.n<0)?l:r.call(n,d))!==o)break}catch(e){a=t,s=1,l=e}finally{c=1}}return{value:e,done:h}}}(r,i,a),!0),c}var o={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][n]?e(e([][n]())):(b(e={},n,function(){return this}),e),h=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,b(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=c,b(h,"constructor",c),b(c,"constructor",l),l.displayName="GeneratorFunction",b(c,i,"GeneratorFunction"),b(h),b(h,i,"Generator"),b(h,n,function(){return this}),b(h,"toString",function(){return"[object Generator]"}),(N=function(){return{w:a,m:d}})()}function b(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}b=function(t,e,r,n){function a(e,r){b(t,e,function(t){return this._invoke(e,r,t)})}e?i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},b(t,e,r,n)}function v(t,e,r,n,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,i)}var E=function(){var t,e=(t=N().m(function t(){var e,r,n,i,a,o,s,l,c,u,h,d,p,f,m=arguments;return N().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e=m.length>0&&void 0!==m[0]?m[0]:"https://api.os.uk/search/names/v1/nearest?point={easting},{northing}&radius=1000&fq=local_type:Airfield%20local_type:Airport%20local_type:Bus_Station%20local_type:Chemical_Works%20local_type:City%20local_type:Coach_Station%20local_type:Electricity_Distribution%20local_type:Electricity_Production%20local_type:Further_Education%20local_type:Gas_Distribution_or_Storage%20local_type:Hamlet%20local_type:Harbour%20local_type:Helicopter_Station%20local_type:Heliport%20local_type:Higher_or_University_Education%20local_type:Hill_Or_Mountain%20local_type:Hospice%20local_type:Hospital%20local_type:Medical_Care_Accommodation%20local_type:Named_Road%20local_type:Non_State_Primary_Education%20local_type:Non_State_Secondary_Education%20local_type:Other_Settlement%20local_type:Passenger_Ferry_Terminal%20local_type:Port_Consisting_of_Docks_and_Nautical_Berthing%20local_type:Postcode%20local_type:Primary_Education%20local_type:Railway_Station%20local_type:Road_User_Services%20local_type:Secondary_Education%20local_type:Section_Of_Named_Road%20local_type:Section_Of_Numbered_Road%20local_type:Special_Needs_Education%20local_type:Suburban_Area%20local_type:Town%20local_type:Urban_Greenspace%20local_type:Vehicular_Ferry_Terminal%20local_type:Vehicular_Rail_Terminal%20local_type:Village%20local_type:Waterfall%20",r=m.length>1?m[1]:void 0,a=i=m.length>4?m[4]:void 0,"EPSG:4326"!==(n=m.length>2?m[2]:void 0)){t.n=3;break}t.p=1,a=[(a=new w(i[1],i[0]).toOsGrid()).easting,a.northing].map(function(t){return Math.round(t)}),t.n=3;break;case 2:return t.p=2,p=t.v,console.log(p),t.a(2,null);case 3:if(e=e.replace("{easting}",Math.round(a[0])).replace("{northing}",Math.round(a[1])),o=new Request(e,{method:"GET"}),!r){t.n=7;break}return t.p=4,t.n=5,r(o);case 5:o=t.v,t.n=7;break;case 6:return t.p=6,f=t.v,console.log("Error transforming request:",f),t.a(2,null);case 7:return t.n=8,fetch(o);case 8:return s=t.v,t.n=9,s.json();case 9:return l=t.v,c=_(l.results[0].GAZETTEER_ENTRY),"EPSG:4326"===n&&(u=new y(c.coordinates[0],c.coordinates[1]),h=u.toLatLon(),c.coordinates=[h.lat,h.lon]),d="Approximate centre ".concat(null==c?void 0:c.place),t.a(2,l.results?d:null)}},t,null,[[4,6],[1,2]])}),function(){var e=this,r=arguments;return new Promise(function(n,i){var a=t.apply(e,r);function o(t){v(a,n,i,o,s,"next",t)}function s(t){v(a,n,i,o,s,"throw",t)}o(void 0)})});return function(){return e.apply(this,arguments)}}()}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.openNamesProvider=t())}(Object("undefined"!=typeof self?self:this),function(){return function(){"use strict";var e,t,r={},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce(function(t,r){return o.f[r](e,t),t},[]))},o.u=function(e){return"im-reverse-geocode.js"},o.miniCssF=function(e){},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="defra.openNamesProvider:",o.l=function(r,n,i,u){if(e[r])e[r].push(n);else{var c,a;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var l=f[p];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){c=l;break}}c||(a=!0,(c=document.createElement("script")).charset="utf-8",o.nc&&c.setAttribute("nonce",o.nc),c.setAttribute("data-webpack",t+i),c.src=r),e[r]=[n];var s=function(t,n){c.onerror=c.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach(function(e){return e(n)}),t)return t(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=s.bind(null,c.onerror),c.onload=s.bind(null,c.onload),a&&document.head.appendChild(c)}},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e}(),function(){var e={57:0};o.f.j=function(t,r){var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(function(r,o){n=e[t]=[r,o]});r.push(n[2]=i);var u=o.p+o.u(t),c=new Error;o.l(u,function(r){if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+i+": "+u+")",c.name="ChunkLoadError",c.type=i,c.request=u,n[1](c)}},"chunk-"+t,t)}};var t=function(t,r){var n,i,u=r[0],c=r[1],a=r[2],f=0;if(u.some(function(t){return 0!==e[t]})){for(n in c)o.o(c,n)&&(o.m[n]=c[n]);a&&a(o)}for(t&&t(r);f<u.length;f++)i=u[f],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var i={};function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof f?n:f,p=Object.create(c.prototype);return a(p,"_invoke",function(r,n,o){var i,c,a,f=0,p=o||[],l=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,c=0,a=e,s.n=r,u}};function d(r,n){for(c=r,a=n,t=0;!l&&f&&!o&&t<p.length;t++){var o,i=p[t],d=s.p,b=i[2];r>3?(o=b===n)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,s.v=n,s.n=i[1]):d<b&&(o=r<3||i[0]>n||n>b)&&(i[4]=r,i[5]=n,s.n=b,c=0))}if(o||r>1)return u;throw l=!0,n}return function(o,p,b){if(f>1)throw TypeError("Generator is already running");for(l&&1===p&&d(p,b),c=p,a=b;(t=c<2?e:a)||!l;){i||(c?c<3?(c>1&&(s.n=-1),d(c,a)):s.n=a:s.v=a);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(l=s.n<0)?a:r.call(n,s))!==u)break}catch(t){i=e,c=1,a=t}finally{f=1}}return{value:t,done:l}}}(r,o,i),!0),p}var u={};function f(){}function p(){}function l(){}t=Object.getPrototypeOf;var s=[][n]?t(t([][n]())):(a(t={},n,function(){return this}),t),d=l.prototype=f.prototype=Object.create(s);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,a(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return p.prototype=l,a(d,"constructor",l),a(l,"constructor",p),p.displayName="GeneratorFunction",a(l,o,"GeneratorFunction"),a(d),a(d,o,"Generator"),a(d,n,function(){return this}),a(d,"toString",function(){return"[object Generator]"}),(c=function(){return{w:i,m:b}})()}function a(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}a=function(e,t,r,n){function i(t,r){a(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},a(e,t,r,n)}function f(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){return void r(e)}c.done?t(a):Promise.resolve(a).then(n,o)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return(t=function(e){var t=function(e){if("object"!=u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(){var e,t;return l(l({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{load:(e=c().m(function e(){var t;return c().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.e(627).then(o.bind(o,
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.openNamesProvider=t())}(Object("undefined"!=typeof self?self:this),function(){return function(){"use strict";var e,t,r={},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce(function(t,r){return o.f[r](e,t),t},[]))},o.u=function(e){return"im-reverse-geocode.js"},o.miniCssF=function(e){},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="defra.openNamesProvider:",o.l=function(r,n,i,u){if(e[r])e[r].push(n);else{var c,a;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var l=f[p];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){c=l;break}}c||(a=!0,(c=document.createElement("script")).charset="utf-8",o.nc&&c.setAttribute("nonce",o.nc),c.setAttribute("data-webpack",t+i),c.src=r),e[r]=[n];var s=function(t,n){c.onerror=c.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach(function(e){return e(n)}),t)return t(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=s.bind(null,c.onerror),c.onload=s.bind(null,c.onload),a&&document.head.appendChild(c)}},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e}(),function(){var e={57:0};o.f.j=function(t,r){var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(function(r,o){n=e[t]=[r,o]});r.push(n[2]=i);var u=o.p+o.u(t),c=new Error;o.l(u,function(r){if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+i+": "+u+")",c.name="ChunkLoadError",c.type=i,c.request=u,n[1](c)}},"chunk-"+t,t)}};var t=function(t,r){var n,i,u=r[0],c=r[1],a=r[2],f=0;if(u.some(function(t){return 0!==e[t]})){for(n in c)o.o(c,n)&&(o.m[n]=c[n]);a&&a(o)}for(t&&t(r);f<u.length;f++)i=u[f],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var i={};function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof f?n:f,p=Object.create(c.prototype);return a(p,"_invoke",function(r,n,o){var i,c,a,f=0,p=o||[],l=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,c=0,a=e,s.n=r,u}};function d(r,n){for(c=r,a=n,t=0;!l&&f&&!o&&t<p.length;t++){var o,i=p[t],d=s.p,b=i[2];r>3?(o=b===n)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,s.v=n,s.n=i[1]):d<b&&(o=r<3||i[0]>n||n>b)&&(i[4]=r,i[5]=n,s.n=b,c=0))}if(o||r>1)return u;throw l=!0,n}return function(o,p,b){if(f>1)throw TypeError("Generator is already running");for(l&&1===p&&d(p,b),c=p,a=b;(t=c<2?e:a)||!l;){i||(c?c<3?(c>1&&(s.n=-1),d(c,a)):s.n=a:s.v=a);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(l=s.n<0)?a:r.call(n,s))!==u)break}catch(t){i=e,c=1,a=t}finally{f=1}}return{value:t,done:l}}}(r,o,i),!0),p}var u={};function f(){}function p(){}function l(){}t=Object.getPrototypeOf;var s=[][n]?t(t([][n]())):(a(t={},n,function(){return this}),t),d=l.prototype=f.prototype=Object.create(s);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,a(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return p.prototype=l,a(d,"constructor",l),a(l,"constructor",p),p.displayName="GeneratorFunction",a(l,o,"GeneratorFunction"),a(d),a(d,o,"Generator"),a(d,n,function(){return this}),a(d,"toString",function(){return"[object Generator]"}),(c=function(){return{w:i,m:b}})()}function a(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}a=function(e,t,r,n){function i(t,r){a(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},a(e,t,r,n)}function f(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){return void r(e)}c.done?t(a):Promise.resolve(a).then(n,o)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return(t=function(e){var t=function(e){if("object"!=u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(){var e,t;return l(l({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{load:(e=c().m(function e(){var t;return c().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.e(627).then(o.bind(o,246));case 1:return t=e.v,e.a(2,t.reverseGeocode)}},e)}),t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){f(i,n,o,u,c,"next",e)}function c(e){f(i,n,o,u,c,"throw",e)}u(void 0)})},function(){return t.apply(this,arguments)})})}return o.d(i,{default:function(){return d}}),i.default}()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@babel/runtime/helpers/regenerator";import r from"@babel/runtime/helpers/asyncToGenerator";function t(){var t,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).zoomAlignment;return{checkDeviceCapabilities:function(){var e=document.documentMode?"Internet Explorer is not supported":document.createElement("canvas").getContext?"function"!=typeof[].at?"Browser does not support the JavaScript features OpenLayers requires":void 0:"Canvas is not supported in this browser";return{isSupported:!e,error:e}},load:(t=r(e().m(function r(){var t,o;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,import(/* webpackChunkName: "im-openlayers-provider" */ "./im-openlayers-provider.js");case 1:return t=e.v.default,o={zoomAlignment:n,crs:"EPSG:27700"},e.a(2,{MapProvider:t,mapProviderConfig:o})}},r)})),function(){return t.apply(this,arguments)})}}export{t as default};
|