@open-pioneer/geolocation 0.11.0 → 0.12.0-dev.20250725080856
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 +18 -1
- package/Geolocation.js +2 -2
- package/Geolocation.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @open-pioneer/geolocation
|
|
2
2
|
|
|
3
|
+
## 0.12.0-dev.20250725080856
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2732052: Icons have been changed to unify the appearance of the components. Preferably, Lucide react-icons are used.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 10d2fe7: Update dependencies
|
|
12
|
+
- da6a410: Update dependencies
|
|
13
|
+
- Updated dependencies [10d2fe7]
|
|
14
|
+
- Updated dependencies [2702df4]
|
|
15
|
+
- Updated dependencies [8986b3b]
|
|
16
|
+
- Updated dependencies [f1f69f2]
|
|
17
|
+
- Updated dependencies [da6a410]
|
|
18
|
+
- @open-pioneer/map@0.12.0-dev.20250725080856
|
|
19
|
+
- @open-pioneer/map-ui-components@0.12.0-dev.20250725080856
|
|
20
|
+
|
|
3
21
|
## 0.11.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -95,7 +113,6 @@
|
|
|
95
113
|
|
|
96
114
|
- b717121: Update from OL 9 to OL 10.
|
|
97
115
|
- 2fa8020: Update trails core package dependencies.
|
|
98
|
-
|
|
99
116
|
- Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
|
|
100
117
|
- Removes any obsolete references to `@chakra-ui/system`.
|
|
101
118
|
This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
|
package/Geolocation.js
CHANGED
|
@@ -5,7 +5,7 @@ import { useCommonComponentProps } from '@open-pioneer/react-utils';
|
|
|
5
5
|
import { useReactiveSnapshot } from '@open-pioneer/reactivity';
|
|
6
6
|
import { useIntl, useService } from './_virtual/_virtual-pioneer-module_react-hooks.js';
|
|
7
7
|
import { useState, useEffect } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { LuLocateFixed } from 'react-icons/lu';
|
|
9
9
|
import { GeolocationController } from './GeolocationController.js';
|
|
10
10
|
|
|
11
11
|
const Geolocation = function Geolocation2(props) {
|
|
@@ -53,7 +53,7 @@ const GeolocationImpl = function GeolocationImpl2(props) {
|
|
|
53
53
|
ref,
|
|
54
54
|
buttonProps,
|
|
55
55
|
label,
|
|
56
|
-
icon: /* @__PURE__ */ jsx(
|
|
56
|
+
icon: /* @__PURE__ */ jsx(LuLocateFixed, {}),
|
|
57
57
|
onClick: () => toggleActiveState(),
|
|
58
58
|
active: isActive,
|
|
59
59
|
loading: isLoading,
|
package/Geolocation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Geolocation.js","sources":["Geolocation.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 { MapModel, MapModelProps, useMapModel } from \"@open-pioneer/map\";\nimport { ToolButton } from \"@open-pioneer/map-ui-components\";\nimport { NotificationService } from \"@open-pioneer/notifier\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { StyleLike } from \"ol/style/Style\";\nimport { useIntl, useService } from \"open-pioneer:react-hooks\";\nimport { FC, RefAttributes, useEffect, useState } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"Geolocation.js","sources":["Geolocation.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 { MapModel, MapModelProps, useMapModel } from \"@open-pioneer/map\";\nimport { ToolButton } from \"@open-pioneer/map-ui-components\";\nimport { NotificationService } from \"@open-pioneer/notifier\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { useReactiveSnapshot } from \"@open-pioneer/reactivity\";\nimport { StyleLike } from \"ol/style/Style\";\nimport { useIntl, useService } from \"open-pioneer:react-hooks\";\nimport { FC, RefAttributes, useEffect, useState } from \"react\";\nimport { LuLocateFixed } from \"react-icons/lu\";\nimport { GeolocationController, OnErrorCallback } from \"./GeolocationController\";\n\n/**\n * These are properties supported by the {@link Geolocation} component.\n */\nexport interface GeolocationProps\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 * The default maximal zoom level\n */\n maxZoom?: number;\n /**\n * Style to be applied for the positioning highlight feature.\n */\n positionFeatureStyle?: StyleLike;\n /**\n * Style to be applied for the accuracy highlight of the positioning feature.\n */\n accuracyFeatureStyle?: StyleLike;\n /**\n * Position options for the Geolocation-Object.\n * See [PositionOptions](https://www.w3.org/TR/geolocation/#position_options_interface) for more details.\n *\n * NOTE: Changing the tracking options at runtime will reset the component's state.\n */\n trackingOptions?: PositionOptions;\n}\n\nexport const Geolocation: FC<GeolocationProps> = function Geolocation(props: GeolocationProps) {\n const { maxZoom, positionFeatureStyle, accuracyFeatureStyle, trackingOptions, ref } = props;\n const { map } = useMapModel(props);\n const controller = useController(\n map,\n maxZoom,\n trackingOptions,\n positionFeatureStyle,\n accuracyFeatureStyle\n );\n return controller && <GeolocationImpl {...props} controller={controller} ref={ref} />;\n};\n\n// This is a separate component so we can act like the controller is always present.\n// This is the case in practice (except for the initial loading phase where the component is not-yet-mounted).\nconst GeolocationImpl = function GeolocationImpl(\n props: GeolocationProps & { controller: GeolocationController }\n) {\n const { controller, buttonProps, ref } = props;\n const { containerProps } = useCommonComponentProps(\"geolocation\", props);\n const { isLoading, isActive } = useReactiveSnapshot(() => {\n return {\n isLoading: controller.loading,\n isActive: controller.active\n };\n }, [controller]);\n\n const intl = useIntl();\n const label = (() => {\n if (!controller.supported) {\n return intl.formatMessage({ id: \"locateNotSupported\" });\n }\n\n if (isActive) {\n return intl.formatMessage({ id: \"locateMeEnd\" });\n } else {\n return intl.formatMessage({ id: \"locateMeStart\" });\n }\n })();\n\n const toggleActiveState = () => {\n if (controller.active) {\n controller.stopGeolocation();\n } else {\n controller.startGeolocation();\n }\n };\n\n return (\n <ToolButton\n ref={ref}\n buttonProps={buttonProps}\n label={label}\n icon={<LuLocateFixed />}\n onClick={() => toggleActiveState()}\n active={isActive}\n loading={isLoading}\n disabled={!controller.supported}\n {...containerProps}\n />\n );\n};\n\nfunction useController(\n map: MapModel | undefined,\n maxZoom: number | undefined,\n trackingOptions: PositionOptions | undefined,\n positionFeatureStyle: StyleLike | undefined,\n accuracyFeatureStyle: StyleLike | undefined\n): GeolocationController | undefined {\n const intl = useIntl();\n const notificationService = useService<NotificationService>(\"notifier.NotificationService\");\n const [controller, setController] = useState<GeolocationController>();\n useEffect(() => {\n if (!map) {\n return;\n }\n\n const onError: OnErrorCallback = (error) => {\n const title = intl.formatMessage({ id: \"error\" });\n const description = (() => {\n switch (error) {\n case \"permission-denied\":\n return intl.formatMessage({ id: \"permissionDenied\" });\n case \"position-unavailable\":\n return intl.formatMessage({ id: \"positionUnavailable\" });\n case \"timeout\":\n return intl.formatMessage({ id: \"timeout\" });\n case \"unknown\":\n return intl.formatMessage({ id: \"unknownError\" });\n }\n })();\n\n notificationService.notify({\n level: \"error\",\n title: title,\n message: description\n });\n };\n\n const geolocationController = new GeolocationController(map, onError, trackingOptions);\n setController(geolocationController);\n\n return () => {\n geolocationController.destroy();\n setController(undefined);\n };\n }, [map, trackingOptions, intl, notificationService]);\n useEffect(() => {\n controller?.setPositionFeatureStyle(positionFeatureStyle);\n }, [controller, positionFeatureStyle]);\n useEffect(() => {\n controller?.setAccuracyFeatureStyle(accuracyFeatureStyle);\n }, [controller, accuracyFeatureStyle]);\n useEffect(() => {\n controller?.setMaxZoom(maxZoom);\n }, [controller, maxZoom]);\n return controller;\n}\n"],"names":["Geolocation","GeolocationImpl"],"mappings":";;;;;;;;;;AAgDa,MAAA,WAAA,GAAoC,SAASA,YAAAA,CAAY,KAAyB,EAAA;AAC3F,EAAA,MAAM,EAAE,OAAS,EAAA,oBAAA,EAAsB,oBAAsB,EAAA,eAAA,EAAiB,KAAQ,GAAA,KAAA;AACtF,EAAA,MAAM,EAAE,GAAA,EAAQ,GAAA,WAAA,CAAY,KAAK,CAAA;AACjC,EAAA,MAAM,UAAa,GAAA,aAAA;AAAA,IACf,GAAA;AAAA,IACA,OAAA;AAAA,IACA,eAAA;AAAA,IACA,oBAAA;AAAA,IACA;AAAA,GACJ;AACA,EAAA,OAAO,8BAAe,GAAA,CAAA,eAAA,EAAA,EAAiB,GAAG,KAAA,EAAO,YAAwB,GAAU,EAAA,CAAA;AACvF;AAIA,MAAM,eAAA,GAAkB,SAASC,gBAAAA,CAC7B,KACF,EAAA;AACE,EAAA,MAAM,EAAE,UAAA,EAAY,WAAa,EAAA,GAAA,EAAQ,GAAA,KAAA;AACzC,EAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,uBAAA,CAAwB,eAAe,KAAK,CAAA;AACvE,EAAA,MAAM,EAAE,SAAA,EAAW,QAAS,EAAA,GAAI,oBAAoB,MAAM;AACtD,IAAO,OAAA;AAAA,MACH,WAAW,UAAW,CAAA,OAAA;AAAA,MACtB,UAAU,UAAW,CAAA;AAAA,KACzB;AAAA,GACJ,EAAG,CAAC,UAAU,CAAC,CAAA;AAEf,EAAA,MAAM,OAAO,OAAQ,EAAA;AACrB,EAAA,MAAM,SAAS,MAAM;AACjB,IAAI,IAAA,CAAC,WAAW,SAAW,EAAA;AACvB,MAAA,OAAO,IAAK,CAAA,aAAA,CAAc,EAAE,EAAA,EAAI,sBAAsB,CAA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AA,GAC/B,EAAA,CAAC,UAAY,EAAA,OAAO,CAAC,CAAA;AACxB,EAAO,OAAA,UAAA;AACX;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/geolocation",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.0-dev.20250725080856",
|
|
5
5
|
"description": "This package provides a component to locate a user's position.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@conterra/reactivity-core": "^0.7.0",
|
|
18
|
-
"@chakra-ui/react": "^3.
|
|
18
|
+
"@chakra-ui/react": "^3.21.1",
|
|
19
19
|
"@open-pioneer/core": "^4.0.0",
|
|
20
20
|
"@open-pioneer/notifier": "^4.0.0",
|
|
21
21
|
"@open-pioneer/react-utils": "^4.0.0",
|
|
22
22
|
"@open-pioneer/reactivity": "^4.0.0",
|
|
23
23
|
"@open-pioneer/runtime": "^4.0.0",
|
|
24
|
-
"ol": "^10.
|
|
24
|
+
"ol": "^10.6.1",
|
|
25
25
|
"react": "^19.1.0",
|
|
26
26
|
"react-icons": "^5.5.0",
|
|
27
|
-
"@open-pioneer/map": "
|
|
28
|
-
"@open-pioneer/map-ui-components": "
|
|
27
|
+
"@open-pioneer/map": "0.12.0-dev.20250725080856",
|
|
28
|
+
"@open-pioneer/map-ui-components": "0.12.0-dev.20250725080856"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
31
31
|
"./package.json": "./package.json",
|