CloudMade/Leaflet — pull request #729 by danzel (2012-06-13 02:40:12+00:00)
Title: Fix rapid zooming giving a blank map

If you zoom in or out twice quickly (before new tiles can load) you will be given a blank map.
These changes make us consider whether we should use the existing background (zoomed) layer or re-use the foreground layer instead.
If the current foreground doesn't have enough tiles loaded we'll keep the current background instead (and zoom it in).

Fixes CloudMade/Leaflet#7 (The second oldest open issue on leaflet!)

Happy to change _getLoadedTilesPercentage if there is a better way to do it.