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 | undefinedsetShow 设置子元素显示消失
id子元素idshow是否显示
typescript
setShow(id: string,show: boolean): voidremove 移除点
id子元素id
typescript
remove(id: string): booleanremoveAll 移除所有点
typescript
removeAll(): voidfocus 聚焦
id子元素idduration过渡时间(秒)
typescript
focus(id: string, duration): voiddestroy 销毁
typescript
destroy(): boolean