Quantcast
Viewing all articles
Browse latest Browse all 97529

Re: Can someone help me with creating a javascript please?

OK, that's a bit more clear. You can use this code as a doc-level script:

 

function showOneLayer(allLayers, layerToShow) {    var docOCGs = this.getOCGs();    for (var x=0; x < docOCGs.length; x++) {        var layer = docOCGs[x];        if (allLayers.indexOf(layer.name)!=-1) {            layer.state = (layerName==layerToShow);        }    }
}

 

And then call it from your check-boxes like this (to make the first layer visible, for example):

 

showOneLayer(["Layer1", "Layer2", "Layer3", "Layer4"], "Layer1");

Viewing all articles
Browse latest Browse all 97529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>