ghybs / Leaflet.TileLayer.Fallback

Replaces missing Tiles by scaled lower zoom Tiles
Apache License 2.0
36 stars 18 forks source link

Is this plugin now defunct? #5

Closed wartickler closed 7 years ago

wartickler commented 7 years ago

Leaflet has added minNativeZoom in the 1.0.2 release. Does this spell the end of this wonderful plugin?

ghybs commented 7 years ago

Hi,

Thank you for reporting this new minNativeZoom option in core Leaflet, introduced in version 1.0.2!

Indeed it collides with this plugin own minNativeZoom option.

Please could you kindly explicit what you are afraid of?

It seems to me that the 2 objectives are different and not necessarily exclusive. A quick test shows that it should indeed be possible to handle both behaviours at the same time (once a bug with errorTileUrl in this plugin is corrected): http://playground-leaflet.rhcloud.com/gar/1/edit?html,output

Switch with Leaflet 1.0.0 to see the difference in behaviour: http://playground-leaflet.rhcloud.com/naqo/1/edit?html,output

This plugin would very probably still need to change the default value of minNativeZoom option to 0 instead of null in core Leaflet, so that by default it stops requesting tiles at some point, rather than going down the (possibly negative) zooms indefinitely.

Please let me know your concerns, as I may have missed other use cases.

wartickler commented 7 years ago

The issue of it requesting tiles indefinitely was fixed by me by adding a minZoom of the lowest tile resolution I had - in my case 10. I think I saw a collision with the newer version and errorTileUrl as well.

What other uses does the plugin have that are not addressed by the newest Leaflet library? I don't know of any other use case. Also, perhaps you could at least address the two bugs for anyone who cannot update to the newest Leaflet and still require this functionality. I would update the README to mention the new changes in Leaflet.

Cheers, and thanks for the work you've done (:

ghybs commented 7 years ago

Hi,

Please note that minNativeZoom is already set to 0 by default, and you just need to specify it to whatever value your Tile Source actually provides, as mentioned on the README.

As for the rest, PR are welcome! :-)