kartena / Proj4Leaflet

Smooth Proj4js integration with Leaflet.
http://kartena.github.io/Proj4Leaflet/
BSD 2-Clause "Simplified" License
589 stars 173 forks source link

Fix CRS.scale to handle non-integer zoomlevels #73

Closed perliedman closed 9 years ago

perliedman commented 10 years ago

When pinch-zooming (and possibly other cases), Leaflet calls CRS.scale with a non-integer zoom argument. This is currently not handled by Proj4Leaflet, which causes NaN problems in Leaflet, so that pinch-zooming is at least partially broken if Proj4Leaflet is used.

perliedman commented 10 years ago

The current fix has some issues, since the interpolation method is too naïve to be really good. Using this method, making a graph of the scale looks something like this: image

showing clear signs of discontinuities at the integer zoom levels.

I have some ideas on how to fix this, but the current state might at least be better than not supporting non-integer zoom levels at all.

perliedman commented 9 years ago

:star2: :beers: