Multiple Map service

455
1
03-14-2014 09:43 AM
vinayb
by
New Contributor III
Hi all,

I am trying to use  two map service .My second map service should be ahead or infront of first service but it hiding behind first service.I tried to add second service first then so that issue is resolved but problem persist any suggestion
0 Kudos
1 Reply
JeffPace
MVP Alum
Vinay,
The problem is the lazy loading of layers.  It sounds like one of yours is just taking longer to load so it is loading later.

You have two options

1. Add the map layers together with addLayers([0,1]) instead of adding one at a time.  This will guarantee the order.
2. Specify an index value when you add the layer.

i.e

addLayer(top layer)
addLayer(bottom layer, 0) forcing it to the bottom

-Jeff
0 Kudos