Skip to content

Commit 82fbdcd

Browse files
committed
Reorder layer in updateImage to match what updateLayer would do
1 parent 0d1db3f commit 82fbdcd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/plots/mapbox/layers.js

+8
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ proto.updateImage = function(opts) {
9494
map.getSource(this.idSource).updateImage({
9595
url: opts.source, coordinates: opts.coordinates
9696
});
97+
98+
// Since the `updateImage` control flow doesn't call updateLayer,
99+
// We need to take care of moving the image layer to match the location
100+
// where updateLayer would have placed it.
101+
var _below = this.findFollowingMapboxLayerId(this.lookupBelow());
102+
if(_below !== null) {
103+
this.subplot.map.moveLayer(this.idLayer, _below);
104+
}
97105
};
98106

99107
proto.updateSource = function(opts) {

0 commit comments

Comments
 (0)