Error Too much recursions #366
Comments
Hi, try this: #330 (comment) |
Hello, |
Silly me !!! $( window ).resize(function() { |
How does this solve the recursion problem? Using that same code, Chrome still locks up for me with 100% CPU usage. |
Could you please post your code here? |
@batzidi you shouldn't try to access map center's properties ( lat and lng ) directly. The key keeps changing and probably 'k' and 'B' doesn't mean anything at this point. Always try to use the getters. var lat = map.getCenter().lat(),
lng = map.getCenter().lng(); |
Felipe, that fixed it! It actually works better than I expected, since it continually and quickly recenters on the fly as you resize. The code that works is: $(window).resize(function() {
var lat = map.getCenter().lat(),
lng = map.getCenter().lng();
map.refresh();
map.setCenter(lat, lng);
}); Thank you very much! |
@amenadiel You're right! This is what I am using right now. But forgot to put a comment about it. |
Cheers then @batzidi |
Hello.
I setup a page to show the error: http://cloud.bzimg.com/gmaps
The Problem:
When I try to resize the window and set the Center again for the map it's going into recurstion and eventually breaks the map.
Chrome just shows error in the console while Firefox shows the exact error: Too much recursions. The line on which the error occurs is different everytime, but so far it repeatly says lines: 13, 14, 17
Every suggestion or advise is welcome.
Thank you
The text was updated successfully, but these errors were encountered: