Skip to content

Commit db14725

Browse files
[Maps] Fix layer-flash when changing style (#80948)
1 parent 2f01a09 commit db14725

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ export class TiledVectorLayer extends VectorLayer {
182182
const layerIds = this.getMbLayerIds();
183183
for (let i = 0; i < layerIds.length; i++) {
184184
const mbLayer = mbMap.getLayer(layerIds[i]);
185-
if (mbLayer && mbLayer['source-layer'] !== tiledSourceMeta.layerName) {
185+
// The mapbox type in the spec is specified with `source-layer`
186+
// but the programmable JS-object uses camelcase `sourceLayer`
187+
// @ts-expect-error
188+
if (mbLayer && mbLayer.sourceLayer !== tiledSourceMeta.layerName) {
186189
// If the source-pointer of one of the layers is stale, they will all be stale.
187190
// In this case, all the mb-layers need to be removed and re-added.
188191
return true;

0 commit comments

Comments
 (0)