Skip to content

Commit

Permalink
feat: 完善 AMap 声明
Browse files Browse the repository at this point in the history
AMap.version 字段
AMap.plugin 函数
AMap.convertFrom  函数
  • Loading branch information
xyy94813 committed Mar 13, 2024
1 parent a37d5f9 commit 2a6ce5d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { Size, SizeLike } from './common/Size';
import type { Event, MapsEvent } from './common/Event';
import type { MapOptions, MapEventType, Map } from './Map';

import type BaseLayer from './layers/BaseLayer';
import type {
TileLayer,
TileLayerOptions,
Expand Down Expand Up @@ -334,6 +335,27 @@ declare namespace AMap {
Util,
DomUtil,
};

export const version: string;

/** 默认图层. NebulaLayer??? */
export const createDefaultLayer: (opts?: any) => BaseLayer | any;

/** 加载插件 */
export function plugin(pluginName: string, cb: () => void): void;
export function plugin(pluginNames: string[], cb: () => void): void;

/**
* 为坐标转换类,支持将其他坐标系的坐标点转换为高德坐标系。坐标转换方法
* @param {LngLatLike} lnglat
* @param {string} type
* @param {Function} callBack
*/
export function convertFrom(
lnglat: LngLatLike,
type: 'gps' | 'baidu' | 'mapbar',
callBack: (status: string, result: any) => void,
): void;
}

declare global {
Expand Down

0 comments on commit 2a6ce5d

Please sign in to comment.