On Mon, Mar 31, 2008 at 11:45:09AM +1100, bradleyspencer wrote:
> List,
> 
> Has anyone got an example of how to setup and use the ‘layerswitched’ event
> listener?
> 
> I want to do something when a particular layer is turned on.

You probably want the layer's 'visibilitychanged' event, then.

layer.events.register("visibilitychanged", layer, function() {
  if (this.getVisibility()) {
    alert("layer is on!");
  }
});

Regards,
-- 
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to