Thanks for your post and sample, I have recreate this problem, we are working on this find the root cause and fix it, please subscribe this post and I will let you know the result asap.
Sorry for waiting, this problem connect to some other question, so it cost a lot time.
when I invoked CalculateAllControlPoints function, I found that the internal features’ RTree had been rebuilt. However, after I did some operation to these features I didn’t recall “BuildIndex” method. And these new features are not included in RTree dictionary. It will throw the exception when I got features by RTree index.
We have two solution for this issue:
1. The CalculateAllControlPoints should be invoked after the internal features have been changed, because the BuildIndex would be invoked, the RTree index would be reconstructed. The codes snipped as follows:
// need this to clear edit drag/resize controls winformsMap1.EditOverlay.ExistingControlPointsLayer.InternalFeatures.Clear(); winformsMap1.EditOverlay.ResizeControlPointsLayer.InternalFeatures.Clear(); winformsMap1.EditOverlay.RotateControlPointsLayer.InternalFeatures.Clear(); winformsMap1.EditOverlay.DragControlPointsLayer.InternalFeatures.Clear();
winformsMap1.Refresh(new Overlay[] { winformsMap1.EditOverlay }); 2. we can solve the issue with BeginTransaction and CommitTransaction. The codes snipped as follows: