MapEntityCollection 图形集合类
判定
isMapEntityCollection()
typescript
const isMapEntityCollection: (tar: any) => tar is MapEntityCollection属性
redonlay id: string 唯一标识
size: number 子元素数量
show: boolean 是否显示
label: HtmlLabel
方法
add 添加元素
typescript
add(tar: BaseEntity<any> | MapEntityCollectionOptions['addOptions']): BaseEntity<any> | undefined
type MapEntityCollectionOptions = {
addOptions: {
/** 圆 */
circle?: CircleOptions;
/** 椭圆 */
hemisphere?: HemisphereOptions;
/** 标签 */
label?: LabelOptions;
/** 线 */
line?: LineOptions;
/** 模型 */
model?: ModelOptions;
/** 点 */
point?: PointOptions;
/** 面 */
polygon?: PolygonOptions;
/** 矩形 */
rectangle?: RectangleOptions;
/** 墙体 */
wall?: WallOptions;
};
};get 获取
id子元素id
typescript
get(id: string): BaseEntity<any> | undefinedremove 移除点
id子元素idisRender移除后是否进行渲染 默认true
typescript
remove(id: string, isRender: boolean): booleanremoveAll 移除所有点
isRender移除后是否进行渲染 默认true
typescript
removeAll(isRender: boolean): voidon 事件注册
- 两个函数重载
typescript
on(
type: 'mouseMove',
listener: (tar: [MapEntityCollection, BaseEntity<any> | undefined], mark: 'in' | 'out', Even: MouseMoveEvent) => void
): MapEntityCollection;
on(
type: PickType,
listener: (tar: [MapEntityCollection, BaseEntity<any> | undefined], mark: 'in' | 'out', Even: PickEvent) => void
): MapEntityCollection;off 事件移除
typescript
off(type: PickType | 'mouseMove'): MapEntityCollectionfocus 聚焦
id子元素idduration过渡时间(秒)
typescript
focus(id: string, duration): voiddestroy 销毁
typescript
destroy(): boolean