kartena / Proj4Leaflet

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

Leaflet custom projection transform issue with leaflet 0.7.3 #74

Closed jkkrefta closed 6 years ago

jkkrefta commented 10 years ago

In L.Proj.CRS.TMS there are options that does not work at all. For example:

here is code i use:

var crs = new L.Proj.CRS.TMS(
            'EPSG:3006',
            '+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
            [-1171937.8799031, 5258558.13502446, 2298450.72267515, 8270258.08008982],
            {
                //origin: [-5682840.1442831, 10997760.6947701],
                transformation: new L.Transformation(1, 10997760.6947701, -1, 5682840.1442831),
                resolutions: [
                    1984.37896875794,
                    926.043518753704,
                    264.583862501058,
                    132.291931250529,
                    52.9167725002117,
                    26.4583862501058,
                    13.2291931250529,
                    5.29167725002117,
                    2.64583862501058
                ],
            }
        );

        var map = L.map('mapDivTest', {
            crs: crs,
        });

        map.on('click', function(e) {
            console.log(e.latlng);
        });

        var basemap = L.tileLayer("http://geoservices.lst.se/ArcGIS/rest/services/bakgrundskartor_vektor/MapServer/tile/{z}/{y}/{x}.png",
        {
            minZoom: 0,
            maxZoom: 8,
            continuousWorld: true,
        }).addTo(map);
perliedman commented 6 years ago

Closing this as too old to act on and also a bit hard to tell what the actual problem is; we have working TMS examples, so clearly this is at least working for most scenarios.

Please open a new issue if you have issues with TMS in the latest version of Proj4Leaflet.