I have marker point that updates it's position periodically on the map. If i wanted to draw a traceline on the map to keep track of the path that the marker point has moved, what would be the best way of doing it without slowing down the rendering of the details on the map?
You can achieve your requirement by using the map's VisualizationLayer and its map shape data objects to draw the traceline and the marker. For example, you can use the PolylineData object to draw the traceline and when the marker's position is updated you can add new Location in the Points collection of the polyline. for your convenience I prepared a sample project demonstrating this approach. Please give it a try and let me know if it works for you.
Regards,
Martin
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
the example you provided was really helpful thank you, however I come across a problem when I try to clear the LocationCollection (Contains 1 hour of data points that's roughly 72k worth of location) it took me roughly around 4 to 5 seconds before the layer clears it all off. Any recommendation how I can clear this fast?
a sample code
visualizationLayer.Visibility = false;
visualizationLayer.Points.RemoveAll();
visualizationLayer.Layer.Items.Clear();
0
Accepted
Martin Ivanov
Telerik team
answered on 21 Dec 2015, 09:30 AM
Hello Vincent,
Removing an item from the Points collection of a PlylineData object executes a logic in code which requires additional computing time. This is why clearing the collection takes several seconds. To improve the removing operation on your side you can use the Clear() method of the Points collection instead of RemoveAll().
visualizationLayer.Points.Clear();
Please try this and let me know if it works for you.
Regards,
Martin
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items