diff --git a/public/components/map_container/map_container.tsx b/public/components/map_container/map_container.tsx index 98c7bd6d..944fda8d 100644 --- a/public/components/map_container/map_container.tsx +++ b/public/components/map_container/map_container.tsx @@ -241,8 +241,10 @@ export const MapContainer = ({ (indexPattern) => indexPattern.id === selectedLayerConfig.source.indexPatternId ); if (!findIndexPattern) { - // @ts-ignore - const newIndexPattern = await indexPatterns.get(selectedLayerConfig.source.indexPatternId); + const newIndexPattern = await services.data.indexPatterns.get( + // @ts-ignore + selectedLayerConfig.source.indexPatternId + ); const cloneLayersIndexPatterns = [...layersIndexPatterns, newIndexPattern]; setLayersIndexPatterns(cloneLayersIndexPatterns); }