trailbehind / leaflet-grids

Leaflet plugin that support s a few types of grid overlays.
MIT License
29 stars 6 forks source link

leaflet-grids with proj4 #6

Open d33q opened 7 years ago

d33q commented 7 years ago

Some help with leaflet-grids and proj4.js different projection?

Sample map with custom projection:

var crs = new L.Proj.CRS.TMS('EPSG:3067',
    '+proj=utm +zone=35 +ellps=GRS80 +units=m +towgs84=0,0,0,-0,-0,-0,0 +no_defs',
    [-548576.0, 6291456.0, 1548576.0, 8388608],
    {
        resolutions: [
            8192,
            4096,
            2048,
            1024,
            512,
            256,
            128,
            64,
            32,
            16,
            8,
            4,
            2,
            1,
            0.5,
            0.25,
            0.125,
            0.0625,
            0.03125,
            0.015625
        ]
    });

var map = new L.Map('map', {
    crs: crs,
    continuousWorld: true,
    worldCopyJump: false,
    zoomControl: true
});

var tilelayer = new L.Proj.TileLayer.TMS('http://{s}.map-place.abc/map/{z}/{x}/{y}.png', crs, {
        maxZoom: 19,
        minZoom: 0,
        tileSize: 256,
        tms: true,
        continuousWorld: true,
        attribution: '©',
        subdomains: ['tile1','tile2']
});
JesseCrocker commented 7 years ago

Hello, Currently leaflet-grids does not support using a custom CRS. If you would like to implement that I would welcome a pull request.

d33q commented 7 years ago

Thats the problem, I don'n know how to do that.