WholeProcessPlatform/frontend/src/components/gis/map.class.ts

30 lines
758 B
TypeScript
Raw Normal View History

2026-04-03 16:04:16 +08:00
import type { layer, MapInterface } from "./map.d";
import { MapLeaflet } from "./map.leaflet";
interface MapClassInterface extends MapInterface {
layers: Map<string, layer>;
view: any;
}
export const mapServerBaseUrl = localStorage.getItem("gisurl") || "http://210.72.227.199:18084/";
export class MapClass implements MapClassInterface {
layers: Map<string, layer>;
view: any;
private static instance: MapClass;
private service: MapInterface;
static getInstance(): MapClass {
if (!this.instance) {
this.instance = new MapClass();
}
return this.instance;
}
constructor() {
this.layers = new Map();
this.view = null;
this.service = new MapLeaflet();
}
}