@open-pioneer/coordinate-viewer 0.5.4 → 0.7.0

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,5 +1,41 @@
1
1
  # @open-pioneer/coordinate-viewer
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 310800c: Switch from `peerDependencies` to normal `dependencies`. Peer dependencies have some usability problems when used at scale.
8
+
9
+ ### Patch Changes
10
+
11
+ - 310800c: Update core packages version.
12
+ - 583f1d6: The `mapId` or `map` properties are now optional on individual components.
13
+ You can use the `DefaultMapProvider` to configure an implicit default value.
14
+
15
+ Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
16
+
17
+ - 583f1d6: All UI components in this project now accept the `mapId` (a `string`) _or_ the `map` (a `MapModel`) directly.
18
+ - a8b3449: Switch to a new versioning strategy.
19
+ From now on, packages released by this repository share a common version number.
20
+ - 6b59779: Added option to display geographic coordinates in angle format (DMS) in CoordinateViewer:
21
+
22
+ ```jsx
23
+ <CoordinateViewer mapId="map_id" format="degree" />
24
+ ```
25
+
26
+ - 900eb11: Update dependencies.
27
+ - Updated dependencies [310800c]
28
+ - Updated dependencies [2502050]
29
+ - Updated dependencies [583f1d6]
30
+ - Updated dependencies [583f1d6]
31
+ - Updated dependencies [397d617]
32
+ - Updated dependencies [a8b3449]
33
+ - Updated dependencies [310800c]
34
+ - Updated dependencies [900eb11]
35
+ - Updated dependencies [583f1d6]
36
+ - Updated dependencies [397d617]
37
+ - @open-pioneer/map@0.7.0
38
+
3
39
  ## 0.5.4
4
40
 
5
41
  ### Patch Changes
@@ -1,13 +1,10 @@
1
+ import { MapModelProps } from "@open-pioneer/map";
1
2
  import { CommonComponentProps } from "@open-pioneer/react-utils";
2
3
  import { FC } from "react";
3
4
  /**
4
5
  * These are special properties for the CoordinateViewer.
5
6
  */
