PB-1595: showing mouse coordinates in 3D:#1297
Conversation
d56f6bf to
2eb3d64
Compare
web-mapviewer
|
||||||||||||||||||||||||||||
| Project |
web-mapviewer
|
| Branch Review |
develop
|
| Run status |
|
| Run duration | 01m 23s |
| Commit |
|
| Committer | Martin Künzi |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
1
|
|
|
0
|
|
|
48
|
| View all changes introduced in this branch ↗︎ | |
be895cd to
0062962
Compare
| const projection = computed(() => store.state.position.projection) | ||
|
|
||
| const dispatcher = { dispatcher: 'CesiumMouseTracker.vue' } | ||
| const getViewer = inject('getViewer', () => {}, true) |
There was a problem hiding this comment.
I'd maybe more want to go in the direction where the default value returned here would be undefined, and then you can mount the component only when the function returns something relevant.
Or if not applicable to a v-if, as you are the "top component" after MapView here, you could do something like
const getCesiumViewer = inject('getViewer'), () => undefined, true)
watch(() => getCesiumViewer(), () => /* do something when the viewer changes */)I really don't like, and want to avoid any setTimeout use when we can deal with what we want to wait differently
There was a problem hiding this comment.
I started by creating a watcher on the viewer and making it a reactive components, but after a few tests, I noticed that the isViewerReady flag never changed... and so it was never set to false when we unmounted the 3D view. Since this flag is set to true once the viewer is created and ready to be used, switching that flag seems to work without needing to make the whole viewer reactive, and we no longer need to set a timeout.
0062962 to
abe7655
Compare
| (newValue) => { | ||
| if (newValue) { | ||
| setupHandler() | ||
| nextTick(() => { |
There was a problem hiding this comment.
have you tried removing the nextTick call? Are they still needed?
There was a problem hiding this comment.
it seems to work without the nextTick. Now I'm investigating the webmercator issue :)
b1ca2f0 to
e2d165c
Compare
pakb
left a comment
There was a problem hiding this comment.
You might want to remove the now unused import of nextTick 😉
Issues : - We were sending 3 pairs of Coordinates to the format function while in 3D, and the function could only handle two - The is3DReady flag was sometimes ready before the viewer could be accessed, leading to a situation where the handler could not be set up Fixes : - We're splitting the coordinates and adding the rounded height at the end of it. (the height is optional IMO) - We set a timeOut function which call itself while the viewer is not ready to ensure the viewer is ready before we set the handler. meh PB-1595: ensuring reactivity works for 3D Issue: When going from 3d to 2d, then back to 3d, the `isViewerReady` flag stayed at true the whole time, stopping other components from watching its state. This could mean some components would see the flag as true when the viewer was not ready. Fix: We now set the flag to false when destroying the 3d viewer. We also removed the timeouts in the mouse position plugin. PB-1595: show webMercator labels Issue : the webMercator labels were not displayed Fix : we ensure the function display all labels
e2d165c to
16a0279
Compare

Issues :
Fixes :
isViewerReadyflag to false when unMounting the 3D viewer so it can behave normally once re-created.Test link