Andreas,

Thanks for your response.I'll think about it.

 
 
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: da...@ikt.es                                web: www.ikt.es
··················································································

-----Mensaje original-----
De: Andreas Hocevar [mailto:ahoce...@opengeo.org] 
Enviado el: jueves, 25 de noviembre de 2010 11:10
Para: David Alda Fernandez de Lezea
CC: us...@openlayers.org
Asunto: Re: [OpenLayers-Users] Can I retrieve a legend image from a vector layer

Hi,

you would have to build a one legend entry for every rule in your layer's 
Style. You have to determine the geometry type, and use OpenLayers.Renderer 
subclasses (test browser compliance using each renderer's supported method) 
with a resolution of 1. You need a vector feature representing your geometry 
type (a polygon, a line, a point) that you render along with the name or title 
of the rule.

No need to dig into GeoExt sources a lot. It's all in

http://trac.geoext.org/browser/core/trunk/geoext/lib/GeoExt/widgets/FeatureRenderer.js

and

http://trac.geoext.org/browser/core/trunk/geoext/lib/GeoExt/widgets/VectorLegend.js

Regards,
Andreas.

On Nov 25, 2010, at 09:33 , David Alda Fernandez de Lezea wrote:

> Andreas,
> 
> Thanks for your response. I'm working with pure OpenLayers. Would you mind, 
> please, pointing me how to achieve this task. What OpenLayers Classes are be 
> involved?? I've been looking the example you posted, but I'm not sure if it 
> would be helpful. I want to avoid digging into GeoExt source code.
> 
> Regards.
> 
> 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: da...@ikt.es                                web: www.ikt.es
> ······································································
> ············
> 
> -----Mensaje original-----
> De: Andreas Hocevar [mailto:ahoce...@opengeo.org] Enviado el: jueves, 
> 25 de noviembre de 2010 9:21
> Para: David Alda Fernandez de Lezea
> CC: us...@openlayers.org
> Asunto: Re: [OpenLayers-Users] Can I retrieve a legend image from a 
> vector layer
> 
> On Nov 25, 2010, at 09:00 , David Alda Fernandez de Lezea wrote:
> 
>> Hi everyone,
>> 
>> My question is:
>> 
>> Can I get an image, like the one obtained using GetLegendGraphic request 
>> from a WMS layer, representing the Legend/Style of a OpenLayers.Vector 
>> layer??
>> 
>> In case it's possible, how?
> 
> With pure OpenLayers, you would have to do some coding yourself. In GeoExt, 
> we have the VectorLegend 
> (http://api.geoext.org/1.0/examples/vector-legend.html), which creates on 
> OpenLayers.Renderer instance per style rule.
> 
> Regards,
> Andreas.
> 
>> 
>> 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: da...@ikt.es                                web: www.ikt.es
>> ·····································································
>> · ············ _______________________________________________
>> Users mailing list
>> us...@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> 
> --
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
> 
> _______________________________________________
> Users mailing list
> us...@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

_______________________________________________
Users mailing list
us...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to