project-nomad/admin/types/maps.ts

58 lines
985 B
TypeScript

export type BaseStylesFile = {
version: number
sources: {
[key: string]: MapSource
}
layers: MapLayer[]
sprite: string
glyphs: string
}
export type MapSource = {
type: 'vector' | 'raster' | 'raster-dem' | 'geojson' | 'image' | 'video'
attribution?: string
url: string
}
export type MapLayer = {
'id': string
'type': string
'source'?: string
'source-layer'?: string
[key: string]: any
}
/** ISO 3166-1 alpha-2 country code (e.g. "DE", "FR", "US"). */
export type CountryCode = string
export type Country = {
code: CountryCode
code3: string
name: string
continent: string
subregion: string
population: number
}
export type CountryGroup = {
id: string
name: string
description: string
countries: CountryCode[]
}
export type MapExtractRequest = {
countries: CountryCode[]
maxzoom?: number
}
export type MapExtractPreflight = {
tiles: number
bytes: number
source: {
url: string
date: string
key: string
}
}