Leaflet/Leaflet — pull request #2160 by perliedman (2013-11-06 21:04:56+00:00)
Title: Remove hardcoded world size from L.TileLayer

This moves the parts hardcoded for spherical Mercator from L.TileLayer into L.CRS, where they can be overridden more easily.

In particular, this makes it possible to use TMS with L.TileLayer with projections other than spherical Mercator, which isn't possible today. (Proj4Leaflet currently has a pretty nasty workaround for this, which would be nice to get rid off.)

To do this, the method ```getSize``` is added to ICRS, which returns the size of the entire CRS in pixels, for a given zoom level. This is in turn used in L.TileLayer to calculate the the proper tile number for wrapping and TMS.