diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker/tile_status_tracker.test.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker/tile_status_tracker.test.tsx index 8bfe29203c9e1..0d603d2480c17 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker/tile_status_tracker.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker/tile_status_tracker.test.tsx @@ -276,7 +276,7 @@ describe('TileStatusTracker', () => { await sleep(300); expect(tileErrorsMap.get('layer1')?.length).toBe(1); - + const geojsonLayer1 = createMockLayer('layer1', 'layer1Source'); geojsonLayer1.getSource = () => { return { @@ -285,9 +285,9 @@ describe('TileStatusTracker', () => { }, isMvt() { return false; - } + }, }; - } + }; wrapper.setProps({ layerList: [geojsonLayer1] }); // simulate delay. Cache-checking is debounced. diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker/tile_status_tracker.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker/tile_status_tracker.tsx index 1828a42f36d50..beb1a1cd4409c 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker/tile_status_tracker.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tile_status_tracker/tile_status_tracker.tsx @@ -63,11 +63,13 @@ export class TileStatusTracker extends Component { } componentDidUpdate() { - this.props.layerList.forEach(layer => { + this.props.layerList.forEach((layer) => { const source = layer.getSource(); - if (source.isESSource() && + if ( + source.isESSource() && typeof (source as IVectorSource).isMvt === 'function' && - !(source as IVectorSource).isMvt()) { + !(source as IVectorSource).isMvt() + ) { // clear tile cache when layer is not tiled this._tileErrorCache.clearLayer(layer.getId(), this._updateTileStatusForAllLayers); }