<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Hi</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp; Thanks for the link. I read through the ticket and feel that this answers my question. But what I could not figure out is how to use teh event listener. I have a layer like the below</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><STRONG><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var untiled_layer = new OpenLayers.Layer.WMS.Untiled(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Overlay Layer", "</EM></STRONG><A href="http://localhost:8080/geoserver/wms"><STRONG><EM>http://localhost:8080/geoserver/wms</EM></STRONG></A><STRONG><EM>",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filter:'(&lt;Filter&gt;&lt;PropertyIsEqualTo&gt;&lt;PropertyName&gt;frequencyspec&lt;/PropertyName&gt;</EM></STRONG></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><STRONG><EM>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Literal&gt;BG&lt;/Literal&gt;&lt;/PropertyIsEqualTo&gt;&lt;/Filter&gt;)',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;srs: 'EPSG:4326',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;layers: 'topp:radio',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;transparent: 'true',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;format: 'image/png'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {isBaseLayer: false, maxExtent: bounds} <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 untiled_bgCoverage.ratio=1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; untiled_bgCoverage.setVisibility(true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map.addLayer(untiled_bgCoverage);</EM></STRONG><BR><BR>And I add the layer switcher as below</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><EM><STRONG>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; map.addControl(new OpenLayers.Control.LayerSwitcher());</STRONG></EM></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Now I tried adding the event listener in two ways . But doesn't work</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">1)</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><EM><STRONG>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; map.events.register('layerswitched', map, function (e) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log(" ----------- Visibility Changed --------------- ");<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; });</STRONG></EM></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">2)</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><EM><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; untiled_devices.events.register('visibilitychanged', untiled_devices, function (e) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log(" ----------- Visibility Changed --------------- ");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });</STRONG></EM></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">But whenever I change the layers in&nbsp;the Layer Switcher teh log is not getting printed. Am I doing it the right way. If not please let me know the way with a few lines of code. Also I need to get the selected layers in the switcher from inside the listener.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Lastly how do I apply the patch. How do I merge it with the existing OpenLayers.js in my machine. Is it enough if I downlod the latest from openlayers.org. It will be very helpful if someone guides me with this issue</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Thanks in advance</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">ganesh</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Christian López Espínola &lt;penyaskito@gmail.com&gt;<BR>To: Ganesh Jothikumar &lt;ganeshjothikumar@yahoo.com&gt;<BR>Cc: dev@openlayers.org<BR>Sent: Monday, 26 November, 2007 7:36:15 PM<BR>Subject: Re: [OpenLayers-Dev] OL LayerSwitcher Listener<BR><BR>Hi Ganesh,<BR><BR>I found this ticket with a patch attached, maybe it can help you.<BR><BR><A href="http://trac.openlayers.org/ticket/878" target=_blank>http://trac.openlayers.org/ticket/878</A><BR><BR>Hope this helps.<BR><BR>On 11/26/07, Ganesh Jothikumar &lt;<A href="mailto:ganeshjothikumar@yahoo.com" ymailto="mailto:ganeshjothikumar@yahoo.com">ganeshjothikumar@yahoo.com</A>&gt; wrote:<BR>&gt;<BR>&gt; Hi All<BR>&gt;<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I am using OpenLayers to display mutiple base layers and multiple<BR>&gt; overlays. Now I am using the Layer Switcher provided by
 OL API<BR>&gt; (map.addControl(new OpenLayers.Control.LayerSwitcher()))<BR>&gt; Now I have a requirement wherin depending on the layer selection in the<BR>&gt; Layer Switcher I have to filter the data. Is there a way wherin I can have a<BR>&gt; event listener for a Layer Switcher i.e. whenever someone changes the<BR>&gt; selection in the switcher a Java Script function needs to be called. And<BR>&gt; also I should be able to get teh list of selected layers in the switcher<BR>&gt; inside the function. Please let me know any way to do this. Any example<BR>&gt; would be vey helpful..<BR>&gt;<BR>&gt; Thanks in advance<BR>&gt; ganesh<BR>&gt;&nbsp; ________________________________<BR>&gt;&nbsp; Unlimited freedom, unlimited storage. Get it now<BR>&gt; _______________________________________________<BR>&gt; Dev mailing list<BR>&gt; <A href="mailto:Dev@openlayers.org" ymailto="mailto:Dev@openlayers.org">Dev@openlayers.org</A><BR>&gt; <A
 href="http://openlayers.org/mailman/listinfo/dev" target=_blank>http://openlayers.org/mailman/listinfo/dev</A><BR>&gt;<BR>&gt;<BR><BR><BR>-- <BR>Regards,<BR><BR>Christian López Espínola<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div><br>


      <!--10--><hr size=1></hr> Chat on a cool, new interface. No download required. <a href="http://in.rd.yahoo.com/tagline_webmessenger_10/*http://in.messenger.yahoo.com/webmessengerpromo.php">Click here.</a></body></html>