Select to view content in your preferred language

If once remove the layer from dynamic service layer how can i add it again

598
1
12-07-2010 10:59 PM
srinivasreddy
Deactivated User
Actually i am trying to create toc control to my application. If once i unchecked the layer in the datagrid by using the following code it is hiding from the map..

myserviceid.visiblelayers.deleteitemat(layerinfo.id);

but if i use the following code it is not visible again..........

var lyr:layer=layerinfos[1] as layerinfo;
myserviceid.visiblelayers.additemat(layer,index)

what are the necesary changes i need here.....

thanks......
Tags (2)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus
Srinivas,

   You are trying to add a layer object to the visibleLayers arraycollection when you should only be trying to add the layers id

myserviceid.visiblelayers.additemat(lyr.id,index)
0 Kudos