Opened 8 years ago

Closed 8 years ago

#226 closed defect (fixed)

WMSLegend does not split layer names using comma for array items

Reported by: bartvde Owned by: bartvde
Priority: major Milestone: 0.7
Component: GeoExt.WMSLegend Version: trunk
Keywords: Cc:
State: Commit

Description

When somebody uses an array type layers parameter, but the individual items have layers grouped together with comma's they are not split before doing the GetLegendGraphic request.

E.g.:

"LAYERS": ['l1,l2', 'l3,l4']

Reported by Paul James on users.

Attachments (2)

ticket226.patch (3.1 KB) - added by bartvde 8 years ago.
geoext-226.patch (3.2 KB) - added by ahocevar 8 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by bartvde

  • Owner set to bartvde
  • Status changed from new to assigned

Changed 8 years ago by bartvde

comment:2 Changed 8 years ago by bartvde

  • State changed from None to Review

Tests pass in FF 3.6 and IE6, please review.

Changed 8 years ago by ahocevar

comment:3 Changed 8 years ago by ahocevar

  • State changed from Review to Commit

@Bart: you missed one place where you could also have used the generateLayerNames method. But in the end, there is a much more elegant way to straighten out a hodge podge of array and list entries:

   var array = [stringOrArrayOrMixed].join(",").split(",");

My patch makes this change, and applies it everywhere where not doing it could become a problem (for layerNames and styleNames).

Tests pass in FF3.5. Please commit if you agree with my patch and after successfully running tests in IE.

comment:4 Changed 8 years ago by bartvde

Thanks Andreas, this is a lot more elegant indeed, I've confirmed tests pass in IE6.

comment:5 Changed 8 years ago by bartvde

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [1910]) WMSLegend does not split layer names using comma for array items, r=ahocevar (closes #226)

Note: See TracTickets for help on using tickets.