Geomap: Add alpha day/night layer (#50201)

Co-authored-by: drew08t <drew08@gmail.com>
This commit is contained in:
Ryan McKinley
2022-06-20 10:35:03 -07:00
committed by GitHub
parent a37b868da7
commit c2aee2b6da
16 changed files with 487 additions and 26 deletions

View File

@@ -2,6 +2,7 @@ import { PluggableMap } from 'ol';
import BaseLayer from 'ol/layer/Base';
import { ReactNode } from 'react';
import { EventBus } from '../events';
import { GrafanaTheme2 } from '../themes';
import { MatcherConfig, PanelData } from '../types';
import { PanelOptionsEditorBuilder } from '../utils';
@@ -79,6 +80,11 @@ export interface MapLayerHandler<TConfig = any> {
* The update function should only be implemented if the layer type makes use of query data
*/
update?: (data: PanelData) => void;
/** Optional callback to cleaup before getting removed */
dispose?: () => void;
/** return react node for the legend */
legend?: ReactNode;
/**
@@ -112,5 +118,10 @@ export interface MapLayerRegistryItem<TConfig = MapLayerOptions> extends Registr
* Function that configures transformation and returns a transformer
* @param options
*/
create: (map: PluggableMap, options: MapLayerOptions<TConfig>, theme: GrafanaTheme2) => Promise<MapLayerHandler>;
create: (
map: PluggableMap,
options: MapLayerOptions<TConfig>,
eventBus: EventBus,
theme: GrafanaTheme2
) => Promise<MapLayerHandler>;
}