Hi, I've been playing around with the Dynamic TrackShapes application from the code community, to try and modify it to do something a little different than what the original one did.
What I am trying to do is dynamically report the length of the last line segment being tracked so the distance between the last vertex actually clicked and the tracking of the mouse point.
The way I try to do this is something like this:
int idx = (areaBaseShape as PolygonShape).OuterRing.Vertices.Count;
Vertex v1 = (areaBaseShape as PolygonShape).OuterRing.Vertices[idx-2];
Vertex v2 = e.MovedVertex;
LineShape ls = new LineShape(new Vertex[]{v1,v2});
Perimeter = ls.GetLength( winformsMap1.MapUnit, DistanceUnit.Kilometer );
where areaBaseShape is the shape being tracked
but when tracking around i get very strange numbers, ranging from 10 to upwards of the thousands by only moving the mouse a small bit. Is there something wrong with the way i am calculating this distance? or is there a better way to accomplish what i am attempting to do?
thanks in advance,
-- Andy