-
Notifications
You must be signed in to change notification settings - Fork 4
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
Stop the web page from scrolling to the top when the Reset View Control is clicked. #1
Comments
further tested the above change request, and it wouldn't work in case the ResetView.__resetView() is called/triggered programmatically (that could always be) because the "e" event won't be defined.
|
This is an issue for me as well, more so because my map is in an iFrame so clicking the reset view button actually means the parent page is replaced by the iframe'd child page (I have |
If the Leaflet Map is not at the top scroll of the web page, the click of the Reset View Control makes the page scrolling all to the top, eventually even making the map itself to disappear ...
Hence we need to stop the web page from scrolling to the top when the Reset View Control is clicked,
and this post highlights the proper solution:
https://stackoverflow.com/questions/1601933/how-do-i-stop-a-web-page-from-scrolling-to-the-top-when-a-link-is-clicked-that-
Adding
e.preventDefault();
before the following:
Leaflet.ResetView/src/L.Control.ResetView.js
Line 56 in a1dd35f
solves this issue to me.
The text was updated successfully, but these errors were encountered: