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
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
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
nearlyEqualfunction 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
centerToMarker: trueinmapInfostate.Expected Result
Map should recenter under valid case
Current Result
Map is not recentered in the above mentioned case
Browser info
(use this site: https://www.whatsmybrowser.org/ for non expert users)Other useful information