@open-pioneer/map-navigation 1.3.0-dev.20260211111005 → 1.3.0-dev.20260225083007

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @open-pioneer/map-navigation
2
2
 
3
- ## 1.3.0-dev.20260211111005
3
+ ## 1.3.0-dev.20260225083007
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -10,12 +10,14 @@
10
10
  ### Patch Changes
11
11
 
12
12
  - Updated dependencies [9b5d5f3]
13
+ - Updated dependencies [fcbd505]
13
14
  - Updated dependencies [2ceb1ca]
15
+ - Updated dependencies [fcbd505]
14
16
  - Updated dependencies [d54ccfd]
15
17
  - Updated dependencies [4bcc8ce]
16
18
  - Updated dependencies [2ceb1ca]
17
- - @open-pioneer/map-ui-components@1.3.0-dev.20260211111005
18
- - @open-pioneer/map@1.3.0-dev.20260211111005
19
+ - @open-pioneer/map-ui-components@1.3.0-dev.20260225083007
20
+ - @open-pioneer/map@1.3.0-dev.20260225083007
19
21
 
20
22
  ## 1.2.0
21
23
 
package/History.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"History.js","sources":["History.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } from \"@open-pioneer/map\";\nimport { ToolButton } from \"@open-pioneer/map-ui-components\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { PackageIntl } from \"@open-pioneer/runtime\";\nimport classNames from \"classnames\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC, RefAttributes } from \"react\";\nimport { LuCornerUpLeft, LuCornerUpRight } from \"react-icons/lu\";\nimport { useHistoryViewModel } from \"./ViewHistoryModel\";\n\nexport type HistoryForwardProps = Omit<HistoryProps, \"viewDirection\">;\n\n/**\n * Provides a button by which the user can navigate to the next map view.\n *\n * This component composes {@link History}.\n */\nexport const HistoryForward: FC<HistoryForwardProps> = function HistoryForward(\n props: HistoryForwardProps\n) {\n return <History viewDirection=\"forward\" {...props} />;\n};\n\nexport type HistoryBackwardProps = HistoryForwardProps;\n\n/**\n * Provides a button by which the user can navigate to the previous map view.\n *\n * This component composes {@link History}.\n */\nexport const HistoryBackward: FC<HistoryBackwardProps> = function HistoryBackward(\n props: HistoryBackwardProps\n) {\n return <History viewDirection=\"backward\" {...props} />;\n};\n\nexport interface HistoryProps\n extends CommonComponentProps,\n RefAttributes<HTMLButtonElement>,\n MapModelProps {\n /**\n * Additional properties for the `Button` element.\n *\n * Note that the ToolButton also defines some of these props.\n */\n buttonProps?: Partial<ButtonProps>;\n\n /**\n * The view direction.\n *\n * The button will either view forward or view backward depending on this value.\n */\n viewDirection: \"forward\" | \"backward\";\n}\n\n/**\n * Provides a button by which the user can navigate forward or backward in the view history of the map.\n */\nexport const History: FC<HistoryProps> = function History(props: HistoryProps) {\n const intl = useIntl();\n const { buttonProps, viewDirection, ref } = props;\n const map = useMapModelValue(props);\n const viewModel = useHistoryViewModel(map);\n const { defaultClassName, buttonLabel, buttonIcon } = getDirectionProps(intl, viewDirection);\n const { containerProps } = useCommonComponentProps(classNames(\"view\", defaultClassName), props);\n\n const canNavigate = useReactiveSnapshot(() => {\n if (!viewModel) {\n return false;\n }\n\n if (viewDirection === \"forward\") {\n return viewModel.canForward;\n } else {\n return viewModel.canBackward;\n }\n }, [viewModel, viewDirection]);\n const navigate = () => {\n if (!viewModel) {\n return;\n }\n\n if (viewDirection === \"forward\") {\n viewModel.forward();\n } else {\n viewModel.backward();\n }\n };\n\n return (\n viewModel && (\n <ToolButton\n ref={ref}\n {...containerProps}\n buttonProps={buttonProps}\n label={buttonLabel}\n icon={buttonIcon}\n onClick={navigate}\n disabled={!canNavigate}\n />\n )\n );\n};\n\nfunction getDirectionProps(intl: PackageIntl, viewDirection: \"forward\" | \"backward\") {\n switch (viewDirection) {\n case \"forward\":\n return {\n defaultClassName: \"view-forward\",\n buttonLabel: intl.formatMessage({ id: \"view-forward.title\" }),\n buttonIcon: <LuCornerUpRight />\n };\n case \"backward\":\n return {\n defaultClassName: \"view-backward\",\n buttonLabel: intl.formatMessage({ id: \"view-backward.title\" }),\n buttonIcon: <LuCornerUpLeft />\n };\n }\n}\n"],"names":["HistoryForward","HistoryBackward","History"],"mappings":";;;;;;;;;;AAqBO,MAAM,cAAA,GAA0C,SAASA,eAAAA,CAC5D,KAAA,EACF;AACE,EAAA,uBAAO,GAAA,CAAC,OAAA,EAAA,EAAQ,aAAA,EAAc,SAAA,EAAW,GAAG,KAAA,EAAO,CAAA;AACvD;AASO,MAAM,eAAA,GAA4C,SAASC,gBAAAA,CAC9D,KAAA,EACF;AACE,EAAA,uBAAO,GAAA,CAAC,OAAA,EAAA,EAAQ,aAAA,EAAc,UAAA,EAAY,GAAG,KAAA,EAAO,CAAA;AACxD;AAwBO,MAAM,OAAA,GAA4B,SAASC,QAAAA,CAAQ,KAAA,EAAqB;AAC3E,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,EAAE,WAAA,EAAa,aAAA,EAAe,GAAA,EAAI,GAAI,KAAA;AAC5C,EAAA,MAAM,GAAA,GAAM,iBAAiB,KAAK,CAAA;AAClC,EAAA,MAAM,SAAA,GAAY,oBAAoB,GAAG,CAAA;AACzC,EAAA,MAAM,EAAE,gBAAA,EAAkB,WAAA,EAAa,YAAW,GAAI,iBAAA,CAAkB,MAAM,aAAa,CAAA;AAC3F,EAAA,MAAM,EAAE,gBAAe,GAAI,uBAAA,CAAwB,WAAW,MAAA,EAAQ,gBAAgB,GAAG,KAAK,CAAA;AAE9F,EAAA,MAAM,WAAA,GAAc,oBAAoB,MAAM;AAC1C,IAAA,IAAI,CAAC,SAAA,EAAW;AACZ,MA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;AAEZ;;;;"}
1
+ {"version":3,"file":"History.js","sources":["History.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } from \"@open-pioneer/map\";\nimport { ToolButton } from \"@open-pioneer/map-ui-components\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { PackageIntl } from \"@open-pioneer/runtime\";\nimport classNames from \"classnames\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC, RefAttributes } from \"react\";\nimport { LuCornerUpLeft, LuCornerUpRight } from \"react-icons/lu\";\nimport { useHistoryViewModel } from \"./ViewHistoryModel\";\n\nexport type HistoryForwardProps = Omit<HistoryProps, \"viewDirection\">;\n\n/**\n * Provides a button by which the user can navigate to the next map view.\n *\n * This component composes {@link History}.\n */\nexport const HistoryForward: FC<HistoryForwardProps> = function HistoryForward(\n props: HistoryForwardProps\n) {\n return <History viewDirection=\"forward\" {...props} />;\n};\n\nexport type HistoryBackwardProps = HistoryForwardProps;\n\n/**\n * Provides a button by which the user can navigate to the previous map view.\n *\n * This component composes {@link History}.\n */\nexport const HistoryBackward: FC<HistoryBackwardProps> = function HistoryBackward(\n props: HistoryBackwardProps\n) {\n return <History viewDirection=\"backward\" {...props} />;\n};\n\nexport interface HistoryProps\n extends CommonComponentProps, RefAttributes<HTMLButtonElement>, MapModelProps {\n /**\n * Additional properties for the `Button` element.\n *\n * Note that the ToolButton also defines some of these props.\n */\n buttonProps?: Partial<ButtonProps>;\n\n /**\n * The view direction.\n *\n * The button will either view forward or view backward depending on this value.\n */\n viewDirection: \"forward\" | \"backward\";\n}\n\n/**\n * Provides a button by which the user can navigate forward or backward in the view history of the map.\n */\nexport const History: FC<HistoryProps> = function History(props: HistoryProps) {\n const intl = useIntl();\n const { buttonProps, viewDirection, ref } = props;\n const map = useMapModelValue(props);\n const viewModel = useHistoryViewModel(map);\n const { defaultClassName, buttonLabel, buttonIcon } = getDirectionProps(intl, viewDirection);\n const { containerProps } = useCommonComponentProps(classNames(\"view\", defaultClassName), props);\n\n const canNavigate = useReactiveSnapshot(() => {\n if (!viewModel) {\n return false;\n }\n\n if (viewDirection === \"forward\") {\n return viewModel.canForward;\n } else {\n return viewModel.canBackward;\n }\n }, [viewModel, viewDirection]);\n const navigate = () => {\n if (!viewModel) {\n return;\n }\n\n if (viewDirection === \"forward\") {\n viewModel.forward();\n } else {\n viewModel.backward();\n }\n };\n\n return (\n viewModel && (\n <ToolButton\n ref={ref}\n {...containerProps}\n buttonProps={buttonProps}\n label={buttonLabel}\n icon={buttonIcon}\n onClick={navigate}\n disabled={!canNavigate}\n />\n )\n );\n};\n\nfunction getDirectionProps(intl: PackageIntl, viewDirection: \"forward\" | \"backward\") {\n switch (viewDirection) {\n case \"forward\":\n return {\n defaultClassName: \"view-forward\",\n buttonLabel: intl.formatMessage({ id: \"view-forward.title\" }),\n buttonIcon: <LuCornerUpRight />\n };\n case \"backward\":\n return {\n defaultClassName: \"view-backward\",\n buttonLabel: intl.formatMessage({ id: \"view-backward.title\" }),\n buttonIcon: <LuCornerUpLeft />\n };\n }\n}\n"],"names":["HistoryForward","HistoryBackward","History"],"mappings":";;;;;;;;;;AAqBO,MAAM,cAAA,GAA0C,SAASA,eAAAA,CAC5D,KAAA,EACF;AACE,EAAA,uBAAO,GAAA,CAAC,OAAA,EAAA,EAAQ,aAAA,EAAc,SAAA,EAAW,GAAG,KAAA,EAAO,CAAA;AACvD;AASO,MAAM,eAAA,GAA4C,SAASC,gBAAAA,CAC9D,KAAA,EACF;AACE,EAAA,uBAAO,GAAA,CAAC,OAAA,EAAA,EAAQ,aAAA,EAAc,UAAA,EAAY,GAAG,KAAA,EAAO,CAAA;AACxD;AAsBO,MAAM,OAAA,GAA4B,SAASC,QAAAA,CAAQ,KAA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AAA;AAAA,GACf;AAGZ;AAEA,SAAS,iBAAA,CAAkB,MAAmB,aAAA,EAAuC;AACjF,EAAA,QAAQ,aAAA;AAAe,IACnB,KAAK,SAAA;AACD,MAAA,OAAO;AAAA,QACH,gBAAA,EAAkB,cAAA;AAAA,QAClB,aAAa,IAAA,CAAK,aAAA,CAAc,EAAE,EAAA,EAAI,sBAAsB,CAAA;AAAA,QAC5D,UAAA,sBAAa,eAAA,EAAA,EAAgB;AAAA,OACjC;AAAA,IACJ,KAAK,UAAA;AACD,MAAA,OAAO;AAAA,QACH,gBAAA,EAAkB,eAAA;AAAA,QAClB,aAAa,IAAA,CAAK,aAAA,CAAc,EAAE,EAAA,EAAI,uBAAuB,CAAA;AAAA,QAC7D,UAAA,sBAAa,cAAA,EAAA,EAAe;AAAA,OAChC;AAAA;AAEZ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"InitialExtent.js","sources":["InitialExtent.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } 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, RefAttributes } from \"react\";\nimport { LuHouse } from \"react-icons/lu\";\n\nexport interface InitialExtentProps\n extends CommonComponentProps,\n RefAttributes<HTMLButtonElement>,\n MapModelProps {\n /**\n * Additional properties for the `Button` element.\n *\n * Note that the ToolButton also defines some of these props.\n */\n buttonProps?: Partial<ButtonProps>;\n}\n\n/**\n * Provides a simple button that switches the view to its initial viewpoint.\n */\nexport const InitialExtent: FC<InitialExtentProps> = function InitialExtent(\n props: InitialExtentProps\n) {\n const { containerProps } = useCommonComponentProps(\"initial-extent\", props);\n const map = useMapModelValue(props);\n const intl = useIntl();\n const { buttonProps, ref } = props;\n\n function setInitExtent() {\n const initialExtent = map.initialExtent;\n if (initialExtent) {\n const newExtent: Extent = [\n initialExtent.xMin,\n initialExtent.yMin,\n initialExtent.xMax,\n initialExtent.yMax\n ];\n\n map.olView.fit(newExtent, { duration: 200 });\n }\n }\n\n return (\n <ToolButton\n ref={ref}\n buttonProps={buttonProps}\n label={intl.formatMessage({ id: \"initial-extent.title\" })}\n icon={<LuHouse />}\n onClick={setInitExtent}\n {...containerProps}\n />\n );\n};\n"],"names":["InitialExtent"],"mappings":";;;;;;;AA0BO,MAAM,aAAA,GAAwC,SAASA,cAAAA,CAC1D,KAAA,EACF;AACE,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,uBAAA,CAAwB,kBAAkB,KAAK,CAAA;AAC1E,EAAA,MAAM,GAAA,GAAM,iBAAiB,KAAK,CAAA;AAClC,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,EAAE,WAAA,EAAa,GAAA,EAAI,GAAI,KAAA;AAE7B,EAAA,SAAS,aAAA,GAAgB;AACrB,IAAA,MAAM,gBAAgB,GAAA,CAAI,aAAA;AAC1B,IAAA,IAAI,aAAA,EAAe;AACf,MAAA,MAAM,SAAA,GAAoB;AAAA,QACtB,aAAA,CAAc,IAAA;AAAA,QACd,aAAA,CAAc,IAAA;AAAA,QACd,aAAA,CAAc,IAAA;AAAA,QACd,aAAA,CAAc;AAAA,OAClB;AAEA,MAAA,GAAA,CAAI,OAAO,GAAA,CAAI,SAAA,EAAW,EAAE,QAAA,EAAU,KAAK,CAAA;AAAA,IAC/C;AAAA,EACJ;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACG,GAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAO,IAAA,CAAK,aAAA,CAAc,EAAE,EAAA,EAAI,wBAAwB,CAAA;AAAA,MACxD,IAAA,sBAAO,OAAA,EAAA,EAAQ,CAAA;AAAA,MACf,OAAA,EAAS,aAAA;AAAA,MACR,GAAG;AAAA;AAAA,GACR;AAER;;;;"}
1
+ {"version":3,"file":"InitialExtent.js","sources":["InitialExtent.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } 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, RefAttributes } from \"react\";\nimport { LuHouse } from \"react-icons/lu\";\n\nexport interface InitialExtentProps\n extends CommonComponentProps, RefAttributes<HTMLButtonElement>, MapModelProps {\n /**\n * Additional properties for the `Button` element.\n *\n * Note that the ToolButton also defines some of these props.\n */\n buttonProps?: Partial<ButtonProps>;\n}\n\n/**\n * Provides a simple button that switches the view to its initial viewpoint.\n */\nexport const InitialExtent: FC<InitialExtentProps> = function InitialExtent(\n props: InitialExtentProps\n) {\n const { containerProps } = useCommonComponentProps(\"initial-extent\", props);\n const map = useMapModelValue(props);\n const intl = useIntl();\n const { buttonProps, ref } = props;\n\n function setInitExtent() {\n const initialExtent = map.initialExtent;\n if (initialExtent) {\n const newExtent: Extent = [\n initialExtent.xMin,\n initialExtent.yMin,\n initialExtent.xMax,\n initialExtent.yMax\n ];\n\n map.olView.fit(newExtent, { duration: 200 });\n }\n }\n\n return (\n <ToolButton\n ref={ref}\n buttonProps={buttonProps}\n label={intl.formatMessage({ id: \"initial-extent.title\" })}\n icon={<LuHouse />}\n onClick={setInitExtent}\n {...containerProps}\n />\n );\n};\n"],"names":["InitialExtent"],"mappings":";;;;;;;AAwBO,MAAM,aAAA,GAAwC,SAASA,cAAAA,CAC1D,KAAA,EACF;AACE,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,uBAAA,CAAwB,kBAAkB,KAAK,CAAA;AAC1E,EAAA,MAAM,GAAA,GAAM,iBAAiB,KAAK,CAAA;AAClC,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,EAAE,WAAA,EAAa,GAAA,EAAI,GAAI,KAAA;AAE7B,EAAA,SAAS,aAAA,GAAgB;AACrB,IAAA,MAAM,gBAAgB,GAAA,CAAI,aAAA;AAC1B,IAAA,IAAI,aAAA,EAAe;AACf,MAAA,MAAM,SAAA,GAAoB;AAAA,QACtB,aAAA,CAAc,IAAA;AAAA,QACd,aAAA,CAAc,IAAA;AAAA,QACd,aAAA,CAAc,IAAA;AAAA,QACd,aAAA,CAAc;AAAA,OAClB;AAEA,MAAA,GAAA,CAAI,OAAO,GAAA,CAAI,SAAA,EAAW,EAAE,QAAA,EAAU,KAAK,CAAA;AAAA,IAC/C;AAAA,EACJ;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACG,GAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAO,IAAA,CAAK,aAAA,CAAc,EAAE,EAAA,EAAI,wBAAwB,CAAA;AAAA,MACxD,IAAA,sBAAO,OAAA,EAAA,EAAQ,CAAA;AAAA,MACf,OAAA,EAAS,aAAA;AAAA,MACR,GAAG;AAAA;AAAA,GACR;AAER;;;;"}
package/Zoom.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Zoom.js","sources":["Zoom.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } 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, RefAttributes, useState } from \"react\";\nimport { LuMinus, LuPlus } from \"react-icons/lu\";\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> = function ZoomIn(props) {\n return <Zoom zoomDirection=\"in\" {...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> = function ZoomOut(props) {\n return <Zoom zoomDirection=\"out\" {...props} />;\n};\n\nexport interface ZoomProps\n extends CommonComponentProps,\n RefAttributes<HTMLButtonElement>,\n MapModelProps {\n /**\n * Additional properties for the `Button` element.\n *\n * Note that the ToolButton also defines some of these props.\n */\n buttonProps?: Partial<ButtonProps>;\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> = function Zoom(props: ZoomProps) {\n const { buttonProps, zoomDirection, ref } = props;\n const map = useMapModelValue(props);\n const intl = useIntl();\n const [disabled, setDisabled] = useState<boolean>(false);\n const { defaultClassName, buttonLabel, buttonIcon } = getDirectionProps(intl, zoomDirection);\n\n const { containerProps } = useCommonComponentProps(classNames(\"zoom\", defaultClassName), props);\n\n function zoom() {\n if (disabled) {\n return;\n }\n setDisabled(true);\n\n const view = map.olView;\n const maxZoom = view.getMaxZoom() || Number.MAX_SAFE_INTEGER;\n const minZoom = view.getMinZoom() || 0;\n\n let currZoom = map.zoomLevel;\n if (currZoom != null) {\n if (zoomDirection === \"in\" && currZoom < maxZoom) {\n ++currZoom;\n } else if (zoomDirection === \"out\" && currZoom > minZoom) {\n --currZoom;\n }\n\n view.animate({ zoom: currZoom, duration: 200 }, () => setDisabled(false));\n }\n }\n\n return (\n <ToolButton\n ref={ref}\n buttonProps={buttonProps}\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: <LuPlus />\n };\n case \"out\":\n return {\n defaultClassName: \"zoom-out\",\n buttonLabel: intl.formatMessage({ id: \"zoom-out.title\" }),\n buttonIcon: <LuMinus />\n };\n }\n}\n"],"names":["ZoomIn","ZoomOut","Zoom"],"mappings":";;;;;;;;;AAmBO,MAAM,MAAA,GAA0B,SAASA,OAAAA,CAAO,KAAA,EAAO;AAC1D,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAK,aAAA,EAAc,IAAA,EAAM,GAAG,KAAA,EAAO,CAAA;AAC/C;AASO,MAAM,OAAA,GAA4B,SAASC,QAAAA,CAAQ,KAAA,EAAO;AAC7D,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAK,aAAA,EAAc,KAAA,EAAO,GAAG,KAAA,EAAO,CAAA;AAChD;AAwBO,MAAM,IAAA,GAAsB,SAASC,KAAAA,CAAK,KAAA,EAAkB;AAC/D,EAAA,MAAM,EAAE,WAAA,EAAa,aAAA,EAAe,GAAA,EAAI,GAAI,KAAA;AAC5C,EAAA,MAAM,GAAA,GAAM,iBAAiB,KAAK,CAAA;AAClC,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAkB,KAAK,CAAA;AACvD,EAAA,MAAM,EAAE,gBAAA,EAAkB,WAAA,EAAa,YAAW,GAAI,iBAAA,CAAkB,MAAM,aAAa,CAAA;AAE3F,EAAA,MAAM,EAAE,gBAAe,GAAI,uBAAA,CAAwB,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ACvD,UAAA,sBAAa,MAAA,EAAA,EAAO;AAAA,OACxB;AAAA,IACJ,KAAK,KAAA;AACD,MAAA,OAAO;AAAA,QACH,gBAAA,EAAkB,UAAA;AAAA,QAClB,aAAa,IAAA,CAAK,aAAA,CAAc,EAAE,EAAA,EAAI,kBAAkB,CAAA;AAAA,QACxD,UAAA,sBAAa,OAAA,EAAA,EAAQ;AAAA,OACzB;AAAA;AAEZ;;;;"}
1
+ {"version":3,"file":"Zoom.js","sources":["Zoom.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonProps } from \"@chakra-ui/react\";\nimport { MapModelProps, useMapModelValue } 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, RefAttributes, useState } from \"react\";\nimport { LuMinus, LuPlus } from \"react-icons/lu\";\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> = function ZoomIn(props) {\n return <Zoom zoomDirection=\"in\" {...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> = function ZoomOut(props) {\n return <Zoom zoomDirection=\"out\" {...props} />;\n};\n\nexport interface ZoomProps\n extends CommonComponentProps, RefAttributes<HTMLButtonElement>, MapModelProps {\n /**\n * Additional properties for the `Button` element.\n *\n * Note that the ToolButton also defines some of these props.\n */\n buttonProps?: Partial<ButtonProps>;\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> = function Zoom(props: ZoomProps) {\n const { buttonProps, zoomDirection, ref } = props;\n const map = useMapModelValue(props);\n const intl = useIntl();\n const [disabled, setDisabled] = useState<boolean>(false);\n const { defaultClassName, buttonLabel, buttonIcon } = getDirectionProps(intl, zoomDirection);\n\n const { containerProps } = useCommonComponentProps(classNames(\"zoom\", defaultClassName), props);\n\n function zoom() {\n if (disabled) {\n return;\n }\n setDisabled(true);\n\n const view = map.olView;\n const maxZoom = view.getMaxZoom() || Number.MAX_SAFE_INTEGER;\n const minZoom = view.getMinZoom() || 0;\n\n let currZoom = map.zoomLevel;\n if (currZoom != null) {\n if (zoomDirection === \"in\" && currZoom < maxZoom) {\n ++currZoom;\n } else if (zoomDirection === \"out\" && currZoom > minZoom) {\n --currZoom;\n }\n\n view.animate({ zoom: currZoom, duration: 200 }, () => setDisabled(false));\n }\n }\n\n return (\n <ToolButton\n ref={ref}\n buttonProps={buttonProps}\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: <LuPlus />\n };\n case \"out\":\n return {\n defaultClassName: \"zoom-out\",\n buttonLabel: intl.formatMessage({ id: \"zoom-out.title\" }),\n buttonIcon: <LuMinus />\n };\n }\n}\n"],"names":["ZoomIn","ZoomOut","Zoom"],"mappings":";;;;;;;;;AAmBO,MAAM,MAAA,GAA0B,SAASA,OAAAA,CAAO,KAAA,EAAO;AAC1D,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAK,aAAA,EAAc,IAAA,EAAM,GAAG,KAAA,EAAO,CAAA;AAC/C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A;AAAA,MACN;AAEA,MAAA,IAAA,CAAK,OAAA,CAAQ,EAAE,IAAA,EAAM,QAAA,EAAU,QAAA,EAAU,KAAI,EAAG,MAAM,WAAA,CAAY,KAAK,CAAC,CAAA;AAAA,IAC5E;AAAA,EACJ;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACG,GAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA,EAAO,WAAA;AAAA,MACP,IAAA,EAAM,UAAA;AAAA,MACN,OAAA,EAAS,IAAA;AAAA,MACR,GAAG;AAAA;AAAA,GACR;AAER;AAEA,SAAS,iBAAA,CAAkB,MAAmB,aAAA,EAA6B;AACvE,EAAA,QAAQ,aAAA;AAAe,IACnB,KAAK,IAAA;AACD,MAAA,OAAO;AAAA,QACH,gBAAA,EAAkB,SAAA;AAAA,QAClB,aAAa,IAAA,CAAK,aAAA,CAAc,EAAE,EAAA,EAAI,iBAAiB,CAAA;AAAA,QACvD,UAAA,sBAAa,MAAA,EAAA,EAAO;AAAA,OACxB;AAAA,IACJ,KAAK,KAAA;AACD,MAAA,OAAO;AAAA,QACH,gBAAA,EAAkB,UAAA;AAAA,QAClB,aAAa,IAAA,CAAK,aAAA,CAAc,EAAE,EAAA,EAAI,kBAAkB,CAAA;AAAA,QACxD,UAAA,sBAAa,OAAA,EAAA,EAAQ;AAAA,OACzB;AAAA;AAEZ;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/map-navigation",
4
- "version": "1.3.0-dev.20260211111005",
4
+ "version": "1.3.0-dev.20260225083007",
5
5
  "description": "This package provides a collection of map navigation controls.",
6
6
  "keywords": [
7
7
  "open-pioneer-trails"
@@ -23,8 +23,8 @@
23
23
  "ol": "^10.7.0",
24
24
  "react": "^19.2.4",
25
25
  "react-icons": "^5.5.0",
26
- "@open-pioneer/map": "1.3.0-dev.20260211111005",
27
- "@open-pioneer/map-ui-components": "1.3.0-dev.20260211111005"
26
+ "@open-pioneer/map": "1.3.0-dev.20260225083007",
27
+ "@open-pioneer/map-ui-components": "1.3.0-dev.20260225083007"
28
28
  },
29
29
  "exports": {
30
30
  "./package.json": "./package.json",