2021-07-09 23:53:07 +08:00
|
|
|
import { Registry, RegistryItem } from '@grafana/data';
|
|
|
|
|
|
|
|
|
|
interface MapCenterItems extends RegistryItem {
|
|
|
|
|
lat?: number;
|
|
|
|
|
lon?: number;
|
2021-07-19 23:40:56 +08:00
|
|
|
zoom?: number;
|
2021-07-09 23:53:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export enum MapCenterID {
|
|
|
|
|
Zero = 'zero',
|
|
|
|
|
Coordinates = 'coords',
|
2022-03-19 02:13:55 +08:00
|
|
|
Fit = 'fit',
|
2021-07-09 23:53:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const centerPointRegistry = new Registry<MapCenterItems>(() => [
|
2022-03-19 02:13:55 +08:00
|
|
|
{
|
|
|
|
|
id: MapCenterID.Fit as string,
|
|
|
|
|
name: 'Fit data layers',
|
|
|
|
|
zoom: 15, // max zoom
|
|
|
|
|
},
|
2021-07-09 23:53:07 +08:00
|
|
|
{
|
|
|
|
|
id: MapCenterID.Zero as string,
|
|
|
|
|
name: '(0°, 0°)',
|
|
|
|
|
lat: 0,
|
|
|
|
|
lon: 0,
|
|
|
|
|
},
|
2022-09-15 02:38:35 +08:00
|
|
|
{
|
|
|
|
|
id: MapCenterID.Coordinates as string,
|
|
|
|
|
name: 'Coordinates',
|
|
|
|
|
},
|
2021-07-09 23:53:07 +08:00
|
|
|
{
|
|
|
|
|
id: 'north-america',
|
|
|
|
|
name: 'North America',
|
|
|
|
|
lat: 40,
|
|
|
|
|
lon: -100,
|
2021-07-19 23:40:56 +08:00
|
|
|
zoom: 4,
|
2021-07-09 23:53:07 +08:00
|
|
|
},
|
2022-09-15 02:38:35 +08:00
|
|
|
{
|
|
|
|
|
id: 'south-america',
|
|
|
|
|
name: 'South America',
|
|
|
|
|
lat: -20,
|
|
|
|
|
lon: -60,
|
|
|
|
|
zoom: 3,
|
|
|
|
|
},
|
2021-07-09 23:53:07 +08:00
|
|
|
{
|
|
|
|
|
id: 'europe',
|
|
|
|
|
name: 'Europe',
|
|
|
|
|
lat: 46,
|
|
|
|
|
lon: 14,
|
2021-07-19 23:40:56 +08:00
|
|
|
zoom: 4,
|
2021-07-09 23:53:07 +08:00
|
|
|
},
|
2022-09-15 02:38:35 +08:00
|
|
|
{
|
|
|
|
|
id: 'africa',
|
|
|
|
|
name: 'Africa',
|
|
|
|
|
lat: 0,
|
|
|
|
|
lon: 30,
|
|
|
|
|
zoom: 3,
|
|
|
|
|
},
|
2021-07-09 23:53:07 +08:00
|
|
|
{
|
|
|
|
|
id: 'west-asia',
|
|
|
|
|
name: 'West Asia',
|
|
|
|
|
lat: 26,
|
|
|
|
|
lon: 53,
|
2021-07-19 23:40:56 +08:00
|
|
|
zoom: 4,
|
2021-07-09 23:53:07 +08:00
|
|
|
},
|
2022-09-15 02:38:35 +08:00
|
|
|
{
|
|
|
|
|
id: 's-asia',
|
|
|
|
|
name: 'South Asia',
|
|
|
|
|
lat: 19.5,
|
|
|
|
|
lon: 80,
|
|
|
|
|
zoom: 4,
|
|
|
|
|
},
|
2021-07-09 23:53:07 +08:00
|
|
|
{
|
|
|
|
|
id: 'se-asia',
|
2022-09-15 02:38:35 +08:00
|
|
|
name: 'South-East Asia',
|
2021-07-09 23:53:07 +08:00
|
|
|
lat: 10,
|
|
|
|
|
lon: 106,
|
2021-07-19 23:40:56 +08:00
|
|
|
zoom: 4,
|
2021-07-09 23:53:07 +08:00
|
|
|
},
|
|
|
|
|
{
|
2022-09-15 02:38:35 +08:00
|
|
|
id: 'e-asia',
|
|
|
|
|
name: 'East Asia',
|
|
|
|
|
lat: 33,
|
|
|
|
|
lon: 120,
|
|
|
|
|
zoom: 4,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'australia',
|
|
|
|
|
name: 'Australia',
|
|
|
|
|
lat: -25,
|
|
|
|
|
lon: 135,
|
|
|
|
|
zoom: 4,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'oceania',
|
|
|
|
|
name: 'Oceania',
|
|
|
|
|
lat: -10,
|
|
|
|
|
lon: -140,
|
|
|
|
|
zoom: 3,
|
2021-07-09 23:53:07 +08:00
|
|
|
},
|
|
|
|
|
]);
|