You must get layers object ids on server side, something like:<br><br>           string strLID= mgMap.GetLayers().GetItem(&quot;<b>LAYER NAME</b>&quot;).GetObjectId()<br><br>they depend on mapguide session.<br><br>the use these object ids as params to OpenLayers&#39;layer params showLayers,hideLayers.<br>

<br>For example<br><br>visible laye obj id:  &quot;LVID1&quot;<br><br>invisible layers id: &quot;LVID2&quot;,&quot;LVID3&quot;<br><br>OpenLayers layer var: var myLayer;<br><br>myLayer.params.showLayers = &quot;LVID1&quot;;<br>

myLauer.params.hideLayers = &quot;LVID2,LVID3&quot;; //comma separated values<br>myLauer.redraw(true);<br><br><br>Regard,<br><br>Pietro Ianniello<br><br><div class="gmail_quote">On Fri, Feb 26, 2010 at 12:00 PM, durrrr <span dir="ltr">&lt;<a href="mailto:paul.nicholson@capita.co.uk">paul.nicholson@capita.co.uk</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
Hi,<br>
<br>
I am using OpenLayers as my front end to a MapGuide OS map. I have created a<br>
map using maestro which consists of 5 different layers and this map is<br>
rendered in OpenLayers as 1 image (The Base Layer).<br>
I have queried the MGOS API and have brought back a list of all of the<br>
layers that make up the base layer, and now i want to be able to switch<br>
individual layers off. I have tried this using the SetVisible() method but<br>
this doesnt seem to work. In the firebug console it says the layer is<br>
visible:false but it still shows on the map... I am using php to query the<br>
api and javascript\ajax on the layerswitcher and to refresh the map.<br>
If anyone has any suggestions i would appreciate there help.<br>
<br>
Thank You<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://n2.nabble.com/Using-Mapguide-OS-with-OpenLayers-Setting-Layer-Visibility-tp4638383p4638383.html" target="_blank">http://n2.nabble.com/Using-Mapguide-OS-with-OpenLayers-Setting-Layer-Visibility-tp4638383p4638383.html</a><br>


Sent from the MapGuide Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
mapguide-users mailing list<br>
<a href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapguide-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a><br>
</font></blockquote></div><br><br clear="all"><br>