Skip to content

Commit

Permalink
[Maps] Fix layer-flash when changing style (elastic#80948)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Oct 19, 2020
1 parent 1a3eb3b commit ff6ef38
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ export class TiledVectorLayer extends VectorLayer {
const layerIds = this.getMbLayerIds();
for (let i = 0; i < layerIds.length; i++) {
const mbLayer = mbMap.getLayer(layerIds[i]);
if (mbLayer && mbLayer['source-layer'] !== tiledSourceMeta.layerName) {
// The mapbox type in the spec is specified with `source-layer`
// but the programmable JS-object uses camelcase `sourceLayer`
// @ts-expect-error
if (mbLayer && mbLayer.sourceLayer !== tiledSourceMeta.layerName) {
// If the source-pointer of one of the layers is stale, they will all be stale.
// In this case, all the mb-layers need to be removed and re-added.
return true;
Expand Down

0 comments on commit ff6ef38

Please sign in to comment.