[Maps] allow embeddables to hide filtering controls (#43703)

* [Maps] allow embeddables to hide filtering controls

* fix typos in embeddable docs
This commit is contained in:
Nathan Reese 2019-08-21 13:44:07 -06:00 committed by GitHub
parent 5071c74945
commit 0d4e979778
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 1 deletions

View file

@ -137,7 +137,7 @@ export class MapEmbeddable extends Embeddable {
render(
<Provider store={this._store}>
<I18nContext>
<GisMap addFilters={this.addFilters}/>
<GisMap addFilters={this.input.hideFilterActions ? null : this.addFilters}/>
</I18nContext>
</Provider>,
domNode

View file

@ -0,0 +1,27 @@
### MapEmbeddableFactory
Use to load map saved object and create MapEmbeddable instance.
### MapEmbeddable
Renders map saved object. State comes from saved object.
#### Customizable parameters
- **hideFilterActions:** (Boolean) Set to true to hide all filtering controls.
- **isLayerTOCOpen:** (Boolean) Set to false to render map with legend in collapsed state.
- **openTOCDetails:** (Array of Strings) Array of layer ids. Add layer id to show layer details on initial render.
- **mapCenter:** ({lat, lon, zoom }) Provide mapCenter to customize initial map location.
Customize embeddable state by providing properties for `MapEmbeddableFactory.createFromSavedObject` `input` parameter.
```
const factory = new MapEmbeddableFactory();
const mapEmbeddable = await factory.createFromSavedObject(
'de71f4f0-1902-11e9-919b-ffe5949a18d2',
{
hideFilterActions: true,
isLayerTOCOpen: false,
openTOCDetails: ['tfi3f', 'edh66'],
mapCenter: { lat: 0.0, lon: 0.0, zoom: 7 }
}
);
```