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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nod_’s picture

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.

Kaloyan Petrov’s picture

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);

nod_’s picture

If it works, make a patch please :)

Kaloyan Petrov’s picture

There's the patch :)

Kaloyan Petrov’s picture

Status: Active » Needs review
nod_’s picture

Status: Needs review » Reviewed & tested by the community

Works for me too.

nod_’s picture

Status: Reviewed & tested by the community » Fixed

et hop :)

Status: Fixed » Closed (fixed)

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