That's it. Thank you very much for your help.
Greetings Hanno ------------------------------------------ Hanno Rahn, Dipl.-Ing. (FH) Geoinformatik ZHAW Zürcher Hochschule für Angewandte Wissenschaften Umwelt und Natürliche Ressourcen Fachstelle Geoinformatik Grüental, Postfach CH-8820 Wädenswil Tel +41 (0)58 934 5592 Fax +41 (0)58 934 5580 hanno.r...@zhaw.ch www.iunr.zhaw.ch/geoinformatik -----Ursprüngliche Nachricht----- Von: Eric Lemoine [mailto:eric.lemo...@camptocamp.com] Gesendet: Donnerstag, 10. Juni 2010 14:12 An: Rahn Hanno (rahn) Cc: users@openlayers.org Betreff: Re: [OpenLayers-Users] OPENLAYERS LayerChange On Thu, Jun 10, 2010 at 2:04 PM, Rahn Hanno (rahn) <r...@zhaw.ch> wrote: > > Super, > > That works. And how can I register a changelayer listener on the map? I try > this: > > var options1 = { > maxExtent: new > OpenLayers.Bounds(662642.346412,152155.850000,726497.716088,206636.150 > 000), > maxResolution:'auto', > numZoomLevels: '9', > fractionalZoom: true, > scales: [500000, 250000, 200000, 125000, 100000, 75000, > 50000, 25000, 10000], > units: 'm', > projection: "EPSG:21781", > controls: [] > }; > > var map = new OpenLayers.Map('map',options1, > eventListeners: { > "changelayer": function(e) { > if(e.property === "visibility") { > alert("visibility changed (" + e.layer.name + > ")"); > } > } > } > ); > > It doesn't work. eventListeners must be set in the map options new OpenLayers.Map('map', { eventListeners: { "changelayer": function(e) { if(e.property === "visibility") { alert("visibility changed (" + e.layer.name + ")"); } } } }); -- 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.lemo...@camptocamp.com http://www.camptocamp.com _______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users