|
|
|
import { ILngLat, IMap, IMapOptions, IMarker, IPixel, ISelf, ITileLayer } from './map'
|
|
|
|
declare var KMap: any;
|
|
|
|
|
|
|
|
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 = "../../../assets/kmap/Kmap.config.json";
|
|
|
|
opt.targetCoordinateType = "WGS84",
|
|
|
|
this.self = new KMap(opt);
|
|
|
|
}
|
|
|
|
setAdministrativeAreaStyle(conponent: any, getData?: Function, setData?: Function) { //自定义 行政区划 样式
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
setBounds(zoom?: any, x?: any, y?: any, is?: boolean) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
setFitView(options: any) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
containerToLngLat(e: any) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
clearMap() {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
distance(a: number[], b: number[]) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
getCity(callback: Function) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
setZoomAndCenter(zoom: number, pos: number[]) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
plugin(eventName: string[], callback: Function) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
getBounds() {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
add(obj: any) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
remove(obj: any) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
setCity(city: string) {
|
|
|
|
console.log(1)
|
|
|
|
}
|
|
|
|
setZoom(zoom) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
setCenter([x, y]) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
getZoom() {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
getCenter() {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
on(eventName: string, callback: Function): void {
|
|
|
|
let eventMapProfile = {
|
|
|
|
complete: "load",
|
|
|
|
click: "click",
|
|
|
|
rightclick: "contextmenu"
|
|
|
|
};
|
|
|
|
this.self.addEventOnMap({
|
|
|
|
event: eventMapProfile[eventName],
|
|
|
|
handler: callback
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class KeDaPixel extends KedaBasic implements IPixel {
|
|
|
|
constructor(x: number, y: number) {
|
|
|
|
super();
|
|
|
|
this.self = [x, y];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class KeDaMarker extends KedaBasic implements IMarker {
|
|
|
|
constructor(options: any) {
|
|
|
|
super();
|
|
|
|
let d = {
|
|
|
|
offset: options.offset,
|
|
|
|
element: options.content
|
|
|
|
};
|
|
|
|
this.self = d;
|
|
|
|
}
|
|
|
|
setContent(html: string) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
setPosition(x: number[]) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
_position: number[];
|
|
|
|
setMap() {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
get id(): string {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
set id(str: string) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
on(eventName: string, callback: Function): void {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export class KeDaLngLat extends KedaBasic implements ILngLat {
|
|
|
|
constructor(x: number, y: number) {
|
|
|
|
super();
|
|
|
|
this.self = new KMap.LngLat(x, y);
|
|
|
|
}
|
|
|
|
lng: number;
|
|
|
|
lat: number;
|
|
|
|
offset(x: number, y: number) {
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class KedaTileLayer extends KedaBasic implements ITileLayer {
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
Satellite() {
|
|
|
|
return this
|
|
|
|
}
|
|
|
|
RoadNet() {
|
|
|
|
return this
|
|
|
|
}
|
|
|
|
}
|