Skip to content

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> | undefined

remove 移除点

  • id 子元素id
  • isRender 移除后是否进行渲染 默认true
typescript
remove(id: string, isRender: boolean): boolean

removeAll 移除所有点

  • isRender 移除后是否进行渲染 默认true
typescript
removeAll(isRender: boolean): void

on 事件注册

  • 两个函数重载
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'): MapEntityCollection

focus 聚焦

  • id 子元素id
  • duration 过渡时间(秒)
typescript
focus(id: string, duration): void

destroy 销毁

typescript
destroy(): boolean