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.
31 lines
1.0 KiB
31 lines
1.0 KiB
const mapSupplier: number = 1;//1:高德 |
|
|
|
import { IMap, IMapOptions, IMarker, IPixel } from './map' |
|
import { GaoDeMap, GaoDeMarker, GaoDePixel } from './gaode-map' |
|
import { KeDaMap, KeDaMarker, 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; |
|
} |
|
} |
|
public static MarkerInstance(options:any): IMarker { |
|
switch (mapSupplier) { |
|
case 1: return new GaoDeMarker(options); |
|
case 2: return new KeDaMarker(options); |
|
default: return null; |
|
} |
|
} |
|
}
|
|
|