From c9ab236c2da320810f73836529ce5cd305eab188 Mon Sep 17 00:00:00 2001 From: stefano bovio Date: Wed, 22 Nov 2023 15:59:08 +0100 Subject: [PATCH] #9606 Error with circle annotations + radius selection (#9607) (#9727) Co-authored-by: Diego Vargas --- .../components/mapcontrols/annotations/CoordinatesEditor.jsx | 2 +- .../mapcontrols/annotations/__tests__/CoordinatesEditor-test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/client/components/mapcontrols/annotations/CoordinatesEditor.jsx b/web/client/components/mapcontrols/annotations/CoordinatesEditor.jsx index 2257dd530f..89d2fe519d 100644 --- a/web/client/components/mapcontrols/annotations/CoordinatesEditor.jsx +++ b/web/client/components/mapcontrols/annotations/CoordinatesEditor.jsx @@ -147,7 +147,7 @@ class CoordinatesEditor extends React.Component { if (this.isValid(this.props.components, radius )) { this.props.onChangeRadius(parseFloat(radius), this.props.components.map(coordToArray), uom); } else if (radius !== "") { - this.props.onChangeRadius(parseFloat(radius), [], uom); + this.props.onChangeRadius(parseFloat(radius), [[0, 0]], uom); } else { this.props.onChangeRadius(null, this.props.components.map(coordToArray), uom); this.props.onSetInvalidSelected("radius", this.props.components.map(coordToArray)); diff --git a/web/client/components/mapcontrols/annotations/__tests__/CoordinatesEditor-test.js b/web/client/components/mapcontrols/annotations/__tests__/CoordinatesEditor-test.js index 655d39bec1..3cfc75cdbd 100644 --- a/web/client/components/mapcontrols/annotations/__tests__/CoordinatesEditor-test.js +++ b/web/client/components/mapcontrols/annotations/__tests__/CoordinatesEditor-test.js @@ -551,7 +551,7 @@ describe("test the CoordinatesEditor Panel", () => { inputRadius.value = 10000; TestUtils.Simulate.change(inputRadius); expect(spyOnChangeRadius).toHaveBeenCalled(); - expect(spyOnChangeRadius).toHaveBeenCalledWith(10000, [], mapProjection); + expect(spyOnChangeRadius).toHaveBeenCalledWith(10000, [[0, 0]], mapProjection); expect(spyOnSetInvalidSelected).toNotHaveBeenCalled(); });