Skip to content

Commit

Permalink
Update serializedLayers when adding/removing layers
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley committed Feb 26, 2020
1 parent 2966ae4 commit 53d1533
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/style/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ class Style extends Evented {
this._layerOrderChanged = true;

this._layers[id] = layer;
this._serializedLayers[layer.id] = layer.serialize();

if (this._removedLayers[id] && layer.source && layer.type !== 'custom') {
// If, in the current batch, we have already removed this layer
Expand Down Expand Up @@ -759,7 +760,7 @@ class Style extends Evented {
this._changed = true;
this._removedLayers[id] = layer;
delete this._layers[id];
delete this._serializeLayers[id];
delete this._serializedLayers[id];
delete this._updatedLayers[id];
delete this._updatedPaintProps[id];

Expand Down

0 comments on commit 53d1533

Please sign in to comment.