6
- export interface CoordinateViewerProps extends CommonComponentProps {
7
- /**
8
- * The id of the map.
9
- */
10
- mapId: string;
7
+ export interface CoordinateViewerProps extends CommonComponentProps, MapModelProps {
11
8
  /**
12
9
  * Number of decimal places shown for coordinates.
13
10
  */
@@ -16,9 +13,17 @@ export interface CoordinateViewerProps extends CommonComponentProps {
16
13
  * Projection of the coordinates shown in the rendered HTML, does not affect the map projection
17
14
  */
18
15
  displayProjectionCode?: string;
16
+ /**
17
+ * Configures the display format.
18
+ * By default, the current coordinates are shown as decimal numbers (format: "decimal").
19
+ *
20
+ * If the format is set to "degree", the coordinates are shown in angular degrees (DMS).
21
+ * This can only be used meaningfully (at this time) if the underlying projection provides lat/lon coordinates.
22
+ */
23
+ format?: "decimal" | "degree";
19
24
  }
20
25
  /**
21
26
  * The `CoordinateViewer`component can be used in an app to render the coordinates at the current mouse position.
22
27
  */
23
28
  export declare const CoordinateViewer: FC<CoordinateViewerProps>;
24
- export declare function useCoordinatesString(coordinates: number[] | undefined, precision: number | undefined): string;
29
+ export declare function useCoordinatesString(coordinates: number[] | undefined, precision: number | undefined, format: CoordinateViewerProps["format"]): string;
@@ -8,22 +8,23 @@ import { useIntl } from './_virtual/_virtual-pioneer-module_react-hooks.js';
8
8
  import { useState, useEffect } from 'react';
9
9
 
10
10
  const DEFAULT_PRECISION = 4;
11
+ const DEFAULT_DISPLAY_FORMAT = "decimal";
11
12
  const CoordinateViewer = (props) => {
12
- const { mapId, precision, displayProjectionCode } = props;
13
+ const { precision, displayProjectionCode, format } = props;
13
14
  const { containerProps } = useCommonComponentProps("coordinate-viewer", props);
14
- const { map } = useMapModel(mapId);
15
+ const { map } = useMapModel(props);
15
16
  const olMap = map?.olMap;
16
17
  const mapProjectionCode = useProjection(olMap)?.getCode() ?? "";
17
18
  let { coordinates } = useCoordinates(olMap);
18
19
  coordinates = coordinates && displayProjectionCode ? transformCoordinates(coordinates, mapProjectionCode, displayProjectionCode) : coordinates;
19
- const coordinatesString = useCoordinatesString(coordinates, precision);
20
+ const coordinatesString = useCoordinatesString(coordinates, precision, format);
20
21
  const projectionString = displayProjectionCode ? displayProjectionCode : mapProjectionCode;
21
22
  const displayString = coordinatesString ? coordinatesString + " " + projectionString : "";
22
23
  return /* @__PURE__ */ jsx(Box, { ...containerProps, children: /* @__PURE__ */ jsx(Text, { className: "coordinate-viewer-text", children: displayString }) });
23
24
  };
24
- function useCoordinatesString(coordinates, precision) {
25
+ function useCoordinatesString(coordinates, precision, format) {
25
26
  const intl = useIntl();
26
- const coordinatesString = coordinates ? formatCoordinates(coordinates, precision, intl) : "";
27
+ const coordinatesString = coordinates ? formatCoordinates(coordinates, precision, intl, format) : "";
27
28
  return coordinatesString;
28
29
  }
29
30
  function useCoordinates(map) {
@@ -39,22 +40,44 @@ function useCoordinates(map) {
39
40
  }, [map]);
40
41
  return { coordinates };
41
42
  }
42
- function formatCoordinates(coordinates, configuredPrecision, intl) {
43
+ function formatCoordinates(coordinates, configuredPrecision, intl, configuredFormat) {
43
44
  if (coordinates[0] == null || coordinates[1] == null) {
44
45
  return "";
45
46
  }
46
47
  const precision = configuredPrecision ?? DEFAULT_PRECISION;
48
+ const format = configuredFormat ?? DEFAULT_DISPLAY_FORMAT;
47
49
  const [x, y] = coordinates;
48
- const xString = intl.formatNumber(x, {
49
- maximumFractionDigits: precision,
50
- minimumFractionDigits: precision
51
- });
52
- const yString = intl.formatNumber(y, {
50
+ let str;
51
+ if (format === "degree" && isFinite(x) && isFinite(y)) {
52
+ const [xHour, xMin, xSek] = toDegree(x, intl, precision);
53
+ const [yHour, yMin, ySek] = toDegree(y, intl, precision);
54
+ const xString = `${Math.abs(xHour)}\xB0${xMin}'${xSek}"${0 <= xHour ? "(E)" : "(W)"}`;
55
+ const yString = `${Math.abs(yHour)}\xB0${yMin}'${ySek}"${0 <= yHour ? "(N)" : "(S)"}`;
56
+ str = xString + " " + yString;
57
+ } else {
58
+ const xString = intl.formatNumber(x, {
59
+ maximumFractionDigits: precision,
60
+ minimumFractionDigits: precision
61
+ });
62
+ const yString = intl.formatNumber(y, {
63
+ maximumFractionDigits: precision,
64
+ minimumFractionDigits: precision
65
+ });
66
+ str = xString + " " + yString;
67
+ }
68
+ return str;
69
+ }
70
+ function toDegree(coordPart, intl, precision) {
71
+ const cHour = Math.floor(coordPart);
72
+ const cNach = coordPart - cHour;
73
+ const cMin = Math.floor(60 * cNach);
74
+ const cMinNach = 60 * cNach - cMin;
75
+ const cSek = 60 * cMinNach;
76
+ const cSekRounded = intl.formatNumber(cSek, {
53
77
  maximumFractionDigits: precision,
54
78
  minimumFractionDigits: precision
55
79
  });
56
- const coordinatesString = xString + " " + yString;
57
- return coordinatesString;
80
+ return [cHour, cMin, cSekRounded];
58
81
  }
59
82
  function transformCoordinates(coordinates, source, destination) {
60
83
  const transformed = transform(coordinates, source, destination);
@@ -1 +1 @@
1
- {"version":3,"file":"CoordinateViewer.js","sources":["CoordinateViewer.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box, Text } from \"@open-pioneer/chakra-integration\";\nimport { useMapModel, useProjection } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { PackageIntl } from \"@open-pioneer/runtime\";\nimport OlMap from \"ol/Map\";\nimport { unByKey } from \"ol/Observable\";\nimport { Coordinate } from \"ol/coordinate\";\nimport { EventsKey } from \"ol/events\";\nimport { transform } from \"ol/proj\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC, useEffect, useState } from \"react\";\n\nconst DEFAULT_PRECISION = 4;\n\n/**\n * These are special properties for the CoordinateViewer.\n */\nexport interface CoordinateViewerProps extends CommonComponentProps {\n /**\n * The id of the map.\n */\n mapId: string;\n\n /**\n * Number of decimal places shown for coordinates.\n */\n precision?: number;\n\n /**\n * Projection of the coordinates shown in the rendered HTML, does not affect the map projection\n */\n displayProjectionCode?: string;\n}\n\n/**\n * The `CoordinateViewer`component can be used in an app to render the coordinates at the current mouse position.\n */\nexport const CoordinateViewer: FC<CoordinateViewerProps> = (props) => {\n const { mapId, precision, displayProjectionCode } = props;\n const { containerProps } = useCommonComponentProps(\"coordinate-viewer\", props);\n const { map } = useMapModel(mapId);\n const olMap = map?.olMap;\n const mapProjectionCode = useProjection(olMap)?.getCode() ?? \"\";\n let { coordinates } = useCoordinates(olMap);\n coordinates =\n coordinates && displayProjectionCode\n ? transformCoordinates(coordinates, mapProjectionCode, displayProjectionCode)\n : coordinates;\n const coordinatesString = useCoordinatesString(coordinates, precision);\n const projectionString = displayProjectionCode ? displayProjectionCode : mapProjectionCode;\n const displayString = coordinatesString ? coordinatesString + \" \" + projectionString : \"\";\n return (\n <Box {...containerProps}>\n <Text className=\"coordinate-viewer-text\">{displayString}</Text>\n </Box>\n );\n};\n\n/* Separate function for easier testing */\nexport function useCoordinatesString(\n coordinates: number[] | undefined,\n precision: number | undefined\n): string {\n const intl = useIntl();\n const coordinatesString = coordinates ? formatCoordinates(coordinates, precision, intl) : \"\";\n return coordinatesString;\n}\n\nfunction useCoordinates(map: OlMap | undefined): { coordinates: Coordinate | undefined } {\n const [coordinates, setCoordinates] = useState<Coordinate | undefined>();\n\n useEffect(() => {\n if (!map) {\n return;\n }\n\n const eventsKey: EventsKey = map.on(\"pointermove\", (evt) => {\n setCoordinates(evt.coordinate);\n });\n\n return () => unByKey(eventsKey);\n }, [map]);\n\n return { coordinates };\n}\n\nfunction formatCoordinates(\n coordinates: number[],\n configuredPrecision: number | undefined,\n intl: PackageIntl\n) {\n if (coordinates[0] == null || coordinates[1] == null) {\n return \"\";\n }\n\n const precision = configuredPrecision ?? DEFAULT_PRECISION;\n const [x, y] = coordinates;\n\n const xString = intl.formatNumber(x, {\n maximumFractionDigits: precision,\n minimumFractionDigits: precision\n });\n const yString = intl.formatNumber(y, {\n maximumFractionDigits: precision,\n minimumFractionDigits: precision\n });\n\n const coordinatesString = xString + \" \" + yString;\n return coordinatesString;\n}\n\nfunction transformCoordinates(\n coordinates: number[],\n source: string,\n destination: string\n): number[] {\n const transformed = transform(coordinates, source, destination);\n return transformed;\n}\n"],"names":[],"mappings":";;;;;;;;;AAcA,MAAM,iBAAoB,GAAA,CAAA,CAAA;AAyBb,MAAA,gBAAA,GAA8C,CAAC,KAAU,KAAA;AAClE,EAAA,MAAM,EAAE,KAAA,EAAO,SAAW,EAAA,qBAAA,EAA0B,GAAA,KAAA,CAAA;AACpD,EAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,uBAAA,CAAwB,qBAAqB,KAAK,CAAA,CAAA;AAC7E,EAAA,MAAM,EAAE,GAAA,EAAQ,GAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AACjC,EAAA,MAAM,QAAQ,GAAK,EAAA,KAAA,CAAA;AACnB,EAAA,MAAM,iBAAoB,GAAA,aAAA,CAAc,KAAK,CAAA,EAAG,SAAa,IAAA,EAAA,CAAA;AAC7D,EAAA,IAAI,EAAE,WAAA,EAAgB,GAAA,cAAA,CAAe,KAAK,CAAA,CAAA;AAC1C,EAAA,WAAA,GACI,eAAe,qBACT,GAAA,oBAAA,CAAqB,WAAa,EAAA,iBAAA,EAAmB,qBAAqB,CAC1E,GAAA,WAAA,CAAA;AACV,EAAM,MAAA,iBAAA,GAAoB,oBAAqB,CAAA,WAAA,EAAa,SAAS,CAAA,CAAA;AACrE,EAAM,MAAA,gBAAA,GAAmB,wBAAwB,qBAAwB,GAAA,iBAAA,CAAA;AACzE,EAAA,MAAM,aAAgB,GAAA,iBAAA,GAAoB,iBAAoB,GAAA,GAAA,GAAM,gBAAmB,GAAA,EAAA,CAAA;AACvF,EACI,uBAAA,GAAA,CAAC,OAAK,GAAG,cAAA,EACL,8BAAC,IAAK,EAAA,EAAA,SAAA,EAAU,wBAA0B,EAAA,QAAA,EAAA,aAAA,EAAc,CAC5D,EAAA,CAAA,CAAA;AAER,EAAA;AAGgB,SAAA,oBAAA,CACZ,aACA,SACM,EAAA;AACN,EAAA,MAAM,OAAO,OAAQ,E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ACvB,qBAAuB,EAAA,SAAA;AAAA,GAC1B,CAAA,CAAA;AAED,EAAM,MAAA,iBAAA,GAAoB,UAAU,GAAM,GAAA,OAAA,CAAA;AAC1C,EAAO,OAAA,iBAAA,CAAA;AACX,CAAA;AAEA,SAAS,oBAAA,CACL,WACA,EAAA,MAAA,EACA,WACQ,EAAA;AACR,EAAA,MAAM,WAAc,GAAA,SAAA,CAAU,WAAa,EAAA,MAAA,EAAQ,WAAW,CAAA,CAAA;AAC9D,EAAO,OAAA,WAAA,CAAA;AACX;;;;"}
1
+ {"version":3,"file":"CoordinateViewer.js","sources":["CoordinateViewer.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box, Text } from \"@open-pioneer/chakra-integration\";\nimport { MapModelProps, useMapModel, useProjection } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { PackageIntl } from \"@open-pioneer/runtime\";\nimport OlMap from \"ol/Map\";\nimport { unByKey } from \"ol/Observable\";\nimport { Coordinate } from \"ol/coordinate\";\nimport { EventsKey } from \"ol/events\";\nimport { transform } from \"ol/proj\";\nimport { useIntl } from \"open-pioneer:react-hooks\";\nimport { FC, useEffect, useState } from \"react\";\n\nconst DEFAULT_PRECISION = 4;\nconst DEFAULT_DISPLAY_FORMAT = \"decimal\";\n\n/**\n * These are special properties for the CoordinateViewer.\n */\nexport interface CoordinateViewerProps extends CommonComponentProps, MapModelProps {\n /**\n * Number of decimal places shown for coordinates.\n */\n precision?: number;\n\n /**\n * Projection of the coordinates shown in the rendered HTML, does not affect the map projection\n */\n displayProjectionCode?: string;\n\n /**\n * Configures the display format.\n * By default, the current coordinates are shown as decimal numbers (format: \"decimal\").\n *\n * If the format is set to \"degree\", the coordinates are shown in angular degrees (DMS).\n * This can only be used meaningfully (at this time) if the underlying projection provides lat/lon coordinates.\n */\n format?: \"decimal\" | \"degree\";\n}\n\n/**\n * The `CoordinateViewer`component can be used in an app to render the coordinates at the current mouse position.\n */\nexport const CoordinateViewer: FC<CoordinateViewerProps> = (props) => {\n const { precision, displayProjectionCode, format } = props;\n const { containerProps } = useCommonComponentProps(\"coordinate-viewer\", props);\n const { map } = useMapModel(props);\n const olMap = map?.olMap;\n const mapProjectionCode = useProjection(olMap)?.getCode() ?? \"\";\n let { coordinates } = useCoordinates(olMap);\n coordinates =\n coordinates && displayProjectionCode\n ? transformCoordinates(coordinates, mapProjectionCode, displayProjectionCode)\n : coordinates;\n const coordinatesString = useCoordinatesString(coordinates, precision, format);\n const projectionString = displayProjectionCode ? displayProjectionCode : mapProjectionCode;\n const displayString = coordinatesString ? coordinatesString + \" \" + projectionString : \"\";\n return (\n <Box {...containerProps}>\n <Text className=\"coordinate-viewer-text\">{displayString}</Text>\n </Box>\n );\n};\n\n/* Separate function for easier testing */\nexport function useCoordinatesString(\n coordinates: number[] | undefined,\n precision: number | undefined,\n format: CoordinateViewerProps[\"format\"]\n): string {\n const intl = useIntl();\n const coordinatesString = coordinates\n ? formatCoordinates(coordinates, precision, intl, format)\n : \"\";\n return coordinatesString;\n}\n\nfunction useCoordinates(map: OlMap | undefined): { coordinates: Coordinate | undefined } {\n const [coordinates, setCoordinates] = useState<Coordinate | undefined>();\n\n useEffect(() => {\n if (!map) {\n return;\n }\n\n const eventsKey: EventsKey = map.on(\"pointermove\", (evt) => {\n setCoordinates(evt.coordinate);\n });\n\n return () => unByKey(eventsKey);\n }, [map]);\n\n return { coordinates };\n}\n\nfunction formatCoordinates(\n coordinates: number[],\n configuredPrecision: number | undefined,\n intl: PackageIntl,\n configuredFormat: CoordinateViewerProps[\"format\"]\n) {\n if (coordinates[0] == null || coordinates[1] == null) {\n return \"\";\n }\n\n const precision = configuredPrecision ?? DEFAULT_PRECISION;\n const format = configuredFormat ?? DEFAULT_DISPLAY_FORMAT;\n const [x, y] = coordinates;\n\n let str;\n if (format === \"degree\" && isFinite(x) && isFinite(y)) {\n const [xHour, xMin, xSek] = toDegree(x, intl, precision);\n const [yHour, yMin, ySek] = toDegree(y, intl, precision);\n\n const xString = `${Math.abs(xHour)}°${xMin}'${xSek}\"${0 <= xHour ? \"(E)\" : \"(W)\"}`;\n const yString = `${Math.abs(yHour)}°${yMin}'${ySek}\"${0 <= yHour ? \"(N)\" : \"(S)\"}`;\n\n str = xString + \" \" + yString;\n } else {\n const xString = intl.formatNumber(x, {\n maximumFractionDigits: precision,\n minimumFractionDigits: precision\n });\n const yString = intl.formatNumber(y, {\n maximumFractionDigits: precision,\n minimumFractionDigits: precision\n });\n str = xString + \" \" + yString;\n }\n return str;\n}\n\nfunction toDegree(\n coordPart: number,\n intl: PackageIntl,\n precision: number\n): [number, number, string] {\n const cHour = Math.floor(coordPart);\n const cNach = coordPart - cHour;\n\n const cMin = Math.floor(60 * cNach);\n const cMinNach = 60 * cNach - cMin;\n\n const cSek = 60 * cMinNach;\n const cSekRounded = intl.formatNumber(cSek, {\n maximumFractionDigits: precision,\n minimumFractionDigits: precision\n });\n\n return [cHour, cMin, cSekRounded];\n}\n\nfunction transformCoordinates(\n coordinates: number[],\n source: string,\n destination: string\n): number[] {\n const transformed = transform(coordinates, source, destination);\n return transformed;\n}\n"],"names":[],"mappings":";;;;;;;;;AAcA,MAAM,iBAAoB,GAAA,CAAA,CAAA;AAC1B,MAAM,sBAAyB,GAAA,SAAA,CAAA;AA6BlB,MAAA,gBAAA,GAA8C,CAAC,KAAU,KAAA;AAClE,EAAA,MAAM,EAAE,SAAA,EAAW,qBAAuB,EAAA,MAAA,EAAW,GAAA,KAAA,CAAA;AACrD,EAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,uBAAA,CAAwB,qBAAqB,KAAK,CAAA,CAAA;AAC7E,EAAA,MAAM,EAAE,GAAA,EAAQ,GAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AACjC,EAAA,MAAM,QAAQ,GAAK,EAAA,KAAA,CAAA;AACnB,EAAA,MAAM,iB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;AACR,EAAA,MAAM,WAAc,GAAA,SAAA,CAAU,WAAa,EAAA,MAAA,EAAQ,WAAW,CAAA,CAAA;AAC9D,EAAO,OAAA,WAAA,CAAA;AACX;;;;"}
package/README.md CHANGED
@@ -22,6 +22,12 @@ To show the coordinates in a specific projection, set the optional `displayProje
22
22
  <CoordinateViewer mapId="map_id" displayProjectionCode="EPSG:4326" />
23
23
  ```
24
24
 
25
+ To show the coordinates in a specific coordinate format, set the optional `format` property (default: `decimal`):
26
+
27
+ ```jsx
28
+ <CoordinateViewer mapId="map_id" format="degree" />
29
+ ```
30
+
25
31
  ## License
26
32
 
27
33
  Apache-2.0 (see `LICENSE` file)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/coordinate-viewer",
4
- "version": "0.5.4",
4
+ "version": "0.7.0",
5
5
  "description": "This package provides a UI component to show the current coordinates at the users current mouse position.",
6
6
  "keywords": [
7
7
  "open-pioneer-trails"
@@ -13,14 +13,13 @@
13
13
  "url": "https://github.com/open-pioneer/trails-openlayers-base-packages",
14
14
  "directory": "src/packages/coordinate-viewer"
15
15
  },
16
- "peerDependencies": {
17
- "@open-pioneer/chakra-integration": "^1.1.4",
18
- "@open-pioneer/react-utils": "^1.0.1",
19
- "@open-pioneer/runtime": "^2.1.7",
16
+ "dependencies": {
17
+ "@open-pioneer/chakra-integration": "^2.3.0",
18
+ "@open-pioneer/react-utils": "^2.3.0",
19
+ "@open-pioneer/runtime": "^2.3.0",
20
20
  "ol": "^9.2.4",
21
- "proj4": "^2.9.0",
22
21
  "react": "^18.3.1",
23
- "@open-pioneer/map": "^0.6.1"
22
+ "@open-pioneer/map": "^0.7.0"
24
23
  },
25
24
  "exports": {
26
25
  "./package.json": "./package.json",