Files
grafana/public/app/plugins/panel/geomap/layers/basemaps/osm.ts
Drew Slobodnjak 07aa2bbbba GeomapPanel: Add base types to data layer options (#50053)
* 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
2022-06-13 14:07:20 -07:00

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];