[OpenLayers-Users] Is it possible to add a legend to the layer switcher

David Alda Fernandez de Lezea dalda at ikt.es
Mon Jan 25 07:10:15 EST 2010


 
Thanks for your response, 

It's what I was thinking, I've been looking the code too, and thought that there was property in which you could set that, but comparing that LayerSwitcher with the one a I have in my app, I realized that they were different. I'll study the code and see how it works.
 
 
Un saludo,
 
··················································································

David Alda Fernández de Lezea
Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad
 
IKT
Granja Modelo s/n · 01192 · Arkaute (Araba)

··················································································
Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
··················································································
email: dalda at ikt.es                                web: www.ikt.es
··················································································

-----Mensaje original-----
De: Marc Jansen [mailto:jansen at terrestris.de] 
Enviado el: lunes, 25 de enero de 2010 12:31
Para: David Alda Fernandez de Lezea
CC: openlayers users
Asunto: Re: [OpenLayers-Users] Is it possible to add a legend to the layer switcher

Hi David,

AFAIK you cannot embed a legend within the LayerSwitcher using OpenLayers without changing the LayerSwitcherControl itself. There is no API-method/variable to add legend images to the LayerSwitcher. Of course you can have a look at the source of the URL you provided:

In the file
http://www.microimages.com/ogc/newtntmap/openlayers/lib/OpenLayers.js
from line 12374 the changed LayerSwitcher-Control is defined. Looks as if they are reading a 'legendImg'-Property of a layer and add an <img>-Tag to the LayerSwitcher if that is set (line 12522).

Hope that helps.

Regards,
Marc



David Alda Fernandez de Lezea wrote:
> Hello,
>
> I would like to know how can I have the legend of my wms layers in the layer switcher. Just to show my idea I found an example: http://www.microimages.com/ogc/maps/nebraskaopen.htm .
>
> Thanks.
>  
>  
> Un saludo,
>  
> ······································································
> ············
>
> David Alda Fernández de Lezea
> Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y 
> Biodiversidad
>  
> IKT
> Granja Modelo s/n · 01192 · Arkaute (Araba)
>
> ··················································································
> Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
> ··················································································
> email: dalda at ikt.es                                web: www.ikt.es
> ······································································
> ············ _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>   


-- 


  Dipl.-Geogr. Marc Jansen
  - Anwendungsentwickler -

  terrestris GmbH & Co. KG
  Irmintrudisstraße 17
  53111 Bonn

  Tel:    ++49 (0)228 / 96 28 99 -53
  Fax:    ++49 (0)228 / 96 28 99 -57

  Email:  jansen at terrestris.de
  Web:    http://www.terrestris.de

  Amtsgericht Bonn, HRA 6835
  Komplementärin:  terrestris Verwaltungsgesellschaft mbH
  vertreten durch: Hinrich Paulsen, Till Adams  





More information about the Users mailing list