2

I have a Leaflet map in default projection and a WMS layer also in default (Web Mercator) projection. I would like to add polylines and a geoJSON layer to my map, but the coordinates are in EPSG4326. I have figured out how to set the entire map projection, passing L.CRS.EPSG4326 into the map object. But as I have a WMS in Web Mercator (no other projection options here), but polylines and geoJSON in EPSG4326, that does not seem to be an option.

I looked at the Proj4Leaflet plugin, but that also seems to pass a CRS into the map object. Any ideas?

6

Leaflet expects GeoJSON to be in EPSG:4326. In fact, the entire API uses 4326 (lat/lng), so you are good to go without any reprojection.

If you need to reproject GeoJSON, you could look at https://github.com/perliedman/reproject.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.