none
Removing layers in v8API RRS feed

  • Question

  • How does one do this? i.e.what is the "opposite" of map.layers.insert(layer); code snippet present in some of the SDK examples.
    Saturday, April 9, 2016 7:17 PM

Answers

  • Currently about 2/3rds of the API is documented so far. To remove a layer from the map use

    map.layers.remove(layer);
    

    Alternatively, you can also use

    map.layers.removeAt(indexOfLayer);
    

    The map.layers property has the following methods available;

    • clear()
    • indexOf(layer)
    • insert(layer, index?)
    • insertAll(arrayOfLayers, index?)
    • remove(layer)
    • removeAt(layerIndex)
    • slice(startIndex, endIndex)

    http://rbrundritt.wordpress.com

    Monday, April 11, 2016 4:17 PM