diff --git a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx index 35960c0c0dead..0f66713a1819d 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx @@ -55,7 +55,6 @@ export function TileMapVisualization(props: Props) { } }); }} - isSharable={false} /> ); } diff --git a/x-pack/plugins/maps/public/lens/passive_map.tsx b/x-pack/plugins/maps/public/lens/passive_map.tsx index 30a4b8013b8ab..53b3799b0480f 100644 --- a/x-pack/plugins/maps/public/lens/passive_map.tsx +++ b/x-pack/plugins/maps/public/lens/passive_map.tsx @@ -53,6 +53,7 @@ export function PassiveMap(props: Props) { type={MAP_SAVED_OBJECT_TYPE} getParentApi={() => ({ + hideFilterActions: true, getSerializedStateForChild: () => { const basemapLayerDescriptor = createBasemapLayerDescriptor(); const intialLayers = basemapLayerDescriptor ? [basemapLayerDescriptor] : []; @@ -66,7 +67,6 @@ export function PassiveMap(props: Props) { hidePanelTitles: true, viewMode: ViewMode.VIEW, isLayerTOCOpen: false, - hideFilterActions: true, mapSettings: { disableInteractive: false, hideToolbarOverlay: false, @@ -75,7 +75,6 @@ export function PassiveMap(props: Props) { initialLocation: INITIAL_LOCATION.AUTO_FIT_TO_BOUNDS, // this will startup based on data-extent autoFitToDataBounds: true, // this will auto-fit when there are changes to the filter and/or query }, - isSharable: false, }, references: [], }; diff --git a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx index 82628ca5ce3a5..e3f8038a51716 100644 --- a/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx +++ b/x-pack/plugins/maps/public/react_embeddable/map_react_embeddable.tsx @@ -42,7 +42,7 @@ import { initializeEditApi } from './initialize_edit_api'; import { extractReferences } from '../../common/migrations/references'; import { MapAttributes } from '../../common/content_management'; import { MapSettings } from '../../common/descriptor_types'; -import { isMapRendererApi } from './map_renderer/types'; +import { apiHidesFilterActions, isMapRendererApi } from './map_renderer/types'; export function getControlledBy(id: string) { return `mapEmbeddablePanel${id}`; @@ -236,7 +236,8 @@ export const mapEmbeddableFactory: ReactEmbeddableFactory< & HasSerializedChildState & + HidesFilterActions & PublishesUnifiedSearch & { getTooltipRenderer?: () => RenderToolTipContent; - hideFilterActions: boolean; }; export function isMapRendererApi(api: unknown): api is MapRendererApi { - return Boolean( - api && - apiIsOfType(api, MAP_RENDERER_TYPE) && - (api as MapRendererApi).hideFilterActions !== undefined - ); + return Boolean(api && apiIsOfType(api, MAP_RENDERER_TYPE) && apiHidesFilterActions(api)); +} + +export function apiHidesFilterActions(api: unknown): api is HidesFilterActions { + return Boolean(api && (api as HidesFilterActions).hideFilterActions !== undefined); }