dojo.require("dojo.fx")
function defaultvis(layer) { visible = []; var items = dojo.map(layer.layerInfos, function (info, index) { if (contains(defaultlayers, info.name)) { visible.push(info.id); console.debug(info.name + "ative") } else { console.debug(info.name) } }); dynamicMapServiceLayer.setVisibleLayers(visible); }
_createRootLayerTOC: function () { var b = this.rootLayer; if (!b._tocInfos) { var c = {}; dojo.forEach(b.layerInfos, function (d) { c["" + d.id] = d; console.debug(d) if (contains(defaultlayers,d.name)) { d.visible = true; } else { d.visible = false; } .....
HiThis works fine, but of course the TOC code doesn't pick up on the changed visibility and shows all layers unticked (the default state) Any ideas how I should call a refresh or something of the TOC to get the boxes ticked?
I have noticed that I have to reload my page in order to get the TOC to display. I can see that the agsjs.dijit.TOC is created on the initial load of the page, but the results do not show up in my 'tocDiv'. I have also experienced this behavior on the internet example site http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/2.02/examples/toc.html on the initial load the TOC does not show, but if I refresh in IE8, it does. Just wondering if there is a work around to address this behavior. Thanks, Mele
I have exactly the same problem: when you run my app in IE9 the fist time it works however after it rerun again TOC it is not displayed any more - same happen with http://gmaps-utility-gis.googlecode.com/svn-history/r354/trunk/agsjs/examples/toc.html. I have tried to destroy dom and widjet itself - but it did not help. Is there any solution for it?
I'm not sure of the issue - I'm using the TOC code here http://maps2.eastdevon.gov.uk/mapping/assets/ and it works fine in all browsers now (mine is slightly modified to take visible layers rather than default visibility - I did this before the core code was changed to do this)ACM
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.