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

Hello @debee. I’m trying to do the same thing but I seem to be missing something. Can you share a repo for this project if you don’t mind @adam26d