hello,
I made it like this.
First I define a function:
function toggleMe(a){
var e=document.getElementById(a);
if(!e)return true;
if(e.style.display=="none"){
e.style.display="block"
} else {
e.style.display="none"
}
return true;
}
Then you must create a div object where you would show the legend image. This
div you can show or hide with tho onclick event. For example like this:
<div onclick="toggleMe('legend'); return false; " id="legend"><img
src="..."></img></div>
You can use the function with every object and the object id.
Hope it will help you.
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
[email protected]
________________________________
Von: [email protected] [mailto:[email protected]] Im
Auftrag von Tommy Niittula
Gesendet: Montag, 7. Dezember 2009 09:45
An: [email protected]
Betreff: [OpenLayers-Users] Adding Legends in OpenLayers
Hi,
I have legends for different WMS-layers as images, and I would like to show
(and hide) the legend images like the LayerSwitcher or Minimap. Is that
possible and if so how do I start implementing this?
/Tommy
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users