Skip to content

Track.CustomPoint

Custom 移动目标,继承 Track.MovePoint

构造函数

构造函数描述
new Track.CustomPoint(option?: Track.customPointOptions)Custom 移动目标,继承 Track.MovePoint。

Track.customPointOptions

Custom 图标配置参数,继承移动目标基类参数 Track.movePointOptions

参数项类型描述
styleCustomOverlayOptions【可选】样式配置

示例

ts
// 创建 Custom 移动目标实例
const customPoint = new Track.CustomPoint({
  // Custom 移动目标配置
  point: new BMapGL.Point(116.404, 39.915),
  rotation: 90,
  style: {
    html: '<div class="custom-marker">自定义标记</div>',
    offset: new BMapGL.Size(16, 16)
  }
});

// 设置坐标
customPoint.setPoint(new BMapGL.Point(116.405, 39.916));

// 设置旋转角
customPoint.setRotation(180);

// 添加到地图
customPoint.addToMap(map);

基于 MIT 许可发布