Skip to content

HtmlMark html标点类 ​

判定 ​

isHtmlMark() ​

typescript
function isHtmlMark(tar: any): tar is HtmlMark

属性 ​

id: string 唯一标识 ​

container: HTMLDivElement 容器 ​

children: Map<string,Mark> 子元素 ​

方法 ​

add 添加 ​

typescript
add(option: HtmlMarkOptions[0]): void

type HtmlMarkOptions = {
  id?: string;
  position: Point3d;
  html: string;
  /** 是否显示 */
  show?: boolean;
  /** x,y偏移 */
  offset?: [number, number];
  /** 最近距离 */
  near?: number;
  /** 最远距离 */
  far?: number;
  /** 近距离缩放 */
  nearScale?: number;
  /** 远距离缩放 */
  farScale?: number;
  /** 转到地球背面否显示功能是否启用 */
  isBackHide?: boolean;
  property?: Record<string | symbol, any>;
}[];

get 获取 ​

  • id 子元素id
typescript
get(id: string): Mark | undefined

setShow 设置子元素显示消失 ​

  • id 子元素id
  • show 是否显示
typescript
setShow(id: string,show: boolean): void

remove 移除点 ​

  • id 子元素id
typescript
remove(id: string): boolean

removeAll 移除所有点 ​

typescript
removeAll(): void

focus 聚焦 ​

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

destroy 销毁 ​

typescript
destroy(): boolean