Skip to content

Commit

Permalink
feat(Marker): 完善类型声明
Browse files Browse the repository at this point in the history
setClickable、setContent 支持传入 undefined
MarkerOptions 增加新字段 icon 和 size
  • Loading branch information
xyy94813 committed Mar 13, 2024
1 parent eccec8e commit 9647f0c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions types/overlays/Marker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ export type MarkerOptions<ExtraData = any> = {
* offset 为偏移量(默认基准点为图标左上角),如设置了 direction,以 direction 方位为基准点进行偏移。相关示例
*/
label?: MarkerLabelOptions;
/** 设置图标 */
icon?: Icon | string;
/**
* 设置尺寸
* @warning 文档未提及,但是存在
*/
size?: SizeLike;
};

export type MarkerEventType =
Expand Down Expand Up @@ -94,7 +101,7 @@ export declare class Marker<ExtraData = any>
/** 获取点标记是否支持鼠标单击事件Boolean */
getClickable(): boolean;
/** 设置点标记是支持鼠标单击事件clickable:Boolean */
setClickable(clickable: boolean): void;
setClickable(clickable?: boolean): void;
/** 获取点标记对象是否可拖拽移动Boolean */
getDraggable(): boolean;
/** 设置点标记对象是否可拖拽移动draggable:Boolean */
Expand Down Expand Up @@ -123,18 +130,14 @@ export declare class Marker<ExtraData = any>
getSize(): [number, number];
/** 设置尺寸 */
setSize(size: SizeLike): void;
/** 获取尺寸 */
getSize(): [number, number];
/** 设置尺寸 */
setSize(size: SizeLike): void;
/** 获取点标记的叠加顺序 */
getzIndex(): number | undefined;
/** 设置点标记的叠加顺序,默认最先添加的点标记在最底层 */
setzIndex(zIndex: number): void;
/** 获取内容 */
getContent(): string | HTMLElement | undefined;
/** 设置点标记显示内容,可以是HTML要素字符串或者HTML DOM对象 */
setContent(content: HTMLElement | string): void;
setContent(content?: HTMLElement | string): void;
/** 获取点标记范围 */
getBounds(): Bounds;
/** 移除点标记 */
Expand Down

0 comments on commit 9647f0c

Please sign in to comment.