@open-pioneer/measurement 1.4.0-dev.20260727093741 → 1.4.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,14 +1,16 @@
1
1
  # @open-pioneer/measurement
2
2
 
3
- ## 1.4.0-dev.20260727093741
3
+ ## 1.4.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
7
  - c30396d: Update Chakra to 3.36.1
8
+ - d862003: Update to trails core-packages 4.7.0
8
9
 
9
10
  ### Patch Changes
10
11
 
11
12
  - 078bef5: Use private JavaScript properties (#) instead of TypeScript keyword.
13
+ - c16a401: Migrated from eslint to oxlint and from prettier to oxfmt.
12
14
 
13
15
  ## 1.3.0
14
16
 
@@ -132,6 +134,7 @@
132
134
 
133
135
  - b152428: Update trails dependencies
134
136
  - 23b48ad: Add two new optional properties:
137
+
135
138
  - `predefinedMeasurements`: an array of measurements that will be added to the map (without user interaction)
136
139
  - `onMeasurementsChange`: an event listener that will be called when measurements are added or removed
137
140
 
@@ -1 +1 @@
1
- {"version":3,"file":"Measurement.js","sources":["Measurement.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box, Button, Field, HStack, Text } from \"@chakra-ui/react\";\nimport { NativeSelectField, NativeSelectRoot } from \"@open-pioneer/chakra-snippets/native-select\";\nimport { LayerFactory, MapModel, MapModelProps, useMapModelValue } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { PackageIntl } from \"@open-pioneer/runtime\";\nimport LineString from \"ol/geom/LineString\";\nimport Polygon from \"ol/geom/Polygon\";\nimport { Circle as CircleStyle, Fill, Stroke, Style } from \"ol/style\";\nimport { StyleLike } from \"ol/style/Style\";\nimport { useIntl, useService } from \"open-pioneer:react-hooks\";\nimport { FC, useEffect, useState } from \"react\";\nimport { MeasurementController, MeasurementType } from \"./MeasurementController\";\n\n/** Emitted when a new measurement is being added to the map. */\nexport interface MeasurementsAddEvent {\n kind: \"add-measurement\";\n geometry: MeasurementGeometry;\n}\n\n/** Emitted when a measurement is being removed from the map. */\nexport interface MeasurementsRemoveEvent {\n kind: \"remove-measurement\";\n geometry: MeasurementGeometry;\n}\n\n/**\n * A change event emitted by {@link Measurement} when measurements change.\n *\n * NOTE: Non-exhaustive. More event types may be added in a future version.\n **/\nexport type MeasurementsChangeEvent = MeasurementsAddEvent | MeasurementsRemoveEvent;\n\n/**\n * Represents the geometry of a measurement.\n */\nexport type MeasurementGeometry = LineString | Polygon;\n\n/**\n * This is for special properties of the Measurement.\n */\nexport interface MeasurementProps extends CommonComponentProps, MapModelProps {\n /**\n * The style for the active drawing feature's geometry.\n */\n activeFeatureStyle?: StyleLike;\n\n /**\n * The style for the finished drawn feature's geometry.\n */\n finishedFeatureStyle?: StyleLike;\n\n /**\n * List of measurements to be rendered when the component is initialized.\n */\n predefinedMeasurements?: MeasurementGeometry[];\n\n /**\n * Event handler that is called whenever a measurement is added or removed.\n */\n onMeasurementsChange?: (event: MeasurementsChangeEvent) => void;\n}\n\n/**\n * The `Measurement` component can be used in an app to measure geometries (areas or lines) on the map.\n */\nexport const Measurement: FC<MeasurementProps> = (props) => {\n const intl = useIntl();\n const { containerProps } = useCommonComponentProps(\"measurement\", props);\n const [selectedMeasurement, setMeasurement] = useState<MeasurementType>(\"distance\");\n const label = (id: string) => intl.formatMessage({ id: id });\n const map = useMapModelValue(props);\n const controller = useController(map, props, intl);\n\n // Start / Stop measurement on selection change\n useEffect(() => {\n if (!controller) {\n return;\n }\n\n controller.startMeasurement(selectedMeasurement);\n return () => {\n controller.stopMeasurement();\n };\n }, [controller, selectedMeasurement]);\n\n function changeMeasurement(measurementType: string) {\n if (measurementType === \"distance\" || measurementType === \"area\") {\n setMeasurement(measurementType);\n } else {\n throw new Error(`Unexpected measurement type: '${measurementType}'.`);\n }\n }\n\n function removeMeasurements() {\n controller?.clearMeasurements();\n }\n\n return (\n <Box {...containerProps}>\n <Text mb={3}>{intl.formatMessage({ id: \"measurementInfoText\" })}</Text>\n <Field.Root mb={4} asChild>\n <HStack mb={2} alignItems=\"center\">\n <Field.Label mb={1}>{label(\"measurementLabel\")}</Field.Label>\n <NativeSelectRoot>\n <NativeSelectField\n value={selectedMeasurement}\n onChange={(e) => changeMeasurement(e.target.value)}\n className=\"measurement-select\"\n >\n <option value={\"distance\"}>{label(\"distance\")}</option>\n <option value={\"area\"}>{label(\"area\")}</option>\n </NativeSelectField>\n </NativeSelectRoot>\n </HStack>\n </Field.Root>\n <Button\n padding={2}\n className=\"measurement-delete-button\"\n onClick={removeMeasurements}\n width=\"100%\"\n >\n {label(\"deleteMeasurementLabel\")}\n </Button>\n </Box>\n );\n};\n\n/** Creates a MeasurementController instance for the given map. */\nfunction useController(map: MapModel, props: MeasurementProps, intl: PackageIntl) {\n const {\n activeFeatureStyle,\n finishedFeatureStyle,\n onMeasurementsChange,\n predefinedMeasurements\n } = props;\n const [controller, setController] = useState<MeasurementController | undefined>(undefined);\n const layerFactory = useService<LayerFactory>(\"map.LayerFactory\");\n useEffect(() => {\n if (!map) {\n return;\n }\n const controller = new MeasurementController(map, layerFactory, {\n getContinueMessage() {\n return intl.formatMessage({ id: \"tooltips.continue\" });\n },\n getHelpMessage() {\n return intl.formatMessage({ id: \"tooltips.help\" });\n },\n formatNumber(value) {\n return intl.formatNumber(value, {\n maximumFractionDigits: 2\n });\n }\n });\n\n setController(controller);\n return () => {\n controller.destroy();\n setController(undefined);\n };\n }, [map, intl, layerFactory]);\n\n // Synchronize styles with controller\n useEffect(() => {\n controller?.setActiveFeatureStyle(activeFeatureStyle ?? getDefaultActiveFeatureStyle());\n }, [controller, activeFeatureStyle]);\n useEffect(() => {\n controller?.setFinishedFeatureStyle(\n finishedFeatureStyle ?? getDefaultFinishedFeatureStyle()\n );\n }, [controller, finishedFeatureStyle]);\n useEffect(() => {\n controller?.setMeasurementSourceChangedHandler(onMeasurementsChange);\n }, [controller, onMeasurementsChange]);\n\n useEffect(() => {\n controller?.setPredefinedMeasurements(predefinedMeasurements ?? []);\n }, [controller, predefinedMeasurements]);\n return controller;\n}\n\nfunction getDefaultActiveFeatureStyle() {\n return [\n new Style({\n stroke: new Stroke({\n color: \"#fff\",\n lineDash: [10, 10],\n width: 5\n })\n }),\n new Style({\n fill: new Fill({\n color: \"rgba(0,0,0,0.15)\"\n }),\n stroke: new Stroke({\n color: \"rgba(0, 0, 0, 0.7)\",\n lineDash: [10, 10],\n width: 3\n }),\n image: new CircleStyle({\n radius: 5,\n stroke: new Stroke({\n color: \"rgba(0, 0, 0, 0.7)\",\n width: 2\n }),\n fill: new Fill({\n color: \"rgba(255, 255, 255, 0.2)\"\n })\n })\n })\n ];\n}\n\nfunction getDefaultFinishedFeatureStyle() {\n return [\n new Style({\n stroke: new Stroke({\n color: \"#fff\",\n width: 5\n })\n }),\n new Style({\n stroke: new Stroke({\n color: \"#0b96fc\",\n width: 3\n }),\n fill: new Fill({\n color: \"rgba(11,150,252,0.15)\"\n })\n })\n ];\n}\n"],"names":["controller","CircleStyle"],"mappings":";;;;;;;;;;AAmEO,MAAM,WAAA,GAAoC,CAAC,KAAA,KAAU;AACxD,EAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,uBAAA,CAAwB,eAAe,KAAK,CAAA;AACvE,EAAA,MAAM,CAAC,mBAAA,EAAqB,cAAc,CAAA,GAAI,SAA0B,UAAU,CAAA;AAClF,EAAA,MAAM,QAAQ,CAAC,EAAA,KAAe,KAAK,aAAA,CAAc,EAAE,IAAQ,CAAA;AAC3D,EAAA,MAAM,GAAA,GAAM,iBAAiB,KAAK,CAAA;AAClC,EAAA,MAAM,UAAA,GAAa,aAAA,CAAc,GAAA,EAAK,KAAA,EAAO,IAAI,CAAA;AAGjD,EAAA,SAAA,CAAU,MAAM;AACZ,IAAA,IAAI,C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measurement.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Box, Button, Field, HStack, Text } from \"@chakra-ui/react\";\nimport { NativeSelectField, NativeSelectRoot } from \"@open-pioneer/chakra-snippets/native-select\";\nimport { LayerFactory, MapModel, MapModelProps, useMapModelValue } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { PackageIntl } from \"@open-pioneer/runtime\";\nimport LineString from \"ol/geom/LineString\";\nimport Polygon from \"ol/geom/Polygon\";\nimport { Circle as CircleStyle, Fill, Stroke, Style } from \"ol/style\";\nimport { StyleLike } from \"ol/style/Style\";\nimport { useIntl, useService } from \"open-pioneer:react-hooks\";\nimport { FC, useEffect, useState } from \"react\";\nimport { MeasurementController, MeasurementType } from \"./MeasurementController\";\n\n/** Emitted when a new measurement is being added to the map. */\nexport interface MeasurementsAddEvent {\n kind: \"add-measurement\";\n geometry: MeasurementGeometry;\n}\n\n/** Emitted when a measurement is being removed from the map. */\nexport interface MeasurementsRemoveEvent {\n kind: \"remove-measurement\";\n geometry: MeasurementGeometry;\n}\n\n/**\n * A change event emitted by {@link Measurement} when measurements change.\n *\n * NOTE: Non-exhaustive. More event types may be added in a future version.\n **/\nexport type MeasurementsChangeEvent = MeasurementsAddEvent | MeasurementsRemoveEvent;\n\n/**\n * Represents the geometry of a measurement.\n */\nexport type MeasurementGeometry = LineString | Polygon;\n\n/**\n * This is for special properties of the Measurement.\n */\nexport interface MeasurementProps extends CommonComponentProps, MapModelProps {\n /**\n * The style for the active drawing feature's geometry.\n */\n activeFeatureStyle?: StyleLike;\n\n /**\n * The style for the finished drawn feature's geometry.\n */\n finishedFeatureStyle?: StyleLike;\n\n /**\n * List of measurements to be rendered when the component is initialized.\n */\n predefinedMeasurements?: MeasurementGeometry[];\n\n /**\n * Event handler that is called whenever a measurement is added or removed.\n */\n onMeasurementsChange?: (event: MeasurementsChangeEvent) => void;\n}\n\n/**\n * The `Measurement` component can be used in an app to measure geometries (areas or lines) on the map.\n */\nexport const Measurement: FC<MeasurementProps> = (props) => {\n const intl = useIntl();\n const { containerProps } = useCommonComponentProps(\"measurement\", props);\n const [selectedMeasurement, setMeasurement] = useState<MeasurementType>(\"distance\");\n const label = (id: string) => intl.formatMessage({ id: id });\n const map = useMapModelValue(props);\n const controller = useController(map, props, intl);\n\n // Start / Stop measurement on selection change\n useEffect(() => {\n if (!controller) {\n return;\n }\n\n controller.startMeasurement(selectedMeasurement);\n return () => {\n controller.stopMeasurement();\n };\n }, [controller, selectedMeasurement]);\n\n function changeMeasurement(measurementType: string) {\n if (measurementType === \"distance\" || measurementType === \"area\") {\n setMeasurement(measurementType);\n } else {\n throw new Error(`Unexpected measurement type: '${measurementType}'.`);\n }\n }\n\n function removeMeasurements() {\n controller?.clearMeasurements();\n }\n\n return (\n <Box {...containerProps}>\n <Text mb={3}>{intl.formatMessage({ id: \"measurementInfoText\" })}</Text>\n <Field.Root mb={4} asChild>\n <HStack mb={2} alignItems=\"center\">\n <Field.Label mb={1}>{label(\"measurementLabel\")}</Field.Label>\n <NativeSelectRoot>\n <NativeSelectField\n value={selectedMeasurement}\n onChange={(e) => changeMeasurement(e.target.value)}\n className=\"measurement-select\"\n >\n <option value={\"distance\"}>{label(\"distance\")}</option>\n <option value={\"area\"}>{label(\"area\")}</option>\n </NativeSelectField>\n </NativeSelectRoot>\n </HStack>\n </Field.Root>\n <Button\n padding={2}\n className=\"measurement-delete-button\"\n onClick={removeMeasurements}\n width=\"100%\"\n >\n {label(\"deleteMeasurementLabel\")}\n </Button>\n </Box>\n );\n};\n\n/** Creates a MeasurementController instance for the given map. */\nfunction useController(map: MapModel, props: MeasurementProps, intl: PackageIntl) {\n const {\n activeFeatureStyle,\n finishedFeatureStyle,\n onMeasurementsChange,\n predefinedMeasurements\n } = props;\n const [controller, setController] = useState<MeasurementController | undefined>(undefined);\n const layerFactory = useService<LayerFactory>(\"map.LayerFactory\");\n useEffect(() => {\n if (!map) {\n return;\n }\n const controller = new MeasurementController(map, layerFactory, {\n getContinueMessage() {\n return intl.formatMessage({ id: \"tooltips.continue\" });\n },\n getHelpMessage() {\n return intl.formatMessage({ id: \"tooltips.help\" });\n },\n formatNumber(value) {\n return intl.formatNumber(value, {\n maximumFractionDigits: 2\n });\n }\n });\n\n setController(controller);\n return () => {\n controller.destroy();\n setController(undefined);\n };\n }, [map, intl, layerFactory]);\n\n // Synchronize styles with controller\n useEffect(() => {\n controller?.setActiveFeatureStyle(activeFeatureStyle ?? getDefaultActiveFeatureStyle());\n }, [controller, activeFeatureStyle]);\n useEffect(() => {\n controller?.setFinishedFeatureStyle(\n finishedFeatureStyle ?? getDefaultFinishedFeatureStyle()\n );\n }, [controller, finishedFeatureStyle]);\n useEffect(() => {\n controller?.setMeasurementSourceChangedHandler(onMeasurementsChange);\n }, [controller, onMeasurementsChange]);\n\n useEffect(() => {\n controller?.setPredefinedMeasurements(predefinedMeasurements ?? []);\n }, [controller, predefinedMeasurements]);\n return controller;\n}\n\nfunction getDefaultActiveFeatureStyle() {\n return [\n new Style({\n stroke: new Stroke({\n color: \"#fff\",\n lineDash: [10, 10],\n width: 5\n })\n }),\n new Style({\n fill: new Fill({\n color: \"rgba(0,0,0,0.15)\"\n }),\n stroke: new Stroke({\n color: \"rgba(0, 0, 0, 0.7)\",\n lineDash: [10, 10],\n width: 3\n }),\n image: new CircleStyle({\n radius: 5,\n stroke: new Stroke({\n color: \"rgba(0, 0, 0, 0.7)\",\n width: 2\n }),\n fill: new Fill({\n color: \"rgba(255, 255, 255, 0.2)\"\n })\n })\n })\n ];\n}\n\nfunction getDefaultFinishedFeatureStyle() {\n return [\n new Style({\n stroke: new Stroke({\n color: \"#fff\",\n width: 5\n })\n }),\n new Style({\n stroke: new Stroke({\n color: \"#0b96fc\",\n width: 3\n }),\n fill: new Fill({\n color: \"rgba(11,150,252,0.15)\"\n })\n })\n ];\n}\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AO;AAAA,SACV;AAAA,OACJ;AAAA,KACJ;AAAA,GACL;AACJ;AAEA,SAAS,8BAAA,GAAiC;AACtC,EAAA,OAAO;AAAA,IACH,IAAI,KAAA,CAAM;AAAA,MACN,MAAA,EAAQ,IAAI,MAAA,CAAO;AAAA,QACf,KAAA,EAAO,MAAA;AAAA,QACP,KAAA,EAAO;AAAA,OACV;AAAA,KACJ,CAAA;AAAA,IACD,IAAI,KAAA,CAAM;AAAA,MACN,MAAA,EAAQ,IAAI,MAAA,CAAO;AAAA,QACf,KAAA,EAAO,SAAA;AAAA,QACP,KAAA,EAAO;AAAA,OACV,CAAA;AAAA,MACD,IAAA,EAAM,IAAI,IAAA,CAAK;AAAA,QACX,KAAA,EAAO;AAAA,OACV;AAAA,KACJ;AAAA,GACL;AACJ;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { LayerFactory, MapModel } from "@open-pioneer/map";
2
- import OlMap from "ol/Map";
3
2
  import { Vector as VectorLayer } from "ol/layer";
3
+ import OlMap from "ol/Map";
4
4
  import { StyleLike } from "ol/style/Style";
5
5
  import { type MeasurementGeometry, type MeasurementProps } from "./Measurement";
6
6
  type MeasurementsChangeHandler = NonNullable<MeasurementProps["onMeasurementsChange"]>;
@@ -1,10 +1,10 @@
1
1
  import { destroyResource } from '@open-pioneer/core';
2
2
  import { SimpleLayer } from '@open-pioneer/map';
3
3
  import Feature from 'ol/Feature.js';
4
- import { unByKey } from 'ol/Observable.js';
5
4
  import { Polygon, LineString } from 'ol/geom.js';
6
5
  import Draw from 'ol/interaction/Draw.js';
7
6
  import { Vector as Vector$1 } from 'ol/layer.js';
7
+ import { unByKey } from 'ol/Observable.js';
8
8
  import { Vector } from 'ol/source.js';
9
9
  import { getArea, getLength } from 'ol/sphere.js';
10
10
  import { toFunction } from 'ol/style/Style.js';
@@ -1 +1 @@
1
- {"version":3,"file":"MeasurementController.js","sources":["MeasurementController.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { destroyResource, Resource } from \"@open-pioneer/core\";\nimport { LayerFactory, MapModel, Overlay, SimpleLayer } from \"@open-pioneer/map\";\nimport Feature from \"ol/Feature\";\nimport OlMap from \"ol/Map\";\nimport { unByKey } from \"ol/Observable\";\nimport { Coordinate } from \"ol/coordinate\";\nimport { EventsKey } from \"ol/events\";\nimport { LineString, Polygon } from \"ol/geom\";\nimport Draw from \"ol/interaction/Draw\";\nimport { Vector as VectorLayer } from \"ol/layer\";\nimport { Projection } from \"ol/proj\";\nimport { Vector as VectorSource } from \"ol/source\";\nimport { getArea, getLength } from \"ol/sphere\";\nimport { StyleFunction, StyleLike, toFunction as toStyleFunction } from \"ol/style/Style\";\nimport {\n type MeasurementsChangeEvent,\n type MeasurementGeometry,\n type MeasurementProps\n} from \"./Measurement\";\nimport { createElement } from \"react\";\nimport { MeasurementTooltipContent } from \"./MeasurementTooltip\";\n\ntype MeasurementsChangeHandler = NonNullable<MeasurementProps[\"onMeasurementsChange\"]>;\n\nexport type MeasurementType = \"area\" | \"distance\";\n\nexport interface Messages {\n getContinueMessage(): string;\n getHelpMessage(): string;\n formatNumber(value: number): string;\n}\n\nexport class MeasurementController {\n readonly map: MapModel;\n readonly olMap: OlMap;\n readonly messages: Messages;\n\n #activeFeatureStyle: StyleFunction | undefined;\n /**\n * The layer rendering the measurement \"features\".\n */\n #layer: SimpleLayer;\n\n /**\n * Source of {@link layer}.\n */\n #source: VectorSource;\n\n /**\n * Stores the current `Draw` interaction.\n */\n #draw: Draw | undefined = undefined;\n\n /**\n * The active measurement manipulated by the `draw` interaction.\n */\n #activeMeasurement: MeasurementInstance | undefined;\n\n /**\n * Map that is used to track all predefined measurements currently added to the source.\n * It associates the measurement geometry (key) with the corresponding measurement instance.\n *\n * The measurement instances here must also be contained in `finishedMeasurements`.\n */\n #predefinedMeasurements = new Map<MeasurementGeometry, MeasurementInstance>();\n\n /**\n * Measurement instances that were finished.\n */\n #finishedMeasurements = new Set<MeasurementInstance>();\n\n /**\n * Overlay for help tooltip.\n */\n #helpTooltip: Overlay;\n\n /**\n * Keeps track of registered event handlers.\n */\n #resources: Resource[] = [];\n\n /**\n * Called when a measurement is added to or removed from the source.\n */\n #measurementChangedHandler: MeasurementsChangeHandler | undefined;\n\n constructor(map: MapModel, layerFactory: LayerFactory, messages: Messages) {\n this.map = map;\n this.olMap = map.olMap;\n this.messages = messages;\n const source = (this.#source = new VectorSource());\n this.#layer = layerFactory.create({\n type: SimpleLayer,\n internal: true,\n title: \"measurement-layer\",\n olLayer: new VectorLayer<VectorSource, Feature>({\n source: source\n })\n });\n map.layers.addLayer(this.#layer, { at: \"topmost\" });\n\n this.#helpTooltip = createHelpTooltip(this.map);\n }\n\n destroy() {\n this.stopMeasurement();\n\n // Cleanup registered event handlers etc.\n for (const resource of this.#resources) {\n resource.destroy();\n }\n this.#resources = [];\n\n // Cleanup measurements and tooltips.\n this.#activeMeasurement = destroyResource(this.#activeMeasurement);\n for (const measurement of this.#finishedMeasurements) {\n measurement.destroy();\n }\n this.#finishedMeasurements.clear();\n this.#helpTooltip.destroy();\n\n // Cleanup layer\n this.map.layers.removeLayer(this.#layer);\n this.#layer.destroy();\n\n this.#measurementChangedHandler = undefined;\n this.#predefinedMeasurements.clear();\n }\n\n /** Returns the vector layer used for finished features. */\n getOlVectorLayer() {\n return this.#layer.olLayer as VectorLayer;\n }\n\n /** Updates the style used for finished features. */\n setFinishedFeatureStyle(style: StyleLike) {\n this.getOlVectorLayer().setStyle(style);\n }\n\n setMeasurementSourceChangedHandler(handler: MeasurementsChangeHandler | undefined) {\n this.#measurementChangedHandler = handler;\n }\n\n setPredefinedMeasurements(geometries: MeasurementGeometry[]) {\n this.#updatePredefinedMeasurements(geometries);\n }\n\n /** Updates the style used for active measurements. */\n setActiveFeatureStyle(style: StyleLike) {\n const styleFunction = toStyleFunction(style);\n this.#activeFeatureStyle = (feature, ...args) => {\n const ft = feature?.getGeometry()?.getType();\n if (ft === \"Polygon\" || ft === \"LineString\" || ft === \"Point\") {\n return styleFunction(feature, ...args);\n }\n };\n // Update style on current draw instance (if any)\n this.#draw?.getOverlay().setStyle(this.#activeFeatureStyle);\n }\n\n /** Removes all finished measurements. */\n clearMeasurements() {\n const currentFeatures = this.#source.getFeatures(); //returns snapshot copy of the features on the source\n this.#source.clear();\n currentFeatures.forEach((feature) => {\n //raise remove-measurement event for each measurement after the source was cleared\n this.#raiseMeasurementsChangeEvent(\"remove-measurement\", feature);\n });\n this.#predefinedMeasurements.clear();\n for (const measurement of this.#finishedMeasurements) {\n measurement.destroy();\n }\n this.#finishedMeasurements.clear();\n }\n\n /** Starts measuring using the provided type. */\n startMeasurement(type: MeasurementType) {\n if (this.#draw) {\n throw new Error(\"Internal error: another measurement interaction is still active.\");\n }\n\n const geometryType = type === \"area\" ? \"Polygon\" : \"LineString\";\n const draw = (this.#draw = new Draw({\n source: this.#source,\n type: geometryType,\n style: this.#activeFeatureStyle\n }));\n this.olMap.addInteraction(draw);\n\n // update tooltip if user changed drawing mode (and did not move the mouse yet)\n // currently this does not work when the tool is initially activated as the tooltip has no position yet\n this.#updateTooltip();\n\n let measurement: MeasurementInstance | undefined;\n let changeListenerKey: EventsKey | undefined = undefined;\n draw.on(\"drawstart\", (evt) => {\n // set sketch\n const sketch = evt.feature;\n if (!sketch) {\n return;\n }\n\n measurement = this.#activeMeasurement = new MeasurementInstance(\"active\", sketch, this);\n changeListenerKey = sketch.getGeometry()?.on(\"change\", () => {\n measurement?.updateTooltipContent();\n measurement?.updateTooltipPosition();\n });\n\n // update tooltip message if user started drawing but did not yet move the mouse\n this.#updateTooltip();\n });\n\n draw.on(\"drawend\", () => {\n if (measurement && measurement === this.#activeMeasurement) {\n const newMeasurement = measurement;\n newMeasurement.updateState(\"finished\");\n this.#finishedMeasurements.add(newMeasurement);\n this.#raiseMeasurementsChangeEvent(\"add-measurement\", newMeasurement.feature);\n this.#activeMeasurement = measurement = undefined;\n }\n\n measurement = undefined;\n if (changeListenerKey) {\n unByKey(changeListenerKey);\n }\n\n // update tooltip if user finished drawing but did not yet move the mouse\n this.#updateTooltip();\n });\n\n draw.on(\"drawabort\", () => {\n if (measurement) {\n measurement.destroy();\n if (measurement === this.#activeMeasurement) {\n this.#activeMeasurement = undefined;\n }\n measurement = undefined;\n }\n\n if (changeListenerKey) {\n unByKey(changeListenerKey);\n }\n });\n }\n\n /** Stops the current measuring started by `startMeasurement`. */\n stopMeasurement() {\n if (this.#draw) {\n this.olMap.removeInteraction(this.#draw);\n this.#draw.abortDrawing();\n this.#draw.dispose();\n this.#draw = undefined;\n }\n\n this.#activeMeasurement = destroyResource(this.#activeMeasurement);\n }\n\n #updateTooltip() {\n const overlay = this.#helpTooltip;\n const helpMessage = getHelpMessage(this.messages, this.#activeMeasurement);\n const newContent = createElement(MeasurementTooltipContent, { content: helpMessage });\n overlay.setContent(newContent);\n }\n\n #updatePredefinedMeasurements(geometries: MeasurementGeometry[]) {\n const addedMeasurements = geometries.filter(\n (geom) => !this.#predefinedMeasurements.has(geom)\n );\n const removedMeasurements: MeasurementGeometry[] = [];\n for (const geom of this.#predefinedMeasurements.keys()) {\n if (!geometries.includes(geom)) {\n removedMeasurements.push(geom);\n }\n }\n\n addedMeasurements.forEach((geom) => {\n const measurementFeature = new Feature(geom);\n this.#source.addFeature(measurementFeature);\n\n const measurement = new MeasurementInstance(\"finished\", measurementFeature, this);\n this.#finishedMeasurements.add(measurement);\n this.#predefinedMeasurements.set(geom, measurement);\n this.#raiseMeasurementsChangeEvent(\"add-measurement\", measurementFeature);\n });\n\n removedMeasurements.forEach((geom) => {\n const measurement = this.#predefinedMeasurements.get(geom);\n if (measurement) {\n //remove measurement feature from source and destroy associated tooltip\n this.#source.removeFeature(measurement.feature);\n this.#finishedMeasurements.delete(measurement);\n measurement.destroy();\n this.#raiseMeasurementsChangeEvent(\"remove-measurement\", measurement.feature);\n }\n this.#predefinedMeasurements.delete(geom);\n });\n }\n\n #raiseMeasurementsChangeEvent(\n kind: MeasurementsChangeEvent[\"kind\"],\n measurementFeature: Feature\n ) {\n const measurementGeom = measurementFeature.getGeometry();\n if (this.#measurementChangedHandler && measurementGeom) {\n this.#measurementChangedHandler({\n kind: kind,\n geometry:\n measurementGeom instanceof Polygon\n ? (measurementGeom as Polygon)\n : (measurementGeom as LineString)\n });\n }\n }\n}\n\n// Encapsulates the display state of a measurement.\n//\n// More ideas for further improvements:\n// - Resolve duplicate source of truths (feature source and map of measurements).\n// - Add and remove the feature here as well (instead of in the controller).\n// - Perhaps use reactivity API and watch for state consistency.\n// The current implementations relies on the update*() functions being called at the correct time.\nclass MeasurementInstance {\n readonly controller: MeasurementController;\n readonly feature: Feature;\n\n #state: \"active\" | \"finished\";\n #tooltip: Overlay;\n\n constructor(state: \"active\" | \"finished\", feature: Feature, controller: MeasurementController) {\n this.controller = controller;\n this.#state = state;\n this.feature = feature;\n this.#tooltip = createMeasureTooltip(this.controller.map, state === \"finished\");\n this.updateTooltipContent();\n this.updateTooltipPosition();\n }\n\n destroy() {\n this.#tooltip.destroy();\n }\n\n get state(): \"active\" | \"finished\" {\n return this.#state;\n }\n\n updateState(state: \"active\" | \"finished\") {\n if (this.#state === state) {\n return;\n }\n\n this.#state = state;\n if (this.#state === \"finished\") {\n this.finishTooltip();\n }\n }\n\n // Updates the tooltip content based on the current state and the feature's geometry.\n updateTooltipContent() {\n const geometry = this.feature.getGeometry();\n if (!geometry) {\n return;\n }\n\n const projection = this.#olMap.getView().getProjection();\n let output;\n if (geometry instanceof Polygon) {\n output = formatArea(geometry, projection, this.#messages);\n } else if (geometry instanceof LineString) {\n output = formatLength(geometry, projection, this.#messages);\n }\n if (output) {\n this.#tooltip.setContent(createElement(MeasurementTooltipContent, { content: output }));\n }\n }\n\n // Updates the tooltip's position.\n updateTooltipPosition() {\n const geometry = this.feature.getGeometry();\n if (!geometry) {\n return;\n }\n\n let tooltipCoord: Coordinate;\n if (geometry instanceof Polygon) {\n tooltipCoord = geometry.getInteriorPoint().getCoordinates() || null;\n } else if (geometry instanceof LineString) {\n tooltipCoord = geometry.getLastCoordinate() || null;\n } else {\n return;\n }\n this.#tooltip.setPosition(tooltipCoord);\n }\n\n finishTooltip() {\n this.#tooltip.element.className = FINISHED_MEASUREMENT_CLASSNAME;\n this.#tooltip.setOffset(FINISHED_MEASUREMENT_OFFSET);\n this.updateTooltipContent();\n this.updateTooltipPosition();\n }\n\n get #olMap(): OlMap {\n return this.controller.olMap;\n }\n\n get #messages(): Messages {\n return this.controller.messages;\n }\n}\n\nconst DEFAULT_MEASUREMENT_OFFSET = [0, -15];\nconst FINISHED_MEASUREMENT_OFFSET = [0, -7];\nconst ACTIVE_MEASUREMENT_CLASSNAME = \"measurement-tooltip measurement-active-tooltip printing-hide\";\nconst FINISHED_MEASUREMENT_CLASSNAME = \"measurement-tooltip measurement-finished-tooltip\";\n\nfunction createHelpTooltip(map: MapModel): Overlay {\n const helpOverlay = map.overlays.add({\n className: \"measurement-tooltip printing-hide\",\n position: \"follow-pointer\",\n tag: \"measurement-help-overlay\",\n offset: [15, 0],\n positioning: \"center-left\",\n ariaRole: \"tooltip\",\n content: createElement(MeasurementTooltipContent)\n });\n\n return helpOverlay;\n}\n\nfunction createMeasureTooltip(map: MapModel, isFinished = false): Overlay {\n const overlay = map.overlays.add({\n content: createElement(MeasurementTooltipContent),\n offset: !isFinished ? DEFAULT_MEASUREMENT_OFFSET : FINISHED_MEASUREMENT_OFFSET,\n positioning: \"bottom-center\",\n className: !isFinished ? ACTIVE_MEASUREMENT_CLASSNAME : FINISHED_MEASUREMENT_CLASSNAME,\n stopEvent: false,\n ariaRole: \"tooltip\",\n advanced: {\n insertFirst: false\n }\n });\n\n return overlay;\n}\n\nfunction getHelpMessage(messages: Messages, activeMeasurement: MeasurementInstance | undefined) {\n if (activeMeasurement) {\n const geom = activeMeasurement.feature.getGeometry();\n if (geom instanceof Polygon || geom instanceof LineString) {\n return messages.getContinueMessage();\n }\n }\n return messages.getHelpMessage();\n}\n\nfunction formatArea(polygon: Polygon, projection: Projection, messages: Messages) {\n const area = getArea(polygon, { projection });\n let output;\n if (area >= 1000000) {\n output = `${messages.formatNumber(area / 1000000)} km\\u00B2`;\n } else {\n output = `${messages.formatNumber(area)} m\\u00B2`;\n }\n return output;\n}\n\nfunction formatLength(line: LineString, projection: Projection, messages: Messages) {\n const length = getLength(line, { projection });\n let output;\n if (length >= 1000) {\n output = `${messages.formatNumber(length / 1000)} km`;\n } else {\n output = `${messages.formatNumber(length)} m`;\n }\n return output;\n}\n"],"names":["VectorSource","VectorLayer","toStyleFunction"],"mappings":";;;;;;;;;;;;;AAkCO,MAAM,qBAAA,CAAsB;AAAA,EACtB,GAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EAET,mBAAA;AAAA;AAAA;AAAA;AAAA,EAIA,MAAA;AAAA;AAAA;AAAA;AAAA,EAKA,OAAA;AAAA;AAAA;AAAA;AAAA,EAKA,KAAA,GAA0B,MAAA;AAAA;AAAA;AAAA;AAAA,EAK1B,kBAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,uBAAA,uBAA8B,GAAA,EAA8C;AAAA;AAAA;AAAA;AAAA,EAK5E,qBAAA,uBAA4B,GAAA,EAAyB;AAAA;AAAA;AAAA;AAAA,EAKrD,YAAA;AAAA;AAAA;AAAA;AAAA,EAKA,aAAyB,EAAC;AAAA;AAAA;AAAA;AAAA,EAK1B,0BAAA;AAAA,EAEA,WAAA,CAAY,GAAA,EAAe,YAAA,EAA4B,QAAA,EAAoB;AACvE,IAAA,IAAA,CAAK,GAAA,GAAM,GAAA;AACX,IAAA,IAAA,CAAK,QAAQ,GAAA,CAAI,KAAA;AACjB,IAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAChB,IAAA,MAAM,MAAA,GAAU,IAAA,CAAK,OAAA,GAAU,IAAIA,MAAA,EAAa;AAChD,IAAA,IAAA,CAAK,MAAA,GAAS,aAAa,MAAA,CAAO;AAAA,MAC9B,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,CAAA,EAAG,QAAA,CAAS,YAAA,CAAa,IAAI,CAAC,CAAA,MAAA,CAAA;AAAA,EAC3C;AACA,EAAA,OAAO,MAAA;AACX;AAEA,SAAS,YAAA,CAAa,IAAA,EAAkB,UAAA,EAAwB,QAAA,EAAoB;AAChF,EAAA,MAAM,MAAA,GAAS,SAAA,CAAU,IAAA,EAAM,EAAE,YAAY,CAAA;AAC7C,EAAA,IAAI,MAAA;AACJ,EAAA,IAAI,UAAU,GAAA,EAAM;AAChB,IAAA,MAAA,GAAS,CAAA,EAAG,QAAA,CAAS,YAAA,CAAa,MAAA,GAAS,GAAI,CAAC,CAAA,GAAA,CAAA;AAAA,EACpD,CAAA,MAAO;AACH,IAAA,MAAA,GAAS,CAAA,EAAG,QAAA,CAAS,YAAA,CAAa,MAAM,CAAC,CAAA,EAAA,CAAA;AAAA,EAC7C;AACA,EAAA,OAAO,MAAA;AACX;;;;"}
1
+ {"version":3,"file":"MeasurementController.js","sources":["MeasurementController.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport { destroyResource, Resource } from \"@open-pioneer/core\";\nimport { LayerFactory, MapModel, Overlay, SimpleLayer } from \"@open-pioneer/map\";\nimport { Coordinate } from \"ol/coordinate\";\nimport { EventsKey } from \"ol/events\";\nimport Feature from \"ol/Feature\";\nimport { LineString, Polygon } from \"ol/geom\";\nimport Draw from \"ol/interaction/Draw\";\nimport { Vector as VectorLayer } from \"ol/layer\";\nimport OlMap from \"ol/Map\";\nimport { unByKey } from \"ol/Observable\";\nimport { Projection } from \"ol/proj\";\nimport { Vector as VectorSource } from \"ol/source\";\nimport { getArea, getLength } from \"ol/sphere\";\nimport { StyleFunction, StyleLike, toFunction as toStyleFunction } from \"ol/style/Style\";\nimport { createElement } from \"react\";\nimport {\n type MeasurementsChangeEvent,\n type MeasurementGeometry,\n type MeasurementProps\n} from \"./Measurement\";\nimport { MeasurementTooltipContent } from \"./MeasurementTooltip\";\n\ntype MeasurementsChangeHandler = NonNullable<MeasurementProps[\"onMeasurementsChange\"]>;\n\nexport type MeasurementType = \"area\" | \"distance\";\n\nexport interface Messages {\n getContinueMessage(): string;\n getHelpMessage(): string;\n formatNumber(value: number): string;\n}\n\nexport class MeasurementController {\n readonly map: MapModel;\n readonly olMap: OlMap;\n readonly messages: Messages;\n\n #activeFeatureStyle: StyleFunction | undefined;\n /**\n * The layer rendering the measurement \"features\".\n */\n #layer: SimpleLayer;\n\n /**\n * Source of {@link layer}.\n */\n #source: VectorSource;\n\n /**\n * Stores the current `Draw` interaction.\n */\n #draw: Draw | undefined = undefined;\n\n /**\n * The active measurement manipulated by the `draw` interaction.\n */\n #activeMeasurement: MeasurementInstance | undefined;\n\n /**\n * Map that is used to track all predefined measurements currently added to the source.\n * It associates the measurement geometry (key) with the corresponding measurement instance.\n *\n * The measurement instances here must also be contained in `finishedMeasurements`.\n */\n #predefinedMeasurements = new Map<MeasurementGeometry, MeasurementInstance>();\n\n /**\n * Measurement instances that were finished.\n */\n #finishedMeasurements = new Set<MeasurementInstance>();\n\n /**\n * Overlay for help tooltip.\n */\n #helpTooltip: Overlay;\n\n /**\n * Keeps track of registered event handlers.\n */\n #resources: Resource[] = [];\n\n /**\n * Called when a measurement is added to or removed from the source.\n */\n #measurementChangedHandler: MeasurementsChangeHandler | undefined;\n\n constructor(map: MapModel, layerFactory: LayerFactory, messages: Messages) {\n this.map = map;\n this.olMap = map.olMap;\n this.messages = messages;\n const source = (this.#source = new VectorSource());\n this.#layer = layerFactory.create({\n type: SimpleLayer,\n internal: true,\n title: \"measurement-layer\",\n olLayer: new VectorLayer<VectorSource, Feature>({\n source: source\n })\n });\n map.layers.addLayer(this.#layer, { at: \"topmost\" });\n\n this.#helpTooltip = createHelpTooltip(this.map);\n }\n\n destroy() {\n this.stopMeasurement();\n\n // Cleanup registered event handlers etc.\n for (const resource of this.#resources) {\n resource.destroy();\n }\n this.#resources = [];\n\n // Cleanup measurements and tooltips.\n this.#activeMeasurement = destroyResource(this.#activeMeasurement);\n for (const measurement of this.#finishedMeasurements) {\n measurement.destroy();\n }\n this.#finishedMeasurements.clear();\n this.#helpTooltip.destroy();\n\n // Cleanup layer\n this.map.layers.removeLayer(this.#layer);\n this.#layer.destroy();\n\n this.#measurementChangedHandler = undefined;\n this.#predefinedMeasurements.clear();\n }\n\n /** Returns the vector layer used for finished features. */\n getOlVectorLayer() {\n return this.#layer.olLayer as VectorLayer;\n }\n\n /** Updates the style used for finished features. */\n setFinishedFeatureStyle(style: StyleLike) {\n this.getOlVectorLayer().setStyle(style);\n }\n\n setMeasurementSourceChangedHandler(handler: MeasurementsChangeHandler | undefined) {\n this.#measurementChangedHandler = handler;\n }\n\n setPredefinedMeasurements(geometries: MeasurementGeometry[]) {\n this.#updatePredefinedMeasurements(geometries);\n }\n\n /** Updates the style used for active measurements. */\n setActiveFeatureStyle(style: StyleLike) {\n const styleFunction = toStyleFunction(style);\n this.#activeFeatureStyle = (feature, ...args) => {\n const ft = feature?.getGeometry()?.getType();\n if (ft === \"Polygon\" || ft === \"LineString\" || ft === \"Point\") {\n return styleFunction(feature, ...args);\n }\n };\n // Update style on current draw instance (if any)\n this.#draw?.getOverlay().setStyle(this.#activeFeatureStyle);\n }\n\n /** Removes all finished measurements. */\n clearMeasurements() {\n const currentFeatures = this.#source.getFeatures(); //returns snapshot copy of the features on the source\n this.#source.clear();\n currentFeatures.forEach((feature) => {\n //raise remove-measurement event for each measurement after the source was cleared\n this.#raiseMeasurementsChangeEvent(\"remove-measurement\", feature);\n });\n this.#predefinedMeasurements.clear();\n for (const measurement of this.#finishedMeasurements) {\n measurement.destroy();\n }\n this.#finishedMeasurements.clear();\n }\n\n /** Starts measuring using the provided type. */\n startMeasurement(type: MeasurementType) {\n if (this.#draw) {\n throw new Error(\"Internal error: another measurement interaction is still active.\");\n }\n\n const geometryType = type === \"area\" ? \"Polygon\" : \"LineString\";\n const draw = (this.#draw = new Draw({\n source: this.#source,\n type: geometryType,\n style: this.#activeFeatureStyle\n }));\n this.olMap.addInteraction(draw);\n\n // update tooltip if user changed drawing mode (and did not move the mouse yet)\n // currently this does not work when the tool is initially activated as the tooltip has no position yet\n this.#updateTooltip();\n\n let measurement: MeasurementInstance | undefined;\n let changeListenerKey: EventsKey | undefined = undefined;\n draw.on(\"drawstart\", (evt) => {\n // set sketch\n const sketch = evt.feature;\n if (!sketch) {\n return;\n }\n\n measurement = this.#activeMeasurement = new MeasurementInstance(\"active\", sketch, this);\n changeListenerKey = sketch.getGeometry()?.on(\"change\", () => {\n measurement?.updateTooltipContent();\n measurement?.updateTooltipPosition();\n });\n\n // update tooltip message if user started drawing but did not yet move the mouse\n this.#updateTooltip();\n });\n\n draw.on(\"drawend\", () => {\n if (measurement && measurement === this.#activeMeasurement) {\n const newMeasurement = measurement;\n newMeasurement.updateState(\"finished\");\n this.#finishedMeasurements.add(newMeasurement);\n this.#raiseMeasurementsChangeEvent(\"add-measurement\", newMeasurement.feature);\n this.#activeMeasurement = measurement = undefined;\n }\n\n measurement = undefined;\n if (changeListenerKey) {\n unByKey(changeListenerKey);\n }\n\n // update tooltip if user finished drawing but did not yet move the mouse\n this.#updateTooltip();\n });\n\n draw.on(\"drawabort\", () => {\n if (measurement) {\n measurement.destroy();\n if (measurement === this.#activeMeasurement) {\n this.#activeMeasurement = undefined;\n }\n measurement = undefined;\n }\n\n if (changeListenerKey) {\n unByKey(changeListenerKey);\n }\n });\n }\n\n /** Stops the current measuring started by `startMeasurement`. */\n stopMeasurement() {\n if (this.#draw) {\n this.olMap.removeInteraction(this.#draw);\n this.#draw.abortDrawing();\n this.#draw.dispose();\n this.#draw = undefined;\n }\n\n this.#activeMeasurement = destroyResource(this.#activeMeasurement);\n }\n\n #updateTooltip() {\n const overlay = this.#helpTooltip;\n const helpMessage = getHelpMessage(this.messages, this.#activeMeasurement);\n const newContent = createElement(MeasurementTooltipContent, { content: helpMessage });\n overlay.setContent(newContent);\n }\n\n #updatePredefinedMeasurements(geometries: MeasurementGeometry[]) {\n const addedMeasurements = geometries.filter(\n (geom) => !this.#predefinedMeasurements.has(geom)\n );\n const removedMeasurements: MeasurementGeometry[] = [];\n for (const geom of this.#predefinedMeasurements.keys()) {\n if (!geometries.includes(geom)) {\n removedMeasurements.push(geom);\n }\n }\n\n addedMeasurements.forEach((geom) => {\n const measurementFeature = new Feature(geom);\n this.#source.addFeature(measurementFeature);\n\n const measurement = new MeasurementInstance(\"finished\", measurementFeature, this);\n this.#finishedMeasurements.add(measurement);\n this.#predefinedMeasurements.set(geom, measurement);\n this.#raiseMeasurementsChangeEvent(\"add-measurement\", measurementFeature);\n });\n\n removedMeasurements.forEach((geom) => {\n const measurement = this.#predefinedMeasurements.get(geom);\n if (measurement) {\n //remove measurement feature from source and destroy associated tooltip\n this.#source.removeFeature(measurement.feature);\n this.#finishedMeasurements.delete(measurement);\n measurement.destroy();\n this.#raiseMeasurementsChangeEvent(\"remove-measurement\", measurement.feature);\n }\n this.#predefinedMeasurements.delete(geom);\n });\n }\n\n #raiseMeasurementsChangeEvent(\n kind: MeasurementsChangeEvent[\"kind\"],\n measurementFeature: Feature\n ) {\n const measurementGeom = measurementFeature.getGeometry();\n if (this.#measurementChangedHandler && measurementGeom) {\n this.#measurementChangedHandler({\n kind: kind,\n geometry:\n measurementGeom instanceof Polygon\n ? (measurementGeom as Polygon)\n : (measurementGeom as LineString)\n });\n }\n }\n}\n\n// Encapsulates the display state of a measurement.\n//\n// More ideas for further improvements:\n// - Resolve duplicate source of truths (feature source and map of measurements).\n// - Add and remove the feature here as well (instead of in the controller).\n// - Perhaps use reactivity API and watch for state consistency.\n// The current implementations relies on the update*() functions being called at the correct time.\nclass MeasurementInstance {\n readonly controller: MeasurementController;\n readonly feature: Feature;\n\n #state: \"active\" | \"finished\";\n #tooltip: Overlay;\n\n constructor(state: \"active\" | \"finished\", feature: Feature, controller: MeasurementController) {\n this.controller = controller;\n this.#state = state;\n this.feature = feature;\n this.#tooltip = createMeasureTooltip(this.controller.map, state === \"finished\");\n this.updateTooltipContent();\n this.updateTooltipPosition();\n }\n\n destroy() {\n this.#tooltip.destroy();\n }\n\n get state(): \"active\" | \"finished\" {\n return this.#state;\n }\n\n updateState(state: \"active\" | \"finished\") {\n if (this.#state === state) {\n return;\n }\n\n this.#state = state;\n if (this.#state === \"finished\") {\n this.finishTooltip();\n }\n }\n\n // Updates the tooltip content based on the current state and the feature's geometry.\n updateTooltipContent() {\n const geometry = this.feature.getGeometry();\n if (!geometry) {\n return;\n }\n\n const projection = this.#olMap.getView().getProjection();\n let output;\n if (geometry instanceof Polygon) {\n output = formatArea(geometry, projection, this.#messages);\n } else if (geometry instanceof LineString) {\n output = formatLength(geometry, projection, this.#messages);\n }\n if (output) {\n this.#tooltip.setContent(createElement(MeasurementTooltipContent, { content: output }));\n }\n }\n\n // Updates the tooltip's position.\n updateTooltipPosition() {\n const geometry = this.feature.getGeometry();\n if (!geometry) {\n return;\n }\n\n let tooltipCoord: Coordinate;\n if (geometry instanceof Polygon) {\n tooltipCoord = geometry.getInteriorPoint().getCoordinates() || null;\n } else if (geometry instanceof LineString) {\n tooltipCoord = geometry.getLastCoordinate() || null;\n } else {\n return;\n }\n this.#tooltip.setPosition(tooltipCoord);\n }\n\n finishTooltip() {\n this.#tooltip.element.className = FINISHED_MEASUREMENT_CLASSNAME;\n this.#tooltip.setOffset(FINISHED_MEASUREMENT_OFFSET);\n this.updateTooltipContent();\n this.updateTooltipPosition();\n }\n\n get #olMap(): OlMap {\n return this.controller.olMap;\n }\n\n get #messages(): Messages {\n return this.controller.messages;\n }\n}\n\nconst DEFAULT_MEASUREMENT_OFFSET = [0, -15];\nconst FINISHED_MEASUREMENT_OFFSET = [0, -7];\nconst ACTIVE_MEASUREMENT_CLASSNAME = \"measurement-tooltip measurement-active-tooltip printing-hide\";\nconst FINISHED_MEASUREMENT_CLASSNAME = \"measurement-tooltip measurement-finished-tooltip\";\n\nfunction createHelpTooltip(map: MapModel): Overlay {\n const helpOverlay = map.overlays.add({\n className: \"measurement-tooltip printing-hide\",\n position: \"follow-pointer\",\n tag: \"measurement-help-overlay\",\n offset: [15, 0],\n positioning: \"center-left\",\n ariaRole: \"tooltip\",\n content: createElement(MeasurementTooltipContent)\n });\n\n return helpOverlay;\n}\n\nfunction createMeasureTooltip(map: MapModel, isFinished = false): Overlay {\n const overlay = map.overlays.add({\n content: createElement(MeasurementTooltipContent),\n offset: !isFinished ? DEFAULT_MEASUREMENT_OFFSET : FINISHED_MEASUREMENT_OFFSET,\n positioning: \"bottom-center\",\n className: !isFinished ? ACTIVE_MEASUREMENT_CLASSNAME : FINISHED_MEASUREMENT_CLASSNAME,\n stopEvent: false,\n ariaRole: \"tooltip\",\n advanced: {\n insertFirst: false\n }\n });\n\n return overlay;\n}\n\nfunction getHelpMessage(messages: Messages, activeMeasurement: MeasurementInstance | undefined) {\n if (activeMeasurement) {\n const geom = activeMeasurement.feature.getGeometry();\n if (geom instanceof Polygon || geom instanceof LineString) {\n return messages.getContinueMessage();\n }\n }\n return messages.getHelpMessage();\n}\n\nfunction formatArea(polygon: Polygon, projection: Projection, messages: Messages) {\n const area = getArea(polygon, { projection });\n let output;\n if (area >= 1000000) {\n output = `${messages.formatNumber(area / 1000000)} km\\u00B2`;\n } else {\n output = `${messages.formatNumber(area)} m\\u00B2`;\n }\n return output;\n}\n\nfunction formatLength(line: LineString, projection: Projection, messages: Messages) {\n const length = getLength(line, { projection });\n let output;\n if (length >= 1000) {\n output = `${messages.formatNumber(length / 1000)} km`;\n } else {\n output = `${messages.formatNumber(length)} m`;\n }\n return output;\n}\n"],"names":["VectorSource","VectorLayer","toStyleFunction"],"mappings":";;;;;;;;;;;;;AAmCO,MAAM,qBAAA,CAAsB;AAAA,EACtB,GAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EAET,mBAAA;AAAA;AAAA;AAAA;AAAA,EAIA,MAAA;AAAA;AAAA;AAAA;AAAA,EAKA,OAAA;AAAA;AAAA;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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MeasurementTooltip.js","sources":["MeasurementTooltip.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Span } from \"@chakra-ui/react\";\nimport { ReactNode } from \"react\";\n\nexport function MeasurementTooltipContent(props: { content?: ReactNode }) {\n const { content } = props;\n return <Span>{content}</Span>;\n}\n"],"names":[],"mappings":";;;AAKO,SAAS,0BAA0B,KAAA,EAAgC;AACtE,EAAA,MAAM,EAAE,SAAQ,GAAI,KAAA;AACpB,EAAA,uBAAO,GAAA,CAAC,QAAM,QAAA,EAAA,OAAA,EAAQ,CAAA;AAC1B;;;;"}
1
+ {"version":3,"file":"MeasurementTooltip.js","sources":["MeasurementTooltip.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Span } from \"@chakra-ui/react\";\nimport { ReactNode } from \"react\";\n\nexport function MeasurementTooltipContent(props: { content?: ReactNode }) {\n const { content } = props;\n return <Span>{content}</Span>;\n}\n"],"names":[],"mappings":";;;AAMO,SAAS,0BAA0B,KAAA,EAAgC;AACtE,EAAA,MAAM,EAAE,SAAQ,GAAI,KAAA;AACpB,EAAA,uBAAO,GAAA,CAAC,QAAM,QAAA,EAAA,OAAA,EAAQ,CAAA;AAC1B;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@open-pioneer/measurement",
4
- "version": "1.4.0-dev.20260727093741",
4
+ "version": "1.4.0",
5
5
  "description": "This package provides a UI component that allows the user to perform area and distance measurements on the map.",
6
6
  "keywords": [
7
7
  "open-pioneer-trails"
@@ -15,13 +15,13 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@chakra-ui/react": "^3.36.1",
18
- "@open-pioneer/core": "4.7.0-dev.20260727091735",
19
- "@open-pioneer/react-utils": "4.7.0-dev.20260727091735",
20
- "@open-pioneer/runtime": "4.7.0-dev.20260727091735",
21
- "@open-pioneer/chakra-snippets": "4.7.0-dev.20260727091735",
18
+ "@open-pioneer/chakra-snippets": "^4.7.0",
19
+ "@open-pioneer/core": "^4.7.0",
20
+ "@open-pioneer/react-utils": "^4.7.0",
21
+ "@open-pioneer/runtime": "^4.7.0",
22
22
  "ol": "^10.9.0",
23
23
  "react": "^19.2.8",
24
- "@open-pioneer/map": "1.4.0-dev.20260727093741"
24
+ "@open-pioneer/map": "1.4.0"
25
25
  },
26
26
  "exports": {
27
27
  "./package.json": "./package.json",