There seems to be a bug in the ordering of overlay layers for the layer switcher. Only positive weights work as expected.

Weights in the order of -6, -5, -4, -3, -2, -1, 0, 0, 0
render like -1, -2, -3, -4, -5, -6, 0, 0, 0

Positive weights work as expected in the order of: 0, 0, 0, 1, 2, 3, 4, 5, 6.

Layers' order is correct when listing the layers for cluster or popup features. The order of layers for the block switcher is not right.

I've attached few images to demonstrate the above problem.

Comments

Grrrr, can't make a patch at work... crazy.

in openlayers.js line 163 change

var x = a.weight, y = b.weight;

to

var x = +a.weight, y = +b.weight;

Might want to change that to parseInt(a.weight, 10) to be more explicit in the commit.

Thanks nod_, changed ln 163
from:
var x = a.weight, y = b.weight;
to:
var x = parseInt(a.weight, 10), y = parseInt(b.weight, 10);

If it works, make a patch please :)

StatusFileSize
new447 bytes
PASSED: [[SimpleTest]]: [MySQL] 236 pass(es).
[ View ]

There's the patch :)

Status:Active» Needs review

Status:Needs review» Reviewed & tested by the community

Works for me too.

Status:Reviewed & tested by the community» Fixed

et hop :)

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.