Quantcast
Channel: Question and Answer » json
Viewing all articles
Browse latest Browse all 148

How do I show feature attributes in a Leaflet popup?

$
0
0

So I have a JSON file displayed on my leaflet webmap. I would like to have it so a popup will appear when a feature is clicked. Right now it is a polygon feature. How do I call up information from the JSON file (Syriashape.json) so it can be displayed? The fields I would like to display are called “Sheet_Num” and “Date”

Currently, this is what I have:

// load GeoJSON from an external file
$.getJSON("Syriashape.json",function(data){
  // add GeoJSON layer to the map once the file is loaded
  L.geoJson(data).addTo(map).bindPopup("Attributes Popup Here");
});

Viewing all articles
Browse latest Browse all 148

Trending Articles