Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
Error 404 when loading a .geojson file in a web application (leaflet, ajax)

I'm learning how to build GIS web applications, and I'm getting an HTTP Error 404.3 - Not Found trying to load a geojson file into a map built with leaflet. I'w checking the map directly online in my website

In I have inserted this tag that calls the AJAX file:

The script is:

 var geojsonLayer = new L.GeoJSON.AJAX('/.../data/attractions.geojson', {pointToLayer: function(feature, latlng) {
                var str = "<h4>"+feature.properties.name+"</h4><hr>";
                str += "<a href='"+feature.properties.web+"' target='blank'>";
                str += "<img src='img/"+feature.properties.image+"' width='200px'>";
                str += "</a>";
                return L.marker(latlng).bindPopup(str);
            }});
 geojsonLayer.addTo(mymap);

Everything is right, but I read this error loading my geojson.

I think the problem is with the geojson file extension, but I don't know how I can handle it. I use a windows hosting through Aruba. The file is not damaged (I tried to open it on Qgis without problems)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I just fixed the problem, I hope to help someone to save time since I lost hours today.

Basically, you just need to replace ".geojson" with ".json" (without changing the file extension).

I do not understand why, and if you have the answer please let me now, but now it works.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!