You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
752 B
25 lines
752 B
4 years ago
|
const mapSupplier: number = 1;//1:高德
|
||
|
|
||
|
import { IMap, IMapOptions, IPixel } from './map'
|
||
|
import { GaoDeMap, GaoDePixel } from './gaode-map'
|
||
|
import { KeDaMap, KeDaPixel } from './keda-map';
|
||
|
|
||
|
|
||
|
export class MapFactory {
|
||
|
public static MapInstance(container: string, options: IMapOptions | any): IMap {
|
||
|
switch (mapSupplier) {
|
||
|
case 1: return new GaoDeMap(container, options);
|
||
|
case 2: return new KeDaMap(container, options);
|
||
|
default: return null;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static PixelInstance(x: number, y: number): IPixel {
|
||
|
switch (mapSupplier) {
|
||
|
case 1: return new GaoDePixel(x, y);
|
||
|
case 2: return new KeDaPixel(x, y);
|
||
|
default: return null;
|
||
|
}
|
||
|
}
|
||
|
}
|