[OpenLayers-Users] Adding Legends in OpenLayers
Rahn Hanno (rahn)
rahn at zhaw.ch
Mon Dec 7 04:41:20 EST 2009
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
hanno.rahn at zhaw.ch
________________________________
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im Auftrag von Tommy Niittula
Gesendet: Montag, 7. Dezember 2009 09:45
An: users at openlayers.org
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091207/57b9a642/attachment.html
More information about the Users
mailing list