While drawing the Route, As the User clicks a new point is added to the route layer which becmoes a polyline.
While the user is plotting the route I would like a line to follow the mouse as it moves and only become part of the polyline once the user clicks to set the end point.
What I am currently doing is upodating the polyline on the mouse move event. and then doing a map.refresh.
This is VERY Slow and doesnt seem practical. IS there a way to draw the moving portion ( Last Clicked point to mouse position) in a more efficient manner? Preferably without the continuous map.refresh.
It seems to me like you might be able to pull this off by using the EditOverlay. It has a VertexAdded event that should let you add each segment as the user clicks, perhaps into an InMemoryLayer until it's finalized. The edit overlay has all the gadgetry expected while editing but you can turn almost everything off. We use the EditOverlay to let the user do free-form drawing with all the edit gadgetry (rotate, drag, etc.) turned off.
What about the TrackOverlay? This would seem to be a good option for you as we can simply pass back to you the features you have drawn while in some TrackMode. You can see the TrackOverlay in action in the Editing FeatureLayers - TrackAndEditShapes sample application in the Desktop Edition Sample Applications installed with Map Suite Desktop.
Oh yeah Ryan, I probably should have suggested TrackOverlay before EditOverlay…I think that was what I had in mind. We use TrackOverlay in our app to let the user draw shapes of different types.