PB-1236: infobox doesn't change language when open#1209
Conversation
web-mapviewer
|
||||||||||||||||||||||||||||
| Project |
web-mapviewer
|
| Branch Review |
develop
|
| Run status |
|
| Run duration | 01m 48s |
| Commit |
|
| Committer | Felix Sommer |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
1
|
|
|
0
|
|
|
48
|
| View all changes introduced in this branch ↗︎ | |
dca4513 to
605d67f
Compare
ltkum
left a comment
There was a problem hiding this comment.
While this works for the language change, it introduces a new unwanted behavior and the logic behind it doesn't sit well with me (if we want to trigger something on a language change, we should put the watcher on the language).
| watch(activeLayers, (newActiveLayer) => { | ||
| if (showLayerDescriptionIndex.value !== null) { | ||
| onShowLayerDescription( | ||
| newActiveLayer[showLayerDescriptionIndex.value], | ||
| showLayerDescriptionIndex.value | ||
| ) | ||
| } | ||
| }) | ||
|
|
There was a problem hiding this comment.
We should be watching a language change, not a layer change, here. This will be called if I add or remove a layer from the active layers, which is not what we want.
For example, if I add the public transports stops layer, click somewhere, and add the RBD building layer, the popup will now show the building layer which is not what we want.
We might need to do a quick check with getIndexOfActiveLayerById to find the layer again after the lang change, do something like
if (showLayerDescription.value) {
showLayerDescription.value = activeLayers.value[getIndexOfActiveLayerById(showLayerDescription.value.id)]
}
There was a problem hiding this comment.
We discussed about this with Pascal, and we have found a more elegant solution, but it is quite difficult to explain. He will either send you a gist (or make a commit) on this issue.
Also, I made a mistake about the active layers side effects in this case :)
605d67f to
9620a7c
Compare
9620a7c to
b524adc
Compare
Test link