mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* GeomapPanel: Add base types to data layer options Removed isBaseMap check from data layer filter, which used to remove base layer types from data layer options. For layer editor, slider to control opacity is added. * GeomapPanel: Reorder data layer options For data layer selection, present user with data layer types first, before base map layer types. Refactored to consolidate layer options into a single exported function in registry with a base map boolean. * GeomapPanel: Add descriptions to base map types * GeomapPanel: add hideOpacity and apply to markers * GeomapPanel: update descriptions for map types Closes #47812
27 lines
666 B
TypeScript
27 lines
666 B
TypeScript
import Map from 'ol/Map';
|
|
import TileLayer from 'ol/layer/Tile';
|
|
import OSM from 'ol/source/OSM';
|
|
|
|
import { MapLayerRegistryItem, MapLayerOptions } from '@grafana/data';
|
|
|
|
export const standard: MapLayerRegistryItem = {
|
|
id: 'osm-standard',
|
|
name: 'Open Street Map',
|
|
description: 'Add map from a collaborative free geographic world database',
|
|
isBaseMap: true,
|
|
|
|
/**
|
|
* Function that configures transformation and returns a transformer
|
|
* @param options
|
|
*/
|
|
create: async (map: Map, options: MapLayerOptions) => ({
|
|
init: () => {
|
|
return new TileLayer({
|
|
source: new OSM(),
|
|
});
|
|
},
|
|
}),
|
|
};
|
|
|
|
export const osmLayers = [standard];
|