Hey everyone -- has anyone seen performance issues with ApplyEdits on 4.20?
We're getting an issue with our code in which the map is not redrawing after an apply edits function is called. We are also getting an error with an esri core worker, which may or may not be related. I can see in my console that deletedFeatures is in fact being applied, but then the map doesn't update. Interestingly, when I zoom in our out, I lose my labels on the feature reduction cluster unless I come back to the initial zoom level. Not sure if there was a breaking change I missed or if this is a known or unknown issue.
Here are some snippets of code:
public async getCurrentFeatures(): Promise<any> {
const query: __esri.Query = this.currentLayer.createQuery();
try {
const { features } = await this.currentLayer.queryFeatures(query);
return features;
} catch (e) {
this.reportError(e);
}
}
public async rendersAssetsMatchingSearchToMap(sites: SiteSummary[]): Promise<void> {
if (this.currentLayer) {
const addFeatures: __esri.Graphic[] = [];
const regionsInSites = {};
sites.forEach(siteSummary => {
if (!isNaN(siteSummary.latitude) && !isNaN(siteSummary.longitude)) {
addFeatures.push(this.makeASiteGraphic(siteSummary));
}
});
const deleteFeatures = await this.getCurrentFeatures();
const edits: __esri.FeatureLayerApplyEditsEdits = {};
if (addFeatures?.length) {
edits.addFeatures = addFeatures;
}
if (deleteFeatures?.length) {
edits.deleteFeatures = deleteFeatures;
}
this.currentLayer
.applyEdits(edits)
.catch(e => {
console.log(e);
});
}
}
After I run this, I can see in the console that it is being applied. This is on a "clear" call, so there wouldn't be any addFeatures.
Map doesn't update:
It does lose labels when I zoom out:
Labels return when I zoom back in...(no additional searches applied)
Anyone have thoughts or ideas here? Again, this just recently started and it was all working fine before the updates.
And if this helps at all ... this is the error I'm seeing.
Hi there,
Is it possible for you to share your service with me? It would help to narrow down the issue. If not then, can you please tell me if it is enterprise of hosted feature service? If enterprise then what version of the server are you using?
Thanks,
-Undral
Oh man ... I'm getting mixed up what you mean by service here, my apologies. I'm currently on ArcMap FeatureLayer if that helps.
For what this is worth ... I reverted to 4.19.0 and the code is now working.