AnsweredAssumed Answered

Interesting problem

Question asked by ajay_s on Sep 20, 2013
Latest reply on Sep 20, 2013 by ajay_s

I hope somebody can provide me some insight and help to resolve the issue I am having.

The issue is to change the layer opacity - I am using JS APIs 3.2

I have base layer and a dynamic layer mapservice which has 4 layers.

the code:
for (j = 0; j <; j += 1) {
    currentLayer =[j]);
    console.log("curentLayer:", currentLayer);
    if ( !== "baseLayer") {

This does not refreshes the dynamic layer opacity, but later as the part of the workflow if I reloads the layers, it works!

And on looking is closely thru Chrome developer tools I found that map.getLayer method does not return the same layer object.

The layer object in both instace when it does not work and when it works is very similar except when it does not work, the layer object does not have OnOpacityChange method. Please see the attached images.

I am just very confused as why same method (map.getLayer) returns two different object and what I should do to fix it.

Any help and insight is greatly appreciated.