Skip to content

Commit 798ec3d

Browse files
authored
geosolutions-it#10829: Fix - Issue creating Circle annotation with form radius (geosolutions-it#10845)
1 parent 669095a commit 798ec3d

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

web/client/components/map/cesium/DrawGeometrySupport.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function DrawGeometrySupport({
7474
draw.current = null;
7575
}
7676
};
77-
}, [map, active, geometryType, sampleTerrain, coordinatesLength, geodesic]);
77+
}, [map, active, geometryType, sampleTerrain, coordinatesLength, geodesic, onDrawEnd]);
7878

7979
return null;
8080
}

web/client/components/map/openlayers/DrawGeometrySupport.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function DrawGeometrySupport({
6060
draw.current = null;
6161
}
6262
};
63-
}, [map, active, geometryType, coordinatesLength, geodesic]);
63+
}, [map, active, geometryType, coordinatesLength, geodesic, onDrawEnd]);
6464
return null;
6565
}
6666

web/client/plugins/Annotations/containers/AnnotationsMapInteractionsSupport.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ function AnnotationsMapInteractionsSupport({
3333
}) {
3434

3535
const getGeometryType = ({ properties } = {}) => properties?.annotationType === 'Text' ? 'Point' : properties?.annotationType;
36+
const getDrawGeometryType = ({ geometry, properties } = {}) => properties?.annotationType === 'Text'
37+
|| (properties?.radius > 0 && !geometry) ? 'Point' : properties?.annotationType;
38+
3639
if (!areAnnotationsMapInteractionsSupported(mapType)) {
3740
return null;
3841
}
3942
const DrawGeometrySupport = drawGeometrySupportSupports[mapType];
4043
const EditFeatureSupport = editGeoJSONSupportSupports[mapType];
4144
const isFeatureGeometryValid = validateFeature(feature, true);
4245
const selectedAnnotationType = getGeometryType(feature);
46+
const drawGeometryType = getDrawGeometryType(feature);
4347
const isGeodesic = !!geodesic[selectedAnnotationType];
4448
return (
4549
<Suspense fallback={null}>
@@ -48,7 +52,7 @@ function AnnotationsMapInteractionsSupport({
4852
map={map}
4953
active={active && feature.geometry === null}
5054
depthTestAgainstTerrain={false}
51-
geometryType={selectedAnnotationType}
55+
geometryType={drawGeometryType}
5256
geodesic={isGeodesic}
5357
getObjectsToExcludeOnPick={() => []}
5458
onDrawEnd={({ feature: newFeature }) => {

0 commit comments

Comments
 (0)