Skip to content

Commit 1832b63

Browse files
prushforprushfor
authored andcommitted
Fix issue with zIndex ordering of TemplatedTileLayerGroup.
1 parent b872fba commit 1832b63

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

map-layer.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,17 @@
176176
this._setUpEvents();
177177
},
178178
_attachedToMap: function() {
179-
// set i to the index of this layer element in the set of layers
180-
var i = 0;
179+
// set i to the position of this layer element in the set of layers
180+
var i = 0, position = 1;
181181
for (var nodes = Polymer.dom(this).parentNode.children;i < nodes.length;i++) {
182-
if (Polymer.dom(this).parentNode.children[i] === this) {
183-
break;
182+
if (Polymer.dom(this).parentNode.children[i].nodeName === "LAYER-") {
183+
if (Polymer.dom(this).parentNode.children[i] === this) {
184+
break;
185+
}
186+
position++;
184187
}
185188
}
186-
L.setOptions(this._layer, {zIndex: i+1, opacity: window.getComputedStyle(this).opacity});
189+
L.setOptions(this._layer, {zIndex: position, opacity: window.getComputedStyle(this).opacity});
187190
// make sure the Leaflet layer has a reference to the map
188191
this._layer._map = Polymer.dom(this).parentNode._map;
189192
// notify the layer that it is attached to a map (layer._map)

0 commit comments

Comments
 (0)