[OpenLayers-Users] OPENLAYERS LayerChange

Eric Lemoine eric.lemoine at camptocamp.com
Thu Jun 10 07:47:15 EDT 2010


On Thu, Jun 10, 2010 at 1:40 PM, Rahn Hanno (rahn) <rahn at zhaw.ch> wrote:
> Hi,
>
> I try to make it, but it doesn't work. My layer looks like this:
>
> var zielrichtung = new OpenLayers.Layer.WMS("Zielrichtung",urlArray,
>
> {map:mapFile,layers:layerName,format:"image/png",EXCEPTIONS:"application/vnd.ogc.se_inimage"},
>                         {singleTile: true, ratio:1},
>                         "visibilitychanged": function() {
>                                         alert("visibility changed");
>                                  }
>                         );
>
> zielrichtung.setIsBaseLayer(false);
> map.addLayer(zielrichtung);
> zielrichtung.setVisibility(false);
>
> var sld_zRichtung = url_ziel+"indikator="+indikator1;
> zielrichtung.mergeNewParams({SLD:sld_zRichtung});
>
> But it doesn't work. But where is my mistake. I don't know what to do now.
> Please can somebody give me a tip?


Try this:

var zielrichtung = new OpenLayers.Layer.WMS("Zielrichtung",urlArray,

{map:mapFile,layers:layerName,format:"image/png",EXCEPTIONS:"application/vnd.ogc.se_inimage"},
                        {singleTile: true, ratio:1, eventListeners: {
                            "visibilitychanged": function() {
                                 alert("visibility changed");
                             }
                        }});



-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list