@@ -94,12 +94,17 @@ L.Control.SplitMap = L.Control.extend({
9494 if ( ! this . _map ) {
9595 return this
9696 }
97- if ( this . _leftLayer ) {
97+ if ( this . _leftLayer && this . _leftLayer . getContainer ) {
9898 this . _leftLayer . getContainer ( ) . style . clip = ""
99- }
100- if ( this . _rightLayer ) {
99+ } else {
100+ this . _leftLayer . getPane ( ) . style . clip = ""
101+ }
102+ if ( this . _rightLayer && this . _rightLayer . getContainer ) {
101103 this . _rightLayer . getContainer ( ) . style . clip = ""
102- }
104+ } else {
105+ this . _rightLayer . getPane ( ) . style . clip = ""
106+ }
107+
103108 this . _removeEvents ( )
104109 L . DomUtil . remove ( this . _container )
105110
@@ -131,13 +136,17 @@ L.Control.SplitMap = L.Control.extend({
131136 this . fire ( 'dividermove' , { x : dividerX } )
132137 var clipLeft = 'rect(' + [ nw . y , clipX , se . y , nw . x ] . join ( 'px,' ) + 'px)'
133138 var clipRight = 'rect(' + [ nw . y , se . x , se . y , clipX ] . join ( 'px,' ) + 'px)'
134- if ( this . _leftLayer ) {
139+ if ( this . _leftLayer && this . _leftLayer . getContainer ) {
135140 this . _leftLayer . getContainer ( ) . style . clip = clipLeft
136- }
137- if ( this . _rightLayer ) {
141+ } else {
142+ this . _leftLayer . getPane ( ) . style . clip = clipLeft
143+ }
144+ if ( this . _rightLayer && this . _rightLayer . getContainer ) {
138145 this . _rightLayer . getContainer ( ) . style . clip = clipRight
139- }
140- } ,
146+ } else {
147+ this . _rightLayer . getPane ( ) . style . clip = clipRight
148+ }
149+ } ,
141150
142151 _updateLayers : function ( ) {
143152 if ( ! this . _map ) {
0 commit comments