File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 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)
You can’t perform that action at this time.
0 commit comments