Skip to content

html标点

  • 由于时html 事件绑定自己调用dom方法绑定即可

例:

typescript
// 1.直接批量创建或 
const mark = createHtmlMark([
   {
     id: 23,
     farScale: 0,
     position: Point3d.fromLngLat(119.37903418, 34.75724029),
     html: '<div style="width:100px;height:100px;border:1px solid red;"></div>',
   }
 ])
// 2.逐个添加
const mark = craeteHtmlMark()
mark.add(
{
     id: 23,
     farScale: 0,
     position: Point3d.fromLngLat(119.37903418, 34.75724029),
     html: '<div style="width:100px;height:100px;border:1px solid red;"></div>',
   }
)

配置参数

typescript
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>;
}[];

提示

html标点,默认以 左上角 为原点, 可以调整 offset 调整位置

配置