[Users] map config option in Vector Legend example?

Eric Lemoine eric.lemoine at camptocamp.com
Thu Mar 25 08:19:26 CET 2010


On Thursday, March 25, 2010, Gary White <gary_white at verizon.net> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
> I’m confused.  vector-legend.js in the examples
> has the following code:
>
>
>
>     legendPanel = new GeoExt.LegendPanel({
>
>         map:
> mapPanel.map,
>
>         renderTo:
> "legend",
>
>         border: false
>
>     });
>
>
>
> Looking at the source for GeoExt.LegendPanel, I don’t
> see where the map option is being used.  It looks like the relevant info
> is being obtained either through the layerStore option or via the following
> snippet in the onRender function:
>
>
>
>
> if(!this.layerStore) {
>
>
> this.layerStore = GeoExt.MapPanel.guess().layers;
>
>         }

I guess you are right, providing the LegendPanel with the map instance
shouldn't be necessary.


> Can anyone explain why the map option is there?  Is
> that just a remnant from a previous revision etc. or am I missing something?
>
>
>
> Also—even more puzzling—I would have expected
> the vector legend example to demonstrate the new GeoExt.VectorLegend
> widget.  What’s up with that?

Don't you see vector legends in the example?

LegendPanel uses VectorLegend internally for vector layers.

Cheers,

-- 
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