i have a problem about sending data parameter to leaflet ajax, i'm using https://github.com/calvinmetcalf/leaflet-ajax anyone know how to send data parameter ? i have reading documentation but did't get it if i using https://github.com/calvinmetcalf/leaflet-ajax

here's my code:

function popUp(f,l){
var out = [];
if (f.properties){
    for(key in f.properties){
        out.push(key+": "+f.properties[key]);
    l.bindPopup(out.join("<br />"));
var myurl = "";
var jsonTest = new L.GeoJSON.AJAX(myurl,{onEachFeature:popUp}).addTo(m);
  • I would suggest rather than making a L.GeoJSON.AJAX call for each feature and then executing the popup code, a better approach would be to get all your geojson in one ajax call then process the geojson for each popup. – Ralph Dell Apr 27 '17 at 13:13
  • i can't do that, because so many data will loaded. – Nurul Hidayat Apr 27 '17 at 13:16
  • how may features are you talking about, 1000, 10,000, a 1000,000? – Ralph Dell Apr 27 '17 at 13:22
  • more than 100.000 and will grow up. – Nurul Hidayat Apr 27 '17 at 13:25
  • 1
    Ok. Any possibility you can get your data into a postgis table and then use another ajax method and query by attribute? In my experience geojson and +100,000 points do not play well together. – Ralph Dell Apr 27 '17 at 14:29

Your Answer

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

Browse other questions tagged or ask your own question.