ordering multiple mapservices

Discussion created by digy79 on Jun 29, 2011
Latest reply on Jul 6, 2011 by digy79

I develop a large number of webmapping application every year for the same costumer and in the various project at least an half of the layers are repeated.
For this reason I'm evaluating the possibility to create a basic, fixed MXD containing these redundant layers and generate from it a basic Mapservice (with the 4/5 common layers).
My question, at this point, is what happens when I use layers coming from two (or more) different mapservices in the same javascript api application?

For example, in the following situation:

Mapservice_1 (layer 0, layer 1, layer 2)
Mapservice_2 (layer 0, layer 1, layer 2, layer 3)

the order (in the z-axis) of the layers for every single mapservice is defined by the array index (that depends from the layer order in the mxd project) and it's ok.

How can I specify in the application that Mapservice_1 layer's have to be drawn before Mapservice_2 layer's?