Opened 7 years ago

Closed 7 years ago

#311 closed enhancement (invalid)

Define align method if layer contains layer group

Reported by: igrcic Owned by:
Priority: minor Milestone: 1.1
Component: GeoExt.WMSLegend Version: trunk
Keywords: Cc:
State: Needs more work

Description

Following examples/legendpanel.html one can see that its possible to make legend for the layers group that contain several layers.

Elements get stacked horizontally next to each other. That looks ok if we have only one class (rule) per layer, but if we have several then layer legend get little bit messy.

Here is example, just add one more layer in Cities and Roads layer inside legendpanel.js example. The result is in attachment.

It would be good to make option to let user define align method - vertical/horizontal.

Attachments (3)

wms_layergroup_legend.jpg (25.4 KB) - added by igrcic 7 years ago.
By defaut icons get stacked horizontaly inside component
wmslegend_align.patch (1.1 KB) - added by igrcic 7 years ago.
Initial patch, still I have to define param name [values]
aligned_vertical.jpg (12.1 KB) - added by igrcic 7 years ago.
One column table - vertical aligned

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by igrcic

By defaut icons get stacked horizontaly inside component

Changed 7 years ago by igrcic

Initial patch, still I have to define param name [values]

comment:1 Changed 7 years ago by igrcic

  • State changed from Review to Needs more work

Changed 7 years ago by igrcic

One column table - vertical aligned

comment:2 Changed 7 years ago by igrcic

Initial patch is inserting another panel component (if layer contains several layers) with table layout so its compatible with ext2.x

Do you maybe have suggestions how the config parameter [and values] should be called? maybe : alignment [vertical, horizontal]

comment:3 Changed 7 years ago by ahocevar

  • Milestone changed from 1.0 to 1.1

I think this can be solved with css, without any javascript code. Anyway, nothing to review - bumping.

comment:4 Changed 7 years ago by bartvde

  • Resolution set to invalid
  • Status changed from new to closed

Indeed, this can be done using css. I did need to give my legend component an id to make a "proper" css rule:

#legend img {
  display: block;
}
Note: See TracTickets for help on using tickets.