Hello,
I need to saw an alert when user active a wms layer when a specific baseLayer
is active. With the following code I get twice, but I don't undestand why.
ct1m.events.register("visibilitychanged",this,function(event){
alert("vis: "+ct1m.getVisibility());
var capaBase = this.map.baseLayer.params.LAYERS;
if(capaBase == "orto"){
ct1m.events.unregister("visibilitychanged",this,function(event){alert("hello");});
ct1m.setVisibility(false);
alert("Layer not available");
}else{
ct1m.events.register("moveend", this, function(event){
var res = this.map.getResolution();
if(res == 0.25) ct1m.setOpacity(1);
else ct1m.setOpacity(0.7);
});
}
});
The sequence is, Vis: true -> Vis: false -> Layer not available -> Layer not
available
Any idea?
Thank's in advance.
Antoni Vidal
Unitat d'Aplicacions SIG-WEB
Institut Cartogràfic de Catalunya
<http://mercuri.icc.cat/website/mob_nf/mob1/mob2/inici2.htm?CONSULTA=Institut%20Cartogr%25E0fic%20de%20Catalunya&XYADDRESS=429486:4580392>
Parc de Montjuïc, E-08038 Barcelona
Tel. (+34) 93 567 15 00 (ext. 3228)
www.icc.cat <http://www.icc.cat/>
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users