locked
Remove previouse RouteLine When putting New RouteLine on Map RRS feed

  • Question

  • Hi experts, i am putting a routeLine on the map between Two location. Next time when i am putting the new line the previouse one is not removing. How to implement it. please suggest.

    Thank you.


    saroj

    Saturday, August 25, 2012 10:40 AM

Answers

  • When adding routes to the map I usually recommend using two MapLayers, one for the route line and one for the pushpins along the route. You can then clear the MapLayers when you want to load a new route. Alternatively, if you have a reference to the route line you can use the Remove method on the children of the map.


    http://rbrundritt.wordpress.com

    Saturday, August 25, 2012 4:34 PM

All replies

  • When adding routes to the map I usually recommend using two MapLayers, one for the route line and one for the pushpins along the route. You can then clear the MapLayers when you want to load a new route. Alternatively, if you have a reference to the route line you can use the Remove method on the children of the map.


    http://rbrundritt.wordpress.com

    Saturday, August 25, 2012 4:34 PM
  • Hi Richard, Thank you for your valuable suggestion. it worked.

    Thank you.


    saroj

    Monday, August 27, 2012 6:32 AM
  • Hi, 

    If you need to remove previous route line just use this

    YourMapLayer.Clear( );

    when you request for the new route. but remember it will remove all objects added in your Map Layer so if you want any of the other object to be remained on it use separate Map Layer for that. 


    Mudassir - Software Engineer, Ilmasoft


    Thursday, July 17, 2014 5:17 AM