I'm trying to add this geojson file to my Leaflet project, using the following code:

var iba = L.geoJSON.ajax('data/iba/iba.geojson').addTo(map);

This geojson I have created with dummy data using the QGIS export option, but I don't know if that's relevant. Anyway, I don't get any error message in the browser's console, but the layer doesn't show up in the map. I have made a test with this other file, using the same above code (changing only the file name, as they are both in the same folder) and it works.

What's wrong with the first one?

1 Answer 1


A valid GeoJSON is only in EPSG:4326. Your file is in EPSG:25830. You can set the CRS when you export the file in QGIS.

  • 2
    A valid GeoJSON is not in EPSG:4326 it's in CRS:84. GeoJSON is long/lat, EPSG:4326 is lat/long!
    – nmtoken
    Commented Sep 20, 2022 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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