[Users] legend for OpenLayers.Layer.Image
Eric Lemoine
eric.lemoine at camptocamp.com
Thu Sep 23 20:44:58 CEST 2010
On Thu, Sep 23, 2010 at 6:37 PM, Charlton Galvarino <charlton at 2creek.com> wrote:
>> > If I tacked on a legendURL attr to an OpenLayers.Layer.Image, what would
>> it take to have that legend show up magically alongside WMS legends and
>> vector legends inside a GeoExt.LegendPanel?
>
>> I think you should be able to rely on UrlLegend. What you need is a
>> "legendUrl" data field in the layer record associated with your Image
>> layer.
>
> Sadly, something like this (if I am interpreting your suggestion correctly), doesn't magically make the legend appear:
>
> map.addLayer(new OpenLayers.Layer.Image(
> name
> ,urlLyr
> ,bounds
> ,size
> ,{isBaseLayer : false,opacity : 1,legendUrl : urlLeg}
> ));
>
This won't work. "legendUrl" must be set in the layer record, as
opposed to the layer. For further help please paste your code that
creates the map, layers, and the MapPanel.
--
Eric Lemoine
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
More information about the Users
mailing list