Hello,
I have taken a long break from the Web component but needed to update some parts of a demo site we currently have up. I remember I wanted to Insert the layers as opposed to adding them because I always wanted the layer I was adding to be inserted at the bottom of the map so that I would have the order of my Layer List be the same topological order the layers appear in the map.
This would allow me to do all of my work in one pass instead of two (processing in one order for the layer list and in the opposite order for adding the layers to the map). It seems, however, that when I insert a layer into the collection, I forfeit the ability to give the entry a key. Is this true? Being able to reference a layer by it's given key is crucial for a variety of reasons so I would like to be able to insert the layer with Layers.Insert(0, layerToAdd) but have the ability to also use Layers(layerName) and still retrieve the result. I would rather not loop through the collection to find a match if I don't have to. Doing Layers.Add allows for specifying a key. Can this be done on the Insert as well?
Thanks,
Nelson