Select to view content in your preferred language

Bug in Adding Layers to Map?

482
0
03-22-2013 04:21 PM
StevenGriffith
Deactivated User
I'm calling the API method to add multiple layers to a map, and passing in an array consisting of my base and dynamic map layers. I'm also monitoring the event "OnLayersAddResult" to catch when all the layers are fully added. What's apparently happening is that the event is being fired before the last layer is fully complete, and the results array returned to the callback function has a fairly serious oddity.

Say my array of layers has layers ["A", "B", "C", "D", ...]. I pass this array of layer objects to map.addLayers(). The Event "OnLayersAddResult" fires and my callback function is called. However, the "results" variable passed to my callback function has the layers listed as ["A", "A", "B", "C", "D", ...], and the last entry in my input layer array is missing. That last layer is also incomplete - the layerInfo objects are not populated at this point in time, but are once the web page fully loads.

What's interesting is that this only appears to happen if the base layer (the first entry, "A") is an Open Street Maps layer (esri.layers.OpenStreetMapLayer), but not if the base layer is an esri.layers.ArcGISTiledMapServiceLayer.

Steve G.
County of SLO
0 Kudos
0 Replies