-
Couldn't load subscription status.
- Fork 16
PB-1875: links with pre-selected features do not center correctly #1385
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
base: develop
Are you sure you want to change the base?
PB-1875: links with pre-selected features do not center correctly #1385
Conversation
web-mapviewer
|
||||||||||||||||||||||||||||
| Project |
web-mapviewer
|
| Branch Review |
fix-PB-1875-wrong-center-on-startup-with-selected-layers
|
| Run status |
|
| Run duration | 05m 06s |
| Commit |
|
| Committer | Martin Künzi |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
20
|
|
|
0
|
|
|
261
|
| View all changes introduced in this branch ↗︎ | |
1948be4 to
0001d31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little test to cover this new addition?
- Issue: In some occasions, opening a link containing both a center and pre-selected features would prioritize centering on the features rather than centering on the pre-established center. This would only occur at startup. Once the application is running, changing the URL to the one we want would set all parameters correctly - Cause: On startup, we go through the store sync loop multiple times, and at one point, we set the features after the center, and thus override the center parameter - Fix: If there is a `center` parameter in the query, we don't set the center on the features extent.
0001d31 to
46a10b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK you aren't really testing what you changed in the code here, please change the test so that you test that:
- The map centers on a (single) feature when it is loaded with a pre-selected layer feature, and without defining a center param
- The map loads the view on the center param, even if the feature is also declared alongside it
0cdd051 to
b81b170
Compare
packages/mapviewer/tests/cypress/tests-e2e/featureSelection.cy.js
Outdated
Show resolved
Hide resolved
packages/mapviewer/tests/cypress/tests-e2e/featureSelection.cy.js
Outdated
Show resolved
Hide resolved
bb98f2c to
2c05c10
Compare
- Added tests to ensure that, whenever both center and features are present at startup, we prioritize the center - Modifying a test, ensuring the synchronisation test between store and URL tells us if reloading the app still keeps the selected features, but we'll be investigating the flaky test behaviour at a later time.
2c05c10 to
6c5622a
Compare
Issue: In some occasions, opening a link containing both a center and pre-selected features would prioritize centering on the features rather than centering on the pre-established center. This would only occur at startup. Once the application is running, changing the URL to the one we want would set all parameters correctly
Cause: On startup, we go through the store sync loop multiple times, and at one point, we set the features after the center, and thus override the center parameter
Fix: If there is a
centerparameter in the query, we don't set the center on the features extent.Test link