Dear Gregor,
Thanks for your great response. The below is my code to retrieve layer based on layer index and I am populating into checkboxes for (int i = 0; i < map.numlayers; i++) { layer = map.getLayer(i); cbLayer.Items.Add(layer.name); //checkbox if (layer.status == (int)mapscript.MS_ON) { cbLayer.Items[i].Selected = true; //check box } } Like that how can I populate layer names based on group into check box or treeview. Thanks Venkat. -----Original Message----- From: Gregor at HostGIS [mailto:gre...@hostgis.com] Sent: Friday, February 06, 2009 9:31 AM To: Venkat Rao Tammineni Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] How to get Layers By Group Venkat Rao Tammineni wrote: > How can I retrieve layers by Group Name. And how to loop these > layers based on group. Where I can able to switch on and swatch off the > layers based on Group. A group is just a "fake layer" with many layers. You request a group in the same way as you would a layer; the only change is that you use the group name and will get all the layers mixed together. Example: LAYER NAME "roads" GROUP "usamap" END LAYER NAME "lakes" GROUP "usamap" END LAYER NAME "cities" GROUP "usamap" END I would then request "layers=usamap" and magically get all three layers merged into one request. > I have Group property in my mapfile .but I don't > know how to get layers and populate some control As to generating a control, that's the same as with layers as well except that you would use getAllGroupNames() instead of getAllLayerNames() But that depends on your own programming style and goals. -- Gregor Mosheh / Greg Allensworth BS, A+, Network+, Security+, Server+ System Administrator, Lead Programmer HostGIS development & hosting services, http://www.HostGIS.com/ "Remember that no one cares if you can back up, only if you can restore." - AMANDA _______________________________________________ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users