data = {
let responses = [];
const perChunk = Math.min(info.maxRecordCount, 100);
for (let i = 0; i < objectIds.length; i += perChunk) {
const chunk = objectIds.slice(i, i + perChunk);
const query = {
where: "1=1",
outFields: "*",
f: "geojson",
objectIds: chunk.toString()
};
const fullUrl = url + "query?" + new URLSearchParams(query);
responses.push(fetch(fullUrl).then((response) => response.json()));
}
return Promise.all(responses).then((responses) => ({
type: "FeatureCollection",
features: responses.reduce(
(acc, curr) => acc.concat(curr.features),
new Array(0)
)
}));
}