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

ROU-4665: allow preserving the zoom level when user changes it #152

Merged
merged 8 commits into from
Jan 23, 2024

Conversation

rugoncalves
Copy link
Contributor

This PR is adding the capacity for the map to respect the user changes on the zoom, when map center is changed, or markers are added, changed, removed.

What was happening

  • The zoom was being reset whenever any change to the map that caused a refresh in it occurred.
  • The scenarios when the reset occurred were:
    • the center of the map changed (and there were no markers)
    • the center of a marker changed
    • a marker was added
    • a marker was removed

What was done

  • Added new optional config in the map: RespectUserZoom (default: false - current behavior)
  • Added listener to zoom_changed (google maps) / zoom_end (leaflet) event
  • Added flag to understand when the user scrolls _zoomChanged
  • Blocked refreshZoom when RespectUserZoom config and _zoomChanged flag are set to true

Test Steps

  1. Automatic tests were created

Checklist

  • tested locally
  • documented the code
  • clean all warnings and errors of eslint
  • requires changes in OutSystems (if so, provide a module with changes)
  • requires new sample page in OutSystems (if so, provide a module with changes)

gnbm
gnbm previously approved these changes Dec 15, 2023
@gnbm
Copy link
Collaborator

gnbm commented Dec 15, 2023

@rugoncalves Sonarcloud is signalling some code duplication.

@rugoncalves rugoncalves marked this pull request as draft December 18, 2023 12:19
@rugoncalves rugoncalves marked this pull request as ready for review January 23, 2024 10:44
@rugoncalves rugoncalves requested a review from a team as a code owner January 23, 2024 10:44
@rugoncalves
Copy link
Contributor Author

@rugoncalves Sonarcloud is signalling some code duplication.

Indeed it is, but after seeing it with @OS-giulianasilva the warnings are to be ignored.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

16.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@rugoncalves rugoncalves merged commit 5636b9e into dev Jan 23, 2024
9 of 10 checks passed
@rugoncalves rugoncalves deleted the ROU-4665 branch January 23, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants