-
Notifications
You must be signed in to change notification settings - Fork 641
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
Leaflet 'autoPan' does not work when popup is compiled by angular #741
Comments
I have also noticed this issue when using the nginclude directive - autoPan was working correctly until I moved the html into a template. |
Your best bet is to dig into the directive and modify and play with it. |
After having some time to get back to this I have pinpointed the issue. It relates to the following
in leaflet and the calculation of the offsetHeight of the container, which seems to be incorrect and therefore |
Ok seems that the _autoPan function is called first therefore does not have the correct settings changing
to
seemed to fix it but would suggest someone review it. It seems if you call adjustPan explicitly it has the correct values. Please note I updated to 0.8.1 and notice you wrapped the update pop in the $timeout service - I think this is also required for the method calls in the $includeContentLoaded event. @nmccready or @fbrandel can you review as whilst the above works I am not sure if the above has any other implications on other areas - thanks |
I will create a pull request for this as its important for my application - feel free to review. The only issue I have is that the _autopan method is called twice. When you explicitly call it as above this works but sometimes its not as smooth as I would like. |
I'd like to just add for future reference that support needs to be added for https://github.com/erictheise/rrose or get this pushed out Leaflet/Leaflet#2324 for this autoPan feature to work with maxBounds |
#800 changed this yet again |
Version: 0.7.15
Normally when a popup is opened, the map is scrolled so the popup is fully visible (see autoPan)
This functionally does not work when the popup content is compiled by an ngInclude directive.
The text was updated successfully, but these errors were encountered: