|
|
|
@ -1,11 +1,17 @@
|
|
|
|
|
import { ILngLat, IMap, IMapOptions, IMarker, IPixel } from './map' |
|
|
|
|
import { ILngLat, IMap, IMapOptions, IMarker, IPixel, ISelf, ITileLayer } from './map' |
|
|
|
|
declare var KMap: any; |
|
|
|
|
|
|
|
|
|
export class KeDaMap implements IMap { |
|
|
|
|
class KedaBasic implements ISelf { |
|
|
|
|
self: any; |
|
|
|
|
discriminator: string = "ISelf"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export class KeDaMap extends KedaBasic implements IMap { |
|
|
|
|
constructor(container: string, options: IMapOptions) { |
|
|
|
|
super(); |
|
|
|
|
let opt = Object.assign({}, { containerId: container }, options) as any; |
|
|
|
|
opt.configUrl = ""; |
|
|
|
|
opt.configUrl = "../../../assets/kmap/Kmap.config.json"; |
|
|
|
|
opt.targetCoordinateType = "WGS84",
|
|
|
|
|
this.self = new KMap(opt); |
|
|
|
|
} |
|
|
|
|
setAdministrativeAreaStyle(conponent: any, getData?: Function, setData?: Function) { //自定义 行政区划 样式
|
|
|
|
@ -38,7 +44,6 @@ export class KeDaMap implements IMap {
|
|
|
|
|
getBounds() { |
|
|
|
|
throw new Error('Method not implemented.'); |
|
|
|
|
} |
|
|
|
|
discriminator= 'ISelf'; |
|
|
|
|
add(obj: any) { |
|
|
|
|
throw new Error('Method not implemented.'); |
|
|
|
|
} |
|
|
|
@ -46,7 +51,7 @@ export class KeDaMap implements IMap {
|
|
|
|
|
throw new Error('Method not implemented.'); |
|
|
|
|
} |
|
|
|
|
setCity(city: string) { |
|
|
|
|
throw new Error('Method not implemented.'); |
|
|
|
|
console.log(1) |
|
|
|
|
} |
|
|
|
|
setZoom(zoom) { |
|
|
|
|
throw new Error('Method not implemented.'); |
|
|
|
@ -73,17 +78,16 @@ export class KeDaMap implements IMap {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export class KeDaPixel implements IPixel { |
|
|
|
|
self: any; |
|
|
|
|
export class KeDaPixel extends KedaBasic implements IPixel { |
|
|
|
|
constructor(x: number, y: number) { |
|
|
|
|
super(); |
|
|
|
|
this.self = [x, y]; |
|
|
|
|
} |
|
|
|
|
discriminator= 'ISelf'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export class KeDaMarker implements IMarker { |
|
|
|
|
self: any; |
|
|
|
|
export class KeDaMarker extends KedaBasic implements IMarker { |
|
|
|
|
constructor(options: any) { |
|
|
|
|
super(); |
|
|
|
|
let d = { |
|
|
|
|
offset: options.offset, |
|
|
|
|
element: options.content |
|
|
|
@ -109,11 +113,10 @@ export class KeDaMarker implements IMarker {
|
|
|
|
|
on(eventName: string, callback: Function): void { |
|
|
|
|
throw new Error('Method not implemented.'); |
|
|
|
|
} |
|
|
|
|
discriminator= 'ISelf'; |
|
|
|
|
} |
|
|
|
|
export class KeDaLngLat implements ILngLat { |
|
|
|
|
self: any; |
|
|
|
|
export class KeDaLngLat extends KedaBasic implements ILngLat { |
|
|
|
|
constructor(x: number, y: number) { |
|
|
|
|
super(); |
|
|
|
|
this.self = new KMap.LngLat(x, y); |
|
|
|
|
} |
|
|
|
|
lng: number; |
|
|
|
@ -121,5 +124,16 @@ export class KeDaLngLat implements ILngLat {
|
|
|
|
|
offset(x: number, y: number) { |
|
|
|
|
throw new Error('Method not implemented.'); |
|
|
|
|
} |
|
|
|
|
discriminator= 'ISelf'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export class KedaTileLayer extends KedaBasic implements ITileLayer { |
|
|
|
|
constructor() { |
|
|
|
|
super(); |
|
|
|
|
} |
|
|
|
|
Satellite() { |
|
|
|
|
return this |
|
|
|
|
} |
|
|
|
|
RoadNet() { |
|
|
|
|
return this |
|
|
|
|
} |
|
|
|
|
} |