Hi all,
Just playing around with esri-leaflet to see if I can get everything done easier.
I a bit of a novice, but was able to quickly access my data attributes on map click with Tasks.identifyFeatures.
However I don't know how to get that data out of that task and into a variable so I can process the selection elsewhere.
In the console.log in run, I can get all the info I want. How do I pass it back to the parcels variable in map.on and then get access to the data?
map.on('click', function (e) {
parcels = queryOnMapClick(e);
});
function queryOnMapClick(clicked) {
var clickedParcels = L.esri.Tasks.identifyFeatures(pathtoservice)
.on(map)
.at(clicked.latlng)
.layers('visible:4')
.run(function (error, featureCollection, response) {
console.log("UTC Offset: " + featureCollection.features[0].properties.APN_PQ);
});
}
Thanks for any tips.
-Tim