Skip to content

Commit 1b4c082

Browse files
authored
Merge pull request #1 from VasavanThiru/add_layer_to_splitmap
changes for Splitmap takes Layer
2 parents e185d99 + 165c6d2 commit 1b4c082

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/index.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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.getContainer) {
9898
this._leftLayer.getContainer().style.clip = ""
99+
} else {
100+
this._leftLayer.getPane().style.clip = ""
99101
}
100-
if (this._rightLayer) {
102+
if (this._rightLayer.getContainer) {
101103
this._rightLayer.getContainer().style.clip = ""
104+
} else {
105+
this._rightLayer.getPane().style.clip = ""
102106
}
107+
103108
this._removeEvents()
104109
L.DomUtil.remove(this._container)
105110

@@ -131,11 +136,15 @@ 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.getContainer) {
135140
this._leftLayer.getContainer().style.clip = clipLeft
141+
} else {
142+
this._leftLayer.getPane().style.clip = clipLeft
136143
}
137-
if (this._rightLayer) {
144+
if (this._rightLayer.getContainer) {
138145
this._rightLayer.getContainer().style.clip = clipRight
146+
} else {
147+
this._rightLayer.getPane().style.clip = clipRight
139148
}
140149
},
141150

0 commit comments

Comments
 (0)