grafana/public/app/plugins/panel/geomap/layers/basemaps/osm.ts
Ryan McKinley c2aee2b6da
Geomap: Add alpha day/night layer (#50201)
Co-authored-by: drew08t <drew08@gmail.com>
2022-06-20 19:35:03 +02:00

27 lines
696 B
TypeScript

import Map from 'ol/Map';
import TileLayer from 'ol/layer/Tile';
import OSM from 'ol/source/OSM';
import { MapLayerRegistryItem, MapLayerOptions, EventBus } 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, eventBus: EventBus) => ({
init: () => {
return new TileLayer({
source: new OSM(),
});
},
}),
};
export const osmLayers = [standard];