Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Measurement in Cesium map issue #10918

Open
1 task done
ElenaGallo opened this issue Mar 10, 2025 · 3 comments
Open
1 task done

Measurement in Cesium map issue #10918

ElenaGallo opened this issue Mar 10, 2025 · 3 comments
Assignees
Labels
BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch bug
Milestone

Comments

@ElenaGallo
Copy link
Contributor

Description

It is not possible to measure on 3D map. Error on console:

Uncaught TypeError: Cannot read properties of null (reading 'removeAll')
at T._updateDynamicCoordinates (cesiumDrawGeometrySupport.7c28dffed39bdf8a.chunk.js:1:8137)
at T._drawPrimitives (cesiumDrawGeometrySupport.7c28dffed39bdf8a.chunk.js:1:7905)
at T._handleMouseMove (cesiumDrawGeometrySupport.7c28dffed39bdf8a.chunk.js:1:4873)
at cesiumDrawGeometrySupport.7c28dffed39bdf8a.chunk.js:1:2754
at v (mapstore2.js?7c28dffed39bdf8a:2:2771744)
at E (mapstore2.js?7c28dffed39bdf8a:2:2772167)
at x (6714.7c28dffed39bdf8a.chunk.js:2:323577)
at W (6714.7c28dffed39bdf8a.chunk.js:2:327981)
at HTMLCanvasElement.o (6714.7c28dffed39bdf8a.chunk.js:2:321898)

How to reproduce

  • Open a 3D map

  • Click on Measure tool

  • Draw a measurement on map

  • Not browser related

Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome
Firefox
Safari

Other useful information

@ElenaGallo ElenaGallo added BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch bug labels Mar 10, 2025
@ElenaGallo ElenaGallo added this to the 2025.01.00 milestone Mar 10, 2025
@MV88 MV88 changed the title Measurament in Cesium map issue Measurement in Cesium map issue Mar 10, 2025
@MV88
Copy link
Contributor

MV88 commented Mar 10, 2025

This issue looks to be cause from this commit
798ec3d

I'm checking why

@dsuren1 perhaps, do you remember why it was added the onDrawEnd in the useEffect because this is causing the issue

@dsuren1
Copy link
Contributor

dsuren1 commented Mar 11, 2025

@MV88

onDrawEnd={({ feature: newFeature }) => {
onChange({
...feature,
properties: {

Upon finishing the draw, feature value here is not latest due to stale closure, hence the onDrawEnd was added as a dependency

@MV88
Copy link
Contributor

MV88 commented Mar 11, 2025

@MV88

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

Lines 58 to 61 in a5a26ed

onDrawEnd={({ feature: newFeature }) => {
onChange({
...feature,
properties: {
Upon finishing the draw, feature value here is not latest due to stale closure, hence the onDrawEnd was added as a dependency

but this is causing the issue described here Can we have a quick sync to explore alternatives?

Also maybe having it defined as arrow function could make the function being created every time and not once. i guess it might be good to check if using useCallback might change. But I'll try that after the sync eventually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch bug
Projects
None yet
Development

No branches or pull requests

3 participants