Geomap: support multiple layers (#40906)

This commit is contained in:
Ryan McKinley
2021-10-27 14:49:11 -07:00
committed by GitHub
parent 14225b07b2
commit 45e1765733
17 changed files with 786 additions and 457 deletions
+6 -6
View File
@@ -66,10 +66,15 @@ export interface MapLayerOptions<TConfig = any> {
/**
* @alpha
*/
export interface MapLayerHandler {
export interface MapLayerHandler<TConfig = any> {
init: () => BaseLayer;
update?: (data: PanelData) => void;
legend?: ReactNode;
/**
* Show custom elements in the panel edit UI
*/
registerOptionsUI?: (builder: PanelOptionsEditorBuilder<MapLayerOptions<TConfig>>) => void;
}
/**
@@ -98,9 +103,4 @@ export interface MapLayerRegistryItem<TConfig = MapLayerOptions> extends Registr
* @param options
*/
create: (map: Map, options: MapLayerOptions<TConfig>, theme: GrafanaTheme2) => Promise<MapLayerHandler>;
/**
* Show custom elements in the panel edit UI
*/
registerOptionsUI?: (builder: PanelOptionsEditorBuilder<MapLayerOptions<TConfig>>) => void;
}
@@ -16,6 +16,7 @@ import {
UnitFieldConfigSettings,
unitOverrideProcessor,
FieldNamePickerConfigSettings,
StandardEditorContext,
} from '../field';
import { PanelOptionsSupplier } from '../panel/PanelPlugin';
@@ -133,6 +134,7 @@ export class FieldConfigEditorBuilder<TOptions> extends OptionsUIRegistryBuilder
export interface NestedValueAccess {
getValue: (path: string) => any;
onChange: (path: string, value: any) => void;
getContext?: (parent: StandardEditorContext<any, any>) => StandardEditorContext<any, any>;
}
export interface NestedPanelOptions<TSub = any> {
path: string;