Thanks for the answer. The problem is that actually I am doing that.
public void ItemsRequest(double minZoom, double maxZoom, Location upperLeft, Location lowerRight, Action<
OldLocation = new Location();
Location TextOldLocation = new Location();
LocationRect locationRect = new LocationRect(upperLeft, lowerRight);
> objects = new List<
LocationRect rect = trackLayer.MapPolyline.GeographicalBounds;
Location location = MapLayer.GetLocation(point);
if (CheckMinimumDistance(location, OldLocation, 15))
OldLocation = location;
if (CheckMinimumDistance(location, TextOldLocation, 75))
point.Text = trackLayer.PinPointSubtitle[point];
TextOldLocation = location;
point.Text = string.Empty;
But it is working good till I delete the track line, and try to add it again. the second time it throws the exception. When I debug into the code I saw that the DynamicLayer doesn't have items (count = 0) and than it throws the exception in callback function.
I made a simple aplication that can simulate the problem.
for that you do the next steps:
1 - create
Maybe the problem is because I create a new MapPolyline Object and when it looks into the DynamicLayer dont find the current object there, but there exists one with the same polyline. But its strange when the DynamicLayer.Items.Count = 0.
You can download the solution here: