Skip to content

Commit 752c419

Browse files
committed
make layer type change go through a source refresh,
- staying safe as some type change lead to exceptions
1 parent cb854fe commit 752c419

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/plots/mapbox/layers.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,13 @@ proto.update = function update(opts) {
4848
proto.needsNewSource = function(opts) {
4949

5050
// for some reason changing layer to 'fill' or 'symbol'
51-
// w/o changing the source throws an exception in mapbox-gl 0.18
52-
53-
var changesToFill = (this.layerType !== 'fill' && opts.type === 'fill'),
54-
changesToSymbol = (this.layerType !== 'symbol' && opts.type === 'symbol');
51+
// w/o changing the source throws an exception in mapbox-gl 0.18 ;
52+
// stay safe and make new source on type changes
5553

5654
return (
5755
this.sourceType !== opts.sourcetype ||
5856
this.source !== opts.source ||
59-
changesToFill ||
60-
changesToSymbol
57+
this.layerType !== opts.type
6158
);
6259
};
6360

0 commit comments

Comments
 (0)