Abishek Arumugam Abishek Arumugam - 11 months ago 77
Java Question

Using Common Layers access

I am new to javascript. I am using alert option for displaying map layers. if alert option is true it has to display 4 layers. otherwise it has to display 2 layers.

Trying to write optimized code.
Now I am displaying layers as

if(true){1,2,3,4} else{3,4}
. Trying to write optimized code
as common layers.

if true{1,2, + common layers} else{display common layers}
. Somebody

suggest me code example.


You can try this,

  // Layer1, Layer2.
// Layer3,Layer4.