<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"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> 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"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><STRONG><EM> var untiled_layer = new OpenLayers.Layer.WMS.Untiled(<BR> "Overlay Layer", "</EM></STRONG><A href="http://localhost:8080/geoserver/wms"><STRONG><EM>http://localhost:8080/geoserver/wms</EM></STRONG></A><STRONG><EM>",<BR> {<BR> filter:'(<Filter><PropertyIsEqualTo><PropertyName>frequencyspec</PropertyName></EM></STRONG></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><STRONG><EM> <Literal>BG</Literal></PropertyIsEqualTo></Filter>)',<BR> srs: 'EPSG:4326',<BR> layers: 'topp:radio',<BR> transparent: 'true',<BR> format: 'image/png'<BR> },<BR> {isBaseLayer: false, maxExtent: bounds} <BR> );<BR>
untiled_bgCoverage.ratio=1;<BR> untiled_bgCoverage.setVisibility(true);<BR> 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"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><EM><STRONG> map.addControl(new OpenLayers.Control.LayerSwitcher());</STRONG></EM></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </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"> </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> map.events.register('layerswitched', map, function (e) {<BR> log(" ----------- Visibility Changed --------------- ");<BR> });</STRONG></EM></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </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> untiled_devices.events.register('visibilitychanged', untiled_devices, function (e) {<BR> log(" ----------- Visibility Changed --------------- ");<BR> });</STRONG></EM></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">But whenever I change the layers in 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"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> 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"> </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"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Christian López Espínola <penyaskito@gmail.com><BR>To: Ganesh Jothikumar <ganeshjothikumar@yahoo.com><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 <<A href="mailto:ganeshjothikumar@yahoo.com" ymailto="mailto:ganeshjothikumar@yahoo.com">ganeshjothikumar@yahoo.com</A>> wrote:<BR>><BR>> Hi All<BR>><BR>> I am using OpenLayers to display mutiple base layers and multiple<BR>> overlays. Now I am using the Layer Switcher provided by
OL API<BR>> (map.addControl(new OpenLayers.Control.LayerSwitcher()))<BR>> Now I have a requirement wherin depending on the layer selection in the<BR>> Layer Switcher I have to filter the data. Is there a way wherin I can have a<BR>> event listener for a Layer Switcher i.e. whenever someone changes the<BR>> selection in the switcher a Java Script function needs to be called. And<BR>> also I should be able to get teh list of selected layers in the switcher<BR>> inside the function. Please let me know any way to do this. Any example<BR>> would be vey helpful..<BR>><BR>> Thanks in advance<BR>> ganesh<BR>> ________________________________<BR>> Unlimited freedom, unlimited storage. Get it now<BR>> _______________________________________________<BR>> Dev mailing list<BR>> <A href="mailto:Dev@openlayers.org" ymailto="mailto:Dev@openlayers.org">Dev@openlayers.org</A><BR>> <A
href="http://openlayers.org/mailman/listinfo/dev" target=_blank>http://openlayers.org/mailman/listinfo/dev</A><BR>><BR>><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>