Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

recalc all measurements on olMap change (#4100)

Ryan Weiler4153ea254812
diff --git a/web/js/components/map/ol-measure-tool.js b/web/js/components/map/ol-measure-tool.js
index 469db9498..f86466b9c 100644
--- a/web/js/components/map/ol-measure-tool.js
+++ b/web/js/components/map/ol-measure-tool.js
@@ -124,6 +124,9 @@ function OlMeasureTool (props) {
useEffect(recalculateAllMeasurements, [crs]);
+ // we need this to make sure we have the latest version of olMap in renderToolTip()
+ useEffect(recalculateAllMeasurements, [olMap]);
+
const areaBgFill = new OlStyleFill({
color: 'rgba(213, 78, 33, 0.1)',
});