Ticket #2 (closed task: fixed)

Opened 2 years ago

Last modified 1 year ago

Implement LegendPanel widget

Reported by: bartvde Assigned to: bartvde
Priority: major Milestone: 0.5
Component: GeoExt.LegendPanel Version:
Keywords: Cc: dwins
State: Commit

Description

I've started to work on a GeoExt.widgets.LegendPanel which will be a legend panel firstly aimed at WMS layers. There is still some work to be done though.

I'll attach a preliminary version now if anybody wants to have a peek at it.

Example usage:

{     
    title: 'Legend',
    autoScroll: true,
    xtype: 'gx_legend',
    map: map,
    ascending: false,
    labelCls: 'startwmc',
    bodyStyle: 'padding-top: 10px;',
    cls: 'popup-variant1',
    baseCls:'x-tab'
}

Attachments

LegendPanel.js (11.2 kB) - added by bartvde on 11/20/08 13:56:50.
LegendPanel widget (not in patch form yet)
legendpanel.patch (12.1 kB) - added by dwins on 04/13/09 22:31:36.
LegendPanel_new.js (13.6 kB) - added by bartvde on 04/16/09 17:20:23.
some bug fixes done in LegendPanel since original attachment
legendpanel.2.patch (55.6 kB) - added by dwins on 04/17/09 22:24:38.
legendpanel.3.patch (21.6 kB) - added by dwins on 04/22/09 22:25:31.
ticket2.patch (27.5 kB) - added by bartvde on 05/18/09 17:07:59.
changed static to dynamic, add support for changing legendURL property, more tests
ticket2.2.patch (27.9 kB) - added by bartvde on 05/19/09 15:39:33.
updated patch for displayInLayerSwitcher
ticket2.3.patch (26.6 kB) - added by bartvde on 05/19/09 20:58:40.
updated patch for different layer order management
2.patch (26.5 kB) - added by tschaub on 05/22/09 01:54:07.
legend panel

Change History

11/20/08 13:56:50 changed by bartvde

  • attachment LegendPanel.js added.

LegendPanel widget (not in patch form yet)

04/13/09 22:28:28 changed by dwins

I'm attaching a patch (for geoext, not for the .js file already attached here) based on the provided patch, but with a couple of changes:

  • moved from GeoExt.widgets.LegendPanel to GeoExt.LegendPanel
  • added support for customizing the configuration of the individual layer legend panels (via a new configuration option, childDefaults)
  • resolved some layout problems (ie, collapsible legendpanels would leave floating headers) by defining GeoExt.LegendPanel = Ext.extend(... rather than defining the constructor independently of the extend() call.

04/13/09 22:31:36 changed by dwins

  • attachment legendpanel.patch added.

04/16/09 17:20:23 changed by bartvde

  • attachment LegendPanel_new.js added.

some bug fixes done in LegendPanel since original attachment

04/16/09 17:32:55 changed by bartvde

I'll try and work on this in the next couple of days.

04/17/09 22:24:11 changed by dwins

  • cc set to dwins.

I'm updating the patch I attached earlier to include support for layer reordering.

04/17/09 22:24:38 changed by dwins

  • attachment legendpanel.2.patch added.

04/22/09 22:25:31 changed by dwins

  • attachment legendpanel.3.patch added.

04/22/09 22:26:57 changed by dwins

Attaching a further updated patch. this one:

  • includes tests and examples
  • pulls in changes from barts update (except for some that depend on mapready events, which don't seem to be in trunk yet. i haven't heard anything about these...)

04/23/09 07:41:23 changed by bartvde

Thanks David, sorry the mapready events were something temporary and it never made it to trunk. It was discussed on the ML. I'll have a look at your patch as soon as I find an hour.

05/08/09 20:45:46 changed by bartvde

  • owner set to bartvde.

05/15/09 16:13:42 changed by bartvde

  • state changed from Needs more work to Review.

The new patch depends on:

1) GeoExt.MapPanel.guess from ticket:22 2) ticket:65 3) ticket:66

Please review.

(follow-up: ↓ 11 ) 05/15/09 21:48:31 changed by tcoulter

Hey, do we know "static" is a Javascript reserved word? It doesn't mean anything to Javascript interpreters, though some editors seem to flag it as erroneous (Eclipse, for example). Should we change that variable?

