none
Remove layers from map in V8 RRS feed

  • Question

  • Hi,

    We have plotted the layers on map. We have requirement to find the any particular plotted layer and remove it from map.

    We tried by using the Name property (We have added it) of layer but it did not work.

    Can you please let us know how can we achieve this.

    Thanks!   


    Balasaheb

    Wednesday, November 9, 2016 2:14 PM

Answers

  • To remove layers you need to use the map.layers.remove or map.layers.removeAt functions: https://msdn.microsoft.com/en-us/library/mt748659.aspx If using the remove function you need to pass in a reference to the layer. If you have some property on the layer that you want to remove you will need to loop through all the layers in the map, find the layer that has the property you are looking for and then pass it into the remove function.

    [Blog] [twitter] [LinkedIn]

    Wednesday, November 9, 2016 8:02 PM