Skip to content

Commit

Permalink
Only serialized non-custom layers
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley committed Feb 26, 2020
1 parent 53d1533 commit 91f5c0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/style/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ class Style extends Evented {
this._validateLayer(layer);

layer.setEventedParent(this, {layer: {id}});
this._serializedLayers[layer.id] = layer.serialize();
}

const index = before ? this._order.indexOf(before) : this._order.length;
Expand All @@ -675,7 +676,6 @@ 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

0 comments on commit 91f5c0e

Please sign in to comment.