[Users] UrlLegend

bartvde at osgis.nl bartvde at osgis.nl
Thu May 6 13:48:02 CEST 2010


The sequence should not matter, an event will be fired and the legend
should update.

See also the legendpanel example:

layerRec0.set("legendURL", otherUrl)

the legend image changes in this case.

Otherwise, please show us a minimal example which we can use to reproduce.

Best regards,
Bart

> hi, thks for reply,
>
> I've already the param preferredTypes: ['gx_urllegend'], but it's not the
> point i think... because when the legendPanel creates the layerLegend, the
> layerRecord "legendURL" haven't been set yet.. so, the only type it finds
> on creation is gx_wmslegend
>
> i need to specify it's an URL legend BEFORE the legendPanel have been
> triggered to create and add the new LegendLayer
>
>
>> Hi,
>>
>> you need to set preferredTypes on the LegendPanel, make it an array of
>> "gx_urllegend" IIRC.
>>
>> Best regards,
>> Bart
>>
>>> Hi,
>>>
>>> i would like to use URL to set my layers legend, instead of WMSLegend.
>>> The
>>> point is that i add my layers after the legendPanel is rendered
>>> (because
>>> the user can choose to add some layers).
>>>
>>> As i understood, i have to
>>>
>>> 1. add my layer to the Map (this triggers to add a record to the
>>> GeoExt.mapPanel.layers and this trigger to add its legend to the
>>> legendPanel as WMSLegend type)
>>>
>>> 2. get the new layer record (mapPanel.layers.getAt(idx))
>>>
>>> 3. set lengURL param to the record..
>>>
>>> so when i specify i want an URL legend it's too late, it have already
>>> been
>>> aded to the legendPanel as the wrong type..
>>>
>>> so how could I specify that i want a url legend for my layers before
>>> all
>>> geoext events have been triggerd
>>>
>>> thks for help
>>>
>>> flo
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at geoext.org
>>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>>
>>
>>
>>
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>




More information about the Users mailing list