AnsweredAssumed Answered

Legend

Question asked by knabe14 on Jun 25, 2013
Latest reply on Jun 25, 2013 by kenbuja
https://developers.arcgis.com/en/javascript/jssamples/widget_legendvisible.html

I'm working through this tutorial working with the legend and check boxes, but whenever I try and add my feature rest endpoints to where theirs are it doesn't work. I have multiple feature services under my map server so does anybody know how to get to the one I want to. Normally you would do this

CCTVRoute = new esri.layers.ArcGISDynamicMapServiceLayer("http://maps101.gis.halff.com/ladon/rest/services/Lubbock/LubbockCCTVAssets/MapServer/", { visible: false });             CCTVRoute.setVisibleLayers([13]);             map.addLayer(CCTVRoute);


Everytime I try and add a set visible layer to the number to my rest end service it doesn't work.

Here is what I have so far

          var surveypnts = new esri.layers.ArcGISDynamicMapServiceLayer("http://maps101.gis.halff.com/ladon/rest/services/Lubbock/LubbockCCTVAssets/MapServer/", { id: "surveypnts" });                       legendLayers.push({ layer: surveypnts, title: 'Survey Points' });            var playa = new esri.layers.ArcGISDynamicMapServiceLayer("http://maps101.gis.halff.com/ladon/rest/services/Lubbock/LubbockCCTVAssets/MapServer/", { id: 'playa' });            legendLayers.push({ layer: playa, title: "Playa Lakes" });           dojo.connect(map, 'onLayersAddResult', function (results) {               var legend = new esri.dijit.Legend({                   map: map,                   layerInfos: legendLayers               }, "legendDiv");               legend.startup();           });

Outcomes