mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[maps] only show vector tile inspector panel when map uses elasticsearch vector tile API (#170043)
Closes https://github.com/elastic/kibana/issues/170042 PR disables vector tile adapter when map does not contain vector tile layers ### Test 1) create new map 2) add documents layer 3) set scaling to "limit to 10000" 4) open inspector. Notice inspector only displays request adapter 5) change scaling to "vector tiles" 6) open inspector. Notice inspector displays vector tile adapter and request adapter --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
4493efa9a9
commit
dbc64e526e
2 changed files with 5 additions and 1 deletions
|
@ -22,6 +22,10 @@ export class VectorTileAdapter extends EventEmitter {
|
|||
this._onChange();
|
||||
}
|
||||
|
||||
hasLayers() {
|
||||
return Object.keys(this._layers).length > 0;
|
||||
}
|
||||
|
||||
setTiles(tiles: Array<{ x: number; y: number; z: number }>) {
|
||||
this._tiles = tiles;
|
||||
this._onChange();
|
||||
|
|
|
@ -23,7 +23,7 @@ export const VectorTileInspectorView = {
|
|||
defaultMessage: 'View the vector tile search requests used to collect the data',
|
||||
}),
|
||||
shouldShow(adapters: Adapters) {
|
||||
return Boolean(adapters.vectorTiles);
|
||||
return Boolean(adapters.vectorTiles?.hasLayers());
|
||||
},
|
||||
component: (props: { adapters: Adapters }) => {
|
||||
return <LazyWrapper getLazyComponent={getLazyComponent} lazyComponentProps={props} />;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue