Try ERPNext Buy Support Partners Foundation

Leaflet Geolocation plotting

Hi there,

I am trying to plot my data from ERPNext on a custom leaflet web page but don’t know how to access the coordinates itself to plot.

Geojson data structure.

Leaflet code:

    $.getJSON("erpnextUrl", function(data) {
    L.geoJSON(data, {}).addTo(map);

});

Thank you!

SOLVED:

$.getJSON("erpnextUrl", function(data) {

for (i in data.data) {
    var json = JSON.parse(data.data[i].geozones);
    console.log(json);

    L.geoJSON(json, {

    }).addTo(map);


}

});

1 Like