migrate map code to typescript

This commit is contained in:
MaysWind
2025-01-05 03:10:41 +08:00
parent a46399cbaf
commit 16fa77eb09
17 changed files with 919 additions and 912 deletions
+7 -7
View File
@@ -1,23 +1,23 @@
export interface PresetLeafletTileSource {
export interface LeafletTileSource {
readonly tileUrlFormat: string;
readonly tileUrlSubDomains: string;
readonly tileUrlExtraParams?: PresetLeafletTileSourceExtraParam[];
readonly tileUrlExtraParams?: LeafletTileSourceExtraParam[];
readonly annotationUrlFormat?: string;
readonly annotationUrlSubDomains?: string;
readonly annotationUrlExtraParams?: PresetLeafletTileSourceExtraParam[];
readonly annotationUrlExtraParams?: LeafletTileSourceExtraParam[];
readonly minZoom: number;
readonly maxZoom: number;
readonly defaultZoomLevel: number;
readonly website: string;
readonly attribution: string;
readonly website?: string;
readonly attribution?: string;
}
export interface PresetLeafletTileSourceExtraParam {
export interface LeafletTileSourceExtraParam {
readonly paramName: string;
readonly paramValueType: string;
}
export const LEAFLET_TILE_SOURCES: Record<string, PresetLeafletTileSource> = {
export const LEAFLET_TILE_SOURCES: Record<string, LeafletTileSource> = {
'openstreetmap': {
tileUrlFormat: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
tileUrlSubDomains: 'abc',