view.ts 966 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { Registry, RegistryItem } from '@grafana/data';
  2. interface MapCenterItems extends RegistryItem {
  3. lat?: number;
  4. lon?: number;
  5. zoom?: number;
  6. }
  7. export enum MapCenterID {
  8. Zero = 'zero',
  9. Coordinates = 'coords',
  10. Fit = 'fit',
  11. }
  12. export const centerPointRegistry = new Registry<MapCenterItems>(() => [
  13. {
  14. id: MapCenterID.Fit as string,
  15. name: 'Fit data layers',
  16. zoom: 15, // max zoom
  17. },
  18. {
  19. id: MapCenterID.Zero as string,
  20. name: '(0°, 0°)',
  21. lat: 0,
  22. lon: 0,
  23. },
  24. {
  25. id: 'north-america',
  26. name: 'North America',
  27. lat: 40,
  28. lon: -100,
  29. zoom: 4,
  30. },
  31. {
  32. id: 'europe',
  33. name: 'Europe',
  34. lat: 46,
  35. lon: 14,
  36. zoom: 4,
  37. },
  38. {
  39. id: 'west-asia',
  40. name: 'West Asia',
  41. lat: 26,
  42. lon: 53,
  43. zoom: 4,
  44. },
  45. {
  46. id: 'se-asia',
  47. name: 'South-east Asia',
  48. lat: 10,
  49. lon: 106,
  50. zoom: 4,
  51. },
  52. {
  53. id: MapCenterID.Coordinates as string,
  54. name: 'Coordinates',
  55. },
  56. ]);