Hello!
I'm looking for recommendations. I have this set up where I query a layer and then create a chart.
However, I have a second layer I would like to query at the same time and ideally wait to have both responses before creating my custom chart. Does anyone know how I could achieve that?
Thank you
require(["esri/layers/FeatureLayer", "esri/rest/support/Query"], (FeatureLayer, Query) => {
const layer = new FeatureLayer({url: layerURL });
const query = new Query({where: /* query params */});
layer.queryFeatures(query).then((result) => {
createCustomChart(result.features); /* Create my custom chart and display it */
});
})
Edited answer. Nest the second inside the then block of the first.