More info here: http://javascript.about.com/library/blreserved.htm http://www.isi.edu/div3/helpdesk/html-dictionary/netscape/javascr/reserve.HTM http://www.javascripter.net/faq/reserved.htm

(follow-up: ↓ 10 ) 05/15/09 22:45:46 changed by tcoulter

Note: This appears to be dependent on #66.

(in reply to: ↑ 9 ) 05/16/09 10:25:34 changed by bartvde

Replying to tcoulter:

Note: This appears to be dependent on #66.

Yes and a part of #22 and #65 as well as I wrote 2 comments above.

(in reply to: ↑ 8 ) 05/16/09 10:26:31 changed by bartvde

Replying to tcoulter:

Hey, do we know "static" is a Javascript reserved word? It doesn't mean anything to Javascript interpreters, though some editors seem to flag it as erroneous (Eclipse, for example). Should we change that variable? More info here: http://javascript.about.com/library/blreserved.htm http://www.isi.edu/div3/helpdesk/html-dictionary/netscape/javascr/reserve.HTM http://www.javascripter.net/faq/reserved.htm

Makes sense to change it then for sure, thanks for the catch, how about dynamic with a default of true?

05/18/09 16:55:52 changed by tcoulter

"dynamic" sounds good to me.

05/18/09 17:07:59 changed by bartvde

  • attachment ticket2.patch added.

changed static to dynamic, add support for changing legendURL property, more tests

05/18/09 22:17:23 changed by tschaub

Please confirm that the new legend panel 1) reorders itself when layers are reordered on the map (as the old one did), and that 2) layers with displayInLayerSwitcher: false are *not* shown (at least by default).

I haven't looked closely, but a quick glance at the behavior of this panel in an old app shows these two changes.

Thanks for the work on this.

05/18/09 22:18:02 changed by tschaub

  • component changed from data to widgets.LegendPanel.

05/18/09 22:28:20 changed by tschaub

Ok, guessing this is #65. Apologies for not reading about dependencies.

05/19/09 08:15:54 changed by bartvde

Tim, you're right about displayInLayerSwitcher, I'll add that. Indeed, reordering depends on #65

05/19/09 15:39:33 changed by bartvde

  • attachment ticket2.2.patch added.

updated patch for displayInLayerSwitcher

05/19/09 18:02:43 changed by dwins

After applying the patches from #65 and #66, I am seeing some JavaScript errors in examples/legendpanel.html in FF3.0.10. I'll dig a bit more to see if I can characterize them.

05/19/09 18:34:32 changed by dwins

The problem was that I mis-applied the patch for #65 (I was applying manually since GNU patch had problems with the one provided). With properly applied patch, the legendpanel looks good to me.

05/19/09 19:00:53 changed by bartvde

  • state changed from Review to Needs more work.

05/19/09 20:58:40 changed by bartvde

  • attachment ticket2.3.patch added.

updated patch for different layer order management

05/19/09 20:58:57 changed by bartvde

  • state changed from Needs more work to Review.

05/22/09 01:54:07 changed by tschaub

  • attachment 2.patch added.

legend panel

05/22/09 01:57:36 changed by tschaub

This looks great Bart. Thanks for all the work.

What do you think about keeping the same "module" names as Ext for now? Instead of adding a GeoExt.legend module and only putting Image and WMS in there, all of LegendPanel, LegendImage, and LegendWMS could go in the GeoExt module. Alternatively, if we want to create a new module, I think the LegendPanel belongs in there as well.

I put up an alternative patch for #66. I'll look tomorrow with a clear head at the "order" change - not sure we actually need the update there.

05/25/09 08:43:14 changed by bartvde

  • state changed from Review to Commit.

Thanks Tim, your changes look good to me, thanks for the catches. Please commit.

05/26/09 00:04:21 changed by tschaub

Hey Bart. I meant to mark this commit for you - as it is largely your work. Thanks for putting it together. I'll commit in a couple days if you don't get to it, but I think you should take this.

05/26/09 07:27:59 changed by bartvde

Hey Tim, great I'll commit this tomorrow (today I am on the road).

05/26/09 19:11:07 changed by bartvde

  • status changed from new to closed.
  • resolution set to fixed.

(In [867]) add LegendPanel component with currently support for WMS layers r=tschaub thanks to dwins and tcoulter (closes #2)