30 lines
758 B
TypeScript
30 lines
758 B
TypeScript
|
|
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();
|
||
|
|
}
|
||
|
|
}
|