diff --git a/src/plugins/maps_legacy/public/map/base_maps_visualization.js b/src/plugins/maps_legacy/public/map/base_maps_visualization.js index b639fdf9bb7f..902654ed7bd9 100644 --- a/src/plugins/maps_legacy/public/map/base_maps_visualization.js +++ b/src/plugins/maps_legacy/public/map/base_maps_visualization.js @@ -205,12 +205,13 @@ export function BaseMapsVisualizationProvider() { isDarkMode ); const showZoomMessage = serviceSettings.shouldShowZoomMessage(tmsLayer); + const showRegionBlockedWarning = serviceSettings.shouldShowRegionBlockedWarning(); const options = { ...tmsLayer }; delete options.id; delete options.subdomains; this._opensearchDashboardsMap.setBaseLayer({ baseLayerType: 'tms', - options: { ...options, showZoomMessage, ...meta }, + options: { ...options, showZoomMessage, showRegionBlockedWarning, ...meta }, }); } diff --git a/src/plugins/maps_legacy/public/map/service_settings.js b/src/plugins/maps_legacy/public/map/service_settings.js index 8aed2287632d..7d5bc2f17217 100644 --- a/src/plugins/maps_legacy/public/map/service_settings.js +++ b/src/plugins/maps_legacy/public/map/service_settings.js @@ -58,6 +58,7 @@ export class ServiceSettings { this._hasTmsConfigured = typeof tilemapsConfig.url === 'string' && tilemapsConfig.url !== ''; this._showZoomMessage = true; + this._showRegionBlockedWarning = this._mapConfig.showRegionBlockedWarning; this._emsClient = null; this._opensearchMapsClient = new OpenSearchMapsClient({ language: i18n.getLocale(), @@ -88,6 +89,10 @@ export class ServiceSettings { }); } + shouldShowRegionBlockedWarning() { + return this._showRegionBlockedWarning; + } + shouldShowZoomMessage({ origin }) { return origin === ORIGIN.EMS && this._showZoomMessage; } diff --git a/src/plugins/vis_type_vega/public/services.ts b/src/plugins/vis_type_vega/public/services.ts index ab6cae0024b0..a8c9079372c3 100644 --- a/src/plugins/vis_type_vega/public/services.ts +++ b/src/plugins/vis_type_vega/public/services.ts @@ -57,3 +57,4 @@ export const [getMapsLegacyConfig, setMapsLegacyConfig] = createGetterSetter getInjectedVars().enableExternalUrls; export const getEmsTileLayerId = () => getMapsLegacyConfig().emsTileLayerId; +export const getShowRegionBlockedWarning = () => getMapsLegacyConfig().showRegionBlockedWarning; diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view.js b/src/plugins/vis_type_vega/public/vega_view/vega_map_view.js index 2a604f8d834f..2e39f1d3a47b 100644 --- a/src/plugins/vis_type_vega/public/vega_view/vega_map_view.js +++ b/src/plugins/vis_type_vega/public/vega_view/vega_map_view.js @@ -32,7 +32,7 @@ import { i18n } from '@osd/i18n'; import { vega } from '../lib/vega'; import { VegaBaseView } from './vega_base_view'; import { VegaMapLayer } from './vega_map_layer'; -import { getEmsTileLayerId, getUISettings } from '../services'; +import { getEmsTileLayerId, getShowRegionBlockedWarning, getUISettings } from '../services'; import { lazyLoadMapsLegacyModules } from '../../../maps_legacy/public'; export class VegaMapView extends VegaBaseView { @@ -58,7 +58,7 @@ export class VegaMapView extends VegaBaseView { baseMapOpts = { ...baseMapOpts, ...(await this._serviceSettings.getAttributesForTMSLayer(baseMapOpts, true, isDarkMode)), - showRegionBlockedWarning: this._serviceSettings._mapConfig.showRegionBlockedWarning, + showRegionBlockedWarning: getShowRegionBlockedWarning(), }; if (!baseMapOpts) { this.onWarn(