Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
nod_Grrrr, can't make a patch at work... crazy.
in
openlayers.js
line163
changeto
Might want to change that to
parseInt(a.weight, 10)
to be more explicit in the commit.Comment #2
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedThanks nod_, changed ln 163
from:
var x = a.weight, y = b.weight;
to:
var x = parseInt(a.weight, 10), y = parseInt(b.weight, 10);
Comment #3
nod_If it works, make a patch please :)
Comment #4
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedThere's the patch :)
Comment #5
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedComment #6
nod_Works for me too.
Comment #7
nod_et hop :)