From 4cbc5b7a9b7648b4ba69f613ff2386f9d6ebf74c Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Wed, 1 Jan 2020 19:16:29 +0300 Subject: [PATCH] [Vega] Sample [Flights] Airport Connections (Hover Over Airport) visualization not working (#53799) (#53857) Closes: #53748 Co-authored-by: Elastic Machine Co-authored-by: Elastic Machine --- src/legacy/core_plugins/tile_map/index.ts | 9 ++++++++- src/legacy/core_plugins/vis_type_vega/index.ts | 12 +++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/legacy/core_plugins/tile_map/index.ts b/src/legacy/core_plugins/tile_map/index.ts index 298675e75b0d7b..27f019318a82b4 100644 --- a/src/legacy/core_plugins/tile_map/index.ts +++ b/src/legacy/core_plugins/tile_map/index.ts @@ -30,7 +30,14 @@ const tileMapPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPlu uiExports: { styleSheetPaths: resolve(__dirname, 'public/index.scss'), hacks: [resolve(__dirname, 'public/legacy')], - injectDefaultVars: server => ({}), + injectDefaultVars: server => { + const serverConfig = server.config(); + const mapConfig: Record = serverConfig.get('map'); + + return { + emsTileLayerId: mapConfig.emsTileLayerId, + }; + }, }, config(Joi: any) { return Joi.object({ diff --git a/src/legacy/core_plugins/vis_type_vega/index.ts b/src/legacy/core_plugins/vis_type_vega/index.ts index 153cd6afb3ccc2..52c253c6ac0b52 100644 --- a/src/legacy/core_plugins/vis_type_vega/index.ts +++ b/src/legacy/core_plugins/vis_type_vega/index.ts @@ -33,9 +33,15 @@ const vegaPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPlugin uiExports: { styleSheetPaths: resolve(__dirname, 'public/index.scss'), hacks: [resolve(__dirname, 'public/legacy')], - injectDefaultVars: server => ({ - enableExternalUrls: server.config().get('vega.enableExternalUrls'), - }), + injectDefaultVars: server => { + const serverConfig = server.config(); + const mapConfig: Record = serverConfig.get('map'); + + return { + emsTileLayerId: mapConfig.emsTileLayerId, + enableExternalUrls: serverConfig.get('vega.enableExternalUrls'), + }; + }, }, init: (server: Legacy.Server) => ({}), config(Joi: any) {