osm.ts 588 B

12345678910111213141516171819202122232425
  1. import Map from 'ol/Map';
  2. import TileLayer from 'ol/layer/Tile';
  3. import OSM from 'ol/source/OSM';
  4. import { MapLayerRegistryItem, MapLayerOptions } from '@grafana/data';
  5. export const standard: MapLayerRegistryItem = {
  6. id: 'osm-standard',
  7. name: 'Open Street Map',
  8. isBaseMap: true,
  9. /**
  10. * Function that configures transformation and returns a transformer
  11. * @param options
  12. */
  13. create: async (map: Map, options: MapLayerOptions) => ({
  14. init: () => {
  15. return new TileLayer({
  16. source: new OSM(),
  17. });
  18. },
  19. }),
  20. };
  21. export const osmLayers = [standard];