<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body text="#000000" bgcolor="#ffffff">
On 07/22/2010 10:58 AM, M. Rizwan Khan wrote:
<blockquote
cite="mid:AANLkTinPuO_amcGARAVtfaa61tBYW_UzrM2ezz4msF8y@mail.gmail.com"
type="cite">Hi All,<br>
<br>
I am new bee to Openlayer. <br>
I have a simple problem, I want whenever someone checks a certain layer
to display, message is displayed to about that layer.<br>
I dont know how to do to so.........<br>
<br>
Thanks in advance,<br>
Rizwan<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@openlayers.org">Users@openlayers.org</a>
<a class="moz-txt-link-freetext" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a>
</pre>
</blockquote>
Register a listener for the "changelayer" event on the map I guess is
what you want.<br>
<br>
Something along the lines of<br>
<br>
map.events.register("changelayer", this, changelayer);<br>
<br>
function changelayer(evt){ <br>
if(evt.property == "visibility" &&
evt.layer.getVisibility()){<br>
console.log("layer " + evt.layer.name + " activated");<br>
}<br>
<br>
}<br>
<br>
<br>
hope this helps you along<br>
<br>
-atle<br>
<pre class="moz-signature" cols="72">--
Atle Frenvik Sveen
Utvikler
Geomatikk IKT AS
tlf: 45 27 86 89
<a class="moz-txt-link-abbreviated" href="mailto:atle.frenvik.sveen@geomatikk.no">atle.frenvik.sveen@geomatikk.no</a></pre>
</body>
</html>