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

Fix - OL map component in updating map position based on center #10793

Open
1 task done
dsuren1 opened this issue Jan 31, 2025 · 0 comments
Open
1 task done

Fix - OL map component in updating map position based on center #10793

dsuren1 opened this issue Jan 31, 2025 · 0 comments
Assignees
Labels

Comments

@dsuren1
Copy link
Contributor

dsuren1 commented Jan 31, 2025

Description

Recently, a change (#10521) was introduced to enhance the OL map component by improving how it updates the map position based on the center, allowing for an acceptable decimal change (inspired by another map component in MS). This involved formulating a nearlyEqual function to determine when an update should occur. However, there are cases where the current value is smaller than the new value, resulting in a negative difference and causing the map update to be missed.

We would like to enhance this function to be versatile

How to reproduce

  • Open a map
  • Save the map with default center
  • Perform a query param such that the map is shifted to east so that latitude of new center is lesser than current center. try using this query param on a map with default saved center. Note: Make sure centerToMarker: true in mapInfo state.
?actions=[{"type":"SEARCH:SCHEDULE_SEARCH_WITH_FILTER","cql_filter":"STATE_FIPS=34","layer":"gs:us_states"},{"type":"CATALOG:ADD_LAYERS_FROM_CATALOGS","layers":["gs:us_states"],"sources":[{"type":"WMS","url":"https://gs-stable.geo-solutions.it/geoserver/wms"}]}]
  • Observe that the map is not re-centered

Expected Result
Map should recenter under valid case

Current Result
Map is not recentered in the above mentioned case

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants