kartena / Proj4Leaflet

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

Compatibility with leaflet 1.3.4? #159

Closed sroboubi closed 5 years ago

sroboubi commented 5 years ago

Is this still being maintained? Should it work with leaflet 1.3.4?

I've gotten errors trying to run your example with leaflet 1.3.4:

https://jsfiddle.net/Lwnk586p/5/ Error: set map center and zoom

After setting origin and zoom: https://jsfiddle.net/jL9whuze/ Error: Attempted to load an infinite number of tiles

But it seems to work with leaflet 1.0.3 (after setting center and zoom): https://jsfiddle.net/hkdgyxfr/

pthorin commented 5 years ago

I haven't tested 1.3.4, and not sure if anyone else has.

It's not proactively maintained but we try to help when there are issues.

perliedman commented 5 years ago

@sroboubi your code does not set the map's view, that's why you are getting a blank view.

You are also setting maxZoom too high: it causes an index out of bounds access in the resolutions array, which in turn causes the NaN/infinite number of tiles issue.

Fixed example: https://jsfiddle.net/Lwnk586p/6/