fix(measure): show a real total in the Measure panel - #1465
Conversation
The Measure panel's "Total Distance" / "Total Area" readout dropped to 0.00 the moment a measurement was completed, even though the result was listed right below it. The readout rendered only the in-progress drawing's value, and finishing a measurement re-arms the tool, which resets that value to zero. Fixed upstream in maplibre-gl-components 0.28.1 (opengeos/maplibre-gl-components#124): the readout now sums the completed measurements of the active mode plus the one being drawn, refreshes when a measurement is deleted, and stays on screen after Escape while measurements remain. The panel's unit selector also re-renders the saved measurements list in the new unit instead of leaving the previous unit's numbers. Fixes #1460
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pull request updates ChangesDependency Update
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 PR preview
|
Fixes #1460
Problem
Controls -> Measure showed Total Distance / Total Area as
0.00no matter how much the user measured. The reporter's screenshot captures it exactly: a completed polygon of1324428.31 Square Kilometerssits in the results list while the readout above reads0.00.Root cause
Upstream, in
maplibre-gl-components'MeasureControl. The readout rendered onlystate.currentValue(the drawing in progress). Finishing a measurement re-arms the tool for the next one, and re-arming resetscurrentValueto zero, so the number labelled "Total" collapsed to0.00the instant a measurement completed.Fix
Bumps
maplibre-gl-componentsto 0.28.1 (opengeos/maplibre-gl-components#124), where the readout now:Clear Allstill hides it.No GeoLibre-side wiring changes were needed.
mainalready tracked^0.28.0, so this is the patch bump plus the lockfile.Verification
Driven in a browser against the published 0.28.1, in light and dark themes:
4300.03 Kilometers, matching the list entryGate:
npm run buildclean,npm run test:frontend3951 passing,npm run test:workerclean,pre-commit run --files <changed>passing. Upstream: 247 tests passing (7 newMeasureControlcases), lint and build clean, CodeRabbit approved.Summary by CodeRabbit