@open-pioneer/map-navigation 0.4.2 → 0.4.3
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/CHANGELOG.md +12 -0
- package/InitialExtent.js +2 -1
- package/InitialExtent.js.map +1 -1
- package/Zoom.js +2 -1
- package/Zoom.js.map +1 -1
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @open-pioneer/map-navigation
|
|
2
2
|
|
|
3
|
+
## 0.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 28e092a: Update dependencies
|
|
8
|
+
- Updated dependencies [28e092a]
|
|
9
|
+
- Updated dependencies [0d51d2f]
|
|
10
|
+
- Updated dependencies [2090e72]
|
|
11
|
+
- Updated dependencies [76f8863]
|
|
12
|
+
- @open-pioneer/map-ui-components@0.1.0
|
|
13
|
+
- @open-pioneer/map@0.6.0
|
|
14
|
+
|
|
3
15
|
## 0.4.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/InitialExtent.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useMapModel } from '@open-pioneer/map';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolButton } from '@open-pioneer/map-ui-components';
|
|
4
|
+
import { useCommonComponentProps } from '@open-pioneer/react-utils';
|
|
4
5
|
import { useIntl } from './_virtual/_virtual-pioneer-module_react-hooks.js';
|
|
5
6
|
import { forwardRef } from 'react';
|
|
6
7
|
import { FiHome } from 'react-icons/fi';
|
package/InitialExtent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitialExtent.js","sources":["InitialExtent.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { useMapModel } from \"@open-pioneer/map\";\nimport {\
|
|
1
|
+
{"version":3,"file":"InitialExtent.js","sources":["InitialExtent.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { useMapModel } from \"@open-pioneer/map\";\nimport { ToolButton } from \"@open-pioneer/map-ui-components\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { Extent } from \"ol/extent\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC, ForwardedRef, RefAttributes, forwardRef } from \"react\";\nimport { FiHome } from \"react-icons/fi\";\n\nexport interface InitialExtentProps extends CommonComponentProps, RefAttributes<HTMLButtonElement> {\n /**\n * The map id.\n */\n mapId: string;\n}\n\n/**\n * Provides a simple button that switches the view to its initial viewpoint.\n */\nexport const InitialExtent: FC<InitialExtentProps> = forwardRef(function InitialExtent(\n props: InitialExtentProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n const { mapId } = props;\n const { containerProps } = useCommonComponentProps(\"initial-extent\", props);\n const { map } = useMapModel(mapId);\n const intl = useIntl();\n\n function setInitExtent() {\n const initialExtent = map?.initialExtent;\n const olMap = map?.olMap;\n\n if (initialExtent && olMap) {\n const newExtent: Extent = [\n initialExtent.xMin,\n initialExtent.yMin,\n initialExtent.xMax,\n initialExtent.yMax\n ];\n\n olMap.getView().fit(newExtent, { duration: 200 });\n }\n }\n\n return (\n <ToolButton\n ref={ref}\n label={intl.formatMessage({ id: \"initial-extent.title\" })}\n icon={<FiHome />}\n onClick={setInitExtent}\n {...containerProps}\n />\n );\n});\n"],"names":["InitialExtent"],"mappings":";;;;;;;;AAoBO,MAAM,aAAwC,GAAA,UAAA,CAAW,SAASA,cAAAA,CACrE,OACA,GACF,EAAA;AACE,EAAM,MAAA,EAAE,OAAU,GAAA,KAAA,CAAA;AAClB,EAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,uBAAA,CAAwB,kBAAkB,KAAK,CAAA,CAAA;AAC1E,EAAA,MAAM,EAAE,GAAA,EAAQ,GAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AACjC,EAAA,MAAM,OAAO,OAAQ,EAAA,CAAA;AAErB,EAAA,SAAS,aAAgB,GAAA;AACrB,IAAA,MAAM,gBAAgB,GAAK,EAAA,aAAA,CAAA;AAC3B,IAAA,MAAM,QAAQ,GAAK,EAAA,KAAA,CAAA;AAEnB,IAAA,IAAI,iBAAiB,KAAO,EAAA;AACxB,MAAA,MAAM,SAAoB,GAAA;AAAA,QACtB,aAAc,CAAA,IAAA;AAAA,QACd,aAAc,CAAA,IAAA;AAAA,QACd,aAAc,CAAA,IAAA;AAAA,QACd,aAAc,CAAA,IAAA;AAAA,OAClB,CAAA;AAEA,MAAA,KAAA,CAAM,SAAU,CAAA,GAAA,CAAI,WAAW,EAAE,QAAA,EAAU,KAAK,CAAA,CAAA;AAAA,KACpD;AAAA,GACJ;AAEA,EACI,uBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACG,GAAA;AAAA,MACA,OAAO,IAAK,CAAA,aAAA,CAAc,EAAE,EAAA,EAAI,wBAAwB,CAAA;AAAA,MACxD,IAAA,sBAAO,MAAO,EAAA,EAAA,CAAA;AAAA,MACd,OAAS,EAAA,aAAA;AAAA,MACR,GAAG,cAAA;AAAA,KAAA;AAAA,GACR,CAAA;AAER,CAAC;;;;"}
|
package/Zoom.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useMapModel } from '@open-pioneer/map';
|
|
3
|
-
import {
|
|
3
|
+
import { ToolButton } from '@open-pioneer/map-ui-components';
|
|
4
|
+
import { useCommonComponentProps } from '@open-pioneer/react-utils';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
import { useIntl } from './_virtual/_virtual-pioneer-module_react-hooks.js';
|
|
6
7
|
import { forwardRef } from 'react';
|
package/Zoom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Zoom.js","sources":["Zoom.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { useMapModel } from \"@open-pioneer/map\";\nimport {\
|
|
1
|
+
{"version":3,"file":"Zoom.js","sources":["Zoom.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { useMapModel } from \"@open-pioneer/map\";\nimport { ToolButton } from \"@open-pioneer/map-ui-components\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { PackageIntl } from \"@open-pioneer/runtime\";\nimport classNames from \"classnames\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC, ForwardedRef, RefAttributes, forwardRef } from \"react\";\nimport { FiMinus, FiPlus } from \"react-icons/fi\";\n\nexport type ZoomInProps = Omit<ZoomProps, \"zoomDirection\">;\n\n/**\n * Provides a button by which the user can zoom into the map.\n *\n * This component composes {@link Zoom}.\n */\nexport const ZoomIn: FC<ZoomInProps> = forwardRef(function ZoomIn(props, ref) {\n return <Zoom zoomDirection=\"in\" ref={ref} {...props} />;\n});\n\nexport type ZoomOutProps = ZoomInProps;\n\n/**\n * Provides a button by which the user can zoom out of the map.\n *\n * This component composes {@link Zoom}.\n */\nexport const ZoomOut: FC<ZoomOutProps> = forwardRef(function ZoomOut(props, ref) {\n return <Zoom zoomDirection=\"out\" ref={ref} {...props} />;\n});\n\nexport interface ZoomProps extends CommonComponentProps, RefAttributes<HTMLButtonElement> {\n /**\n * The map id.\n */\n mapId: string;\n\n /**\n * The zoom direction.\n *\n * The button will either zoom in or zoom out depending on this value.\n */\n zoomDirection: \"in\" | \"out\";\n}\n\n/**\n * Provides a button by which the user can zoom in or zoom out of the map.\n */\nexport const Zoom: FC<ZoomProps> = forwardRef(function Zoom(\n props: ZoomProps,\n ref: ForwardedRef<HTMLButtonElement>\n) {\n const { mapId, zoomDirection } = props;\n const { map } = useMapModel(mapId);\n const intl = useIntl();\n const { defaultClassName, buttonLabel, buttonIcon } = getDirectionProps(intl, zoomDirection);\n\n const { containerProps } = useCommonComponentProps(classNames(\"zoom\", defaultClassName), props);\n\n function zoom() {\n const view = map?.olMap.getView();\n let currZoom = view?.getZoom();\n\n if (view && currZoom !== undefined) {\n if (zoomDirection === \"in\") {\n ++currZoom;\n } else {\n --currZoom;\n }\n\n view.animate({ zoom: currZoom, duration: 200 });\n }\n }\n\n return (\n <ToolButton\n ref={ref}\n label={buttonLabel}\n icon={buttonIcon}\n onClick={zoom}\n {...containerProps}\n />\n );\n});\n\nfunction getDirectionProps(intl: PackageIntl, zoomDirection: \"in\" | \"out\") {\n switch (zoomDirection) {\n case \"in\":\n return {\n defaultClassName: \"zoom-in\",\n buttonLabel: intl.formatMessage({ id: \"zoom-in.title\" }),\n buttonIcon: <FiPlus />\n };\n case \"out\":\n return {\n defaultClassName: \"zoom-out\",\n buttonLabel: intl.formatMessage({ id: \"zoom-out.title\" }),\n buttonIcon: <FiMinus />\n };\n }\n}\n"],"names":["ZoomIn","ZoomOut","Zoom"],"mappings":";;;;;;;;;AAkBO,MAAM,MAA0B,GAAA,UAAA,CAAW,SAASA,OAAAA,CAAO,OAAO,GAAK,EAAA;AAC1E,EAAA,2BAAQ,IAAK,EAAA,EAAA,aAAA,EAAc,IAAK,EAAA,GAAA,EAAW,GAAG,KAAO,EAAA,CAAA,CAAA;AACzD,CAAC,EAAA;AASM,MAAM,OAA4B,GAAA,UAAA,CAAW,SAASC,QAAAA,CAAQ,OAAO,GAAK,EAAA;AAC7E,EAAA,2BAAQ,IAAK,EAAA,EAAA,aAAA,EAAc,KAAM,EAAA,GAAA,EAAW,GAAG,KAAO,EAAA,CAAA,CAAA;AAC1D,CAAC,EAAA;AAmBM,MAAM,IAAsB,GAAA,UAAA,CAAW,SAASC,KAAAA,CACnD,OAC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AA,QAClB,aAAa,IAAK,CAAA,aAAA,CAAc,EAAE,EAAA,EAAI,iBAAiB,CAAA;AAAA,QACvD,UAAA,sBAAa,MAAO,EAAA,EAAA,CAAA;AAAA,OACxB,CAAA;AAAA,IACJ,KAAK,KAAA;AACD,MAAO,OAAA;AAAA,QACH,gBAAkB,EAAA,UAAA;AAAA,QAClB,aAAa,IAAK,CAAA,aAAA,CAAc,EAAE,EAAA,EAAI,kBAAkB,CAAA;AAAA,QACxD,UAAA,sBAAa,OAAQ,EAAA,EAAA,CAAA;AAAA,OACzB,CAAA;AAAA,GACR;AACJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/map-navigation",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.3",
|
|
5
5
|
"description": "This package provides a collection of map navigation controls.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@open-pioneer/chakra-integration": "^1.1.3",
|
|
18
|
-
"@open-pioneer/
|
|
18
|
+
"@open-pioneer/react-utils": "^1.0.0",
|
|
19
|
+
"@open-pioneer/runtime": "^2.1.6",
|
|
19
20
|
"classnames": "^2.3.2",
|
|
20
|
-
"ol": "^9.
|
|
21
|
+
"ol": "^9.2.4",
|
|
21
22
|
"react": "^18.3.1",
|
|
22
|
-
"react-icons": "^
|
|
23
|
-
"@open-pioneer/map": "^0.
|
|
24
|
-
"@open-pioneer/
|
|
23
|
+
"react-icons": "^5.2.1",
|
|
24
|
+
"@open-pioneer/map": "^0.6.0",
|
|
25
|
+
"@open-pioneer/map-ui-components": "^0.1.0"
|
|
25
26
|
},
|
|
26
27
|
"exports": {
|
|
27
28
|
"./package.json": "./package.json",
|