新增图源修改功能

This commit is contained in:
2026-06-06 01:16:03 +08:00
parent 91267eb99c
commit 0f9cb3eae5
15 changed files with 1267 additions and 24 deletions
+19
View File
@@ -0,0 +1,19 @@
import { getDefaultMapSource } from './api'
import type { PublicMapTileSource } from './types'
export const fallbackMapSource: PublicMapTileSource = {
id: 0,
name: 'OpenStreetMap Japan',
url_template: 'https://tile.openstreetmap.jp/{z}/{x}/{y}.png',
attribution: '© OpenStreetMap contributors',
max_zoom: 19,
}
export async function loadDefaultMapSource(): Promise<PublicMapTileSource> {
try {
const response = await getDefaultMapSource()
return response.item
} catch {
return fallbackMapSource
}
}