diff --git a/src/plugins/region_map/public/choropleth_layer.js b/src/plugins/region_map/public/choropleth_layer.js index 14a91e189e0d5..62f4ffe9be677 100644 --- a/src/plugins/region_map/public/choropleth_layer.js +++ b/src/plugins/region_map/public/choropleth_layer.js @@ -286,7 +286,8 @@ CORS configuration of the server permits requests from the Kibana application on showAllData, meta, layerConfig, - serviceSettings + serviceSettings, + leaflet ) { const clonedLayer = new ChoroplethLayer( name, @@ -295,7 +296,8 @@ CORS configuration of the server permits requests from the Kibana application on showAllData, meta, layerConfig, - serviceSettings + serviceSettings, + leaflet ); clonedLayer.setJoinField(this._joinField); clonedLayer.setColorRamp(this._colorRamp); diff --git a/src/plugins/region_map/public/region_map_visualization.js b/src/plugins/region_map/public/region_map_visualization.js index 9b20a35630c86..ecb3541827cb3 100644 --- a/src/plugins/region_map/public/region_map_visualization.js +++ b/src/plugins/region_map/public/region_map_visualization.js @@ -170,27 +170,29 @@ export function createRegionMapVisualization({ } async _recreateChoroplethLayer(name, attribution, showAllData) { + const selectedLayer = await this._loadConfig(this._params.selectedLayer); this._kibanaMap.removeLayer(this._choroplethLayer); if (this._choroplethLayer) { this._choroplethLayer = this._choroplethLayer.cloneChoroplethLayerForNewData( name, attribution, - this._params.selectedLayer.format, + selectedLayer.format, showAllData, - this._params.selectedLayer.meta, - this._params.selectedLayer, - await getServiceSettings() + selectedLayer.meta, + selectedLayer, + await getServiceSettings(), + (await lazyLoadMapsLegacyModules()).L ); } else { const { ChoroplethLayer } = await import('./choropleth_layer'); this._choroplethLayer = new ChoroplethLayer( name, attribution, - this._params.selectedLayer.format, + selectedLayer.format, showAllData, - this._params.selectedLayer.meta, - this._params.selectedLayer, + selectedLayer.meta, + selectedLayer, await getServiceSettings(), (await lazyLoadMapsLegacyModules()).L );