Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use EPSG:2169 with Leaflet #169

Open
jcb81 opened this issue Jan 22, 2020 · 1 comment
Open

How to use EPSG:2169 with Leaflet #169

jcb81 opened this issue Jan 22, 2020 · 1 comment

Comments

@jcb81
Copy link

jcb81 commented Jan 22, 2020

Hello all,

I'm trying to use Leaflet with a specific projection EPSG:2169 (Luref, or Luxembourg). I saw that if I don't use a "standard" projection like WGS84, I have to use Proj4Leaflet and reference it to the map.

That's what I did for now :

this.crs = new L.Proj.CRS('EPSG:2169',
'+proj=tmerc +lat_0=49.83333333333334 +lon_0=6.166666666666667 +k=1 +x_0=80000 +y_0=100000 +ellps=intl +towgs84=-189.681,18.3463,-42.7695,-0.33746,-3.09264,2.53861,0.4598 +units=m +no_defs');

this.map = L.map('map', {
  center: [ 74000, 96000 ],
  zoom: 3,
  crs: this.crs,
});

When I load the page with the map, the console gives me these errors :

Cannot read property '3' of undefined
Cannot read property 'x' of undefined

After some Googling, I found that I have to define "resolutions" option. I don't know exactly how it is used, but I took from a sample and here is now how looks the CRS :

this.crs = new L.Proj.CRS('EPSG:2169',
'+proj=tmerc +lat_0=49.83333333333334 +lon_0=6.166666666666667 +k=1 +x_0=80000 +y_0=100000 +ellps=intl +towgs84=-189.681,18.3463,-42.7695,-0.33746,-3.09264,2.53861,0.4598 +units=m +no_defs',
{
  resolutions: [8192, 4096, 2048, 1024, 512, 256, 128]
});

Now when the map is loaded, I have this error in console :

TypeError: coordinates must be finite numbers

And now I don't know what to do next. Anyone here already had this kind of issue ?

Many thanks in advance.

@MarciaBM
Copy link

MarciaBM commented Jul 9, 2024

I have the same error with the EPSG:3763 projection, any news about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants