Can you take a look at the following:
In your MapParser Class on initOverlays function you have the following:
for (var i = 0; i < json.layers.length; i++) {
if (!json.layers.isBaseLayer) {
var overlayJson = json.layers;
var otype = overlayJson.otype.toUpperCase();
if (otype == 'LAYER') {
var overlay = this.getLayerByJson(overlayJson, json.cid);
if (overlay) {
layers.push(overlay);
json.layers.splice(i, 1);
}
}
}
}
I guess this is wrong. can you confirm this?
it's messing my layers order.