<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=ltr><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<STYLE title=owaParaStyle>P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>

<META name=GENERATOR content="MSHTML 8.00.6001.18812"></HEAD>
<BODY ocsi="x">
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=698283409-07122009>hello,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=698283409-07122009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=698283409-07122009>I made it like this.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=698283409-07122009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=698283409-07122009>First I define a function:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=698283409-07122009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=698283409-07122009>function toggleMe(a){<BR>&nbsp; var 
e=document.getElementById(a);<BR>&nbsp; <BR>&nbsp; if(!e)return true;<BR>&nbsp; 
if(e.style.display=="none"){<BR>&nbsp;&nbsp;&nbsp; 
e.style.display="block"<BR>&nbsp; } else {<BR>&nbsp;&nbsp;&nbsp; 
e.style.display="none"<BR>&nbsp; }<BR>&nbsp; return 
true;<BR>}</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=698283409-07122009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=698283409-07122009>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.&nbsp;For 
example like this:</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2 face=Arial>&lt;div on<SPAN 
class=698283409-07122009>click</SPAN>="<SPAN 
class=698283409-07122009>toggleMe('legend'); return false; </SPAN>" id="<SPAN 
class=698283409-07122009>legend</SPAN>"&gt;<SPAN 
class=698283409-07122009>&lt;img 
src="..."&gt;&lt;/img&gt;</SPAN>&lt;/div&gt;</FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><SPAN class=698283409-07122009><FONT color=#0000ff size=2 face=Arial>You 
can use the function with every object and the object id.</FONT></SPAN></DIV>
<DIV><SPAN class=698283409-07122009><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698283409-07122009><FONT color=#0000ff size=2 face=Arial>Hope 
it will help you.</FONT></SPAN></DIV>
<DIV><SPAN class=698283409-07122009><FONT color=#0000ff size=2 
face=Arial></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698283409-07122009><FONT color=#0000ff size=2 
face=Arial>Greetings</FONT></SPAN></DIV>
<DIV><SPAN class=698283409-07122009><FONT color=#0000ff size=2 
face=Arial>Hanno</FONT></SPAN></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV class=Section1>
<P style="mso-layout-grid-align: none" class=MsoNormal align=left><SPAN 
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">------------------------------------------<?xml:namespace 
prefix = o ns = "urn:schemas-microsoft-com:office:office" 
/><o:p></o:p></SPAN></P>
<P style="mso-layout-grid-align: none" class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">Hanno Rahn, Dipl.-Ing. (FH) 
Geoinformatik<o:p></o:p></SPAN></P>
<P style="mso-layout-grid-align: none" class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">ZHAW Zürcher Hochschule für 
Angewandte Wissenschaften Umwelt und Natürliche Ressourcen 
<o:p></o:p></SPAN></P>
<P style="mso-layout-grid-align: none" class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">Fachstelle Geoinformatik 
<o:p></o:p></SPAN></P>
<P style="mso-layout-grid-align: none" class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">Grüental, Postfach CH-8820 
Wädenswil <o:p></o:p></SPAN></P>
<P style="mso-layout-grid-align: none" class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">Tel +41 (0)58 934 
5592<o:p></o:p></SPAN></P>
<P style="mso-layout-grid-align: none" class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">Fax +41 (0)58 934 5580 
<o:p></o:p></SPAN></P>
<P style="mso-layout-grid-align: none" class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">hanno.rahn@zhaw.ch 
<o:p></o:p></SPAN></P>
<P style="mso-layout-grid-align: none" class=MsoNormal><SPAN 
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P></DIV>
<DIV>&nbsp;</DIV><BR>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> users-bounces@openlayers.org 
[mailto:users-bounces@openlayers.org] <B>Im Auftrag von </B>Tommy 
Niittula<BR><B>Gesendet:</B> Montag, 7. Dezember 2009 09:45<BR><B>An:</B> 
users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] Adding Legends in 
OpenLayers<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr><FONT color=#000000 size=2 face=Tahoma>Hi,</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=tahoma></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2 face=tahoma>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?</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=tahoma></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2 face=tahoma>/Tommy</FONT></DIV></BODY></HTML>