@@ -28,6 +28,7 @@ import {
2828} from '../../../../../src/plugins/data/public' ;
2929import { GisMap } from '../connected_components/gis_map' ;
3030import { createMapStore , MapStore } from '../reducers/store' ;
31+ import { MapSettings } from '../reducers/map' ;
3132import {
3233 setGotoWithCenter ,
3334 replaceLayerList ,
@@ -40,6 +41,7 @@ import {
4041 hideLayerControl ,
4142 hideViewControl ,
4243 setHiddenLayers ,
44+ setMapSettings ,
4345} from '../actions/map_actions' ;
4446import { MapCenterAndZoom } from '../../common/descriptor_types' ;
4547import { setReadOnly , setIsLayerTOCOpen , setOpenTOCDetails } from '../actions/ui_actions' ;
@@ -60,6 +62,7 @@ interface MapEmbeddableConfig {
6062 editable : boolean ;
6163 title ?: string ;
6264 layerList : unknown [ ] ;
65+ settings ?: MapSettings ;
6366}
6467
6568export interface MapEmbeddableInput extends EmbeddableInput {
@@ -97,6 +100,7 @@ export class MapEmbeddable extends Embeddable<MapEmbeddableInput, MapEmbeddableO
97100 private _prevFilters ?: Filter [ ] ;
98101 private _domNode ?: HTMLElement ;
99102 private _unsubscribeFromStore ?: Unsubscribe ;
103+ private _settings ?: MapSettings ;
100104
101105 constructor (
102106 config : MapEmbeddableConfig ,
@@ -119,6 +123,7 @@ export class MapEmbeddable extends Embeddable<MapEmbeddableInput, MapEmbeddableO
119123 this . _renderTooltipContent = renderTooltipContent ;
120124 this . _eventHandlers = eventHandlers ;
121125 this . _layerList = config . layerList ;
126+ this . _settings = config . settings ;
122127 this . _store = createMapStore ( ) ;
123128
124129 this . _subscription = this . getInput$ ( ) . subscribe ( input => this . onContainerStateChanged ( input ) ) ;
@@ -194,6 +199,10 @@ export class MapEmbeddable extends Embeddable<MapEmbeddableInput, MapEmbeddableO
194199 this . _store . dispatch ( setReadOnly ( true ) ) ;
195200 this . _store . dispatch ( disableScrollZoom ( ) ) ;
196201
202+ if ( this . _settings ) {
203+ this . _store . dispatch ( setMapSettings ( this . _settings ) ) ;
204+ }
205+
197206 if ( _ . has ( this . input , 'isLayerTOCOpen' ) ) {
198207 this . _store . dispatch ( setIsLayerTOCOpen ( this . input . isLayerTOCOpen ) ) ;
199208 }
0 commit comments