Track.GroundPoint
Ground 移动目标,继承 Track.MovePoint。
构造函数
| 构造函数 | 描述 |
|---|---|
| new Track.GroundPoint(option?: Track.groundPointOptions) | Ground 移动目标,继承 Track.MovePoint。 |
Track.groundPointOptions
Ground 图标配置参数,继承移动目标基类参数 Track.movePointOptions。
| 参数项 | 类型 | 描述 |
|---|---|---|
| style | GroundPointOptions | 【可选】样式配置 |
| adjustSize | boolean | 【可选】是否自适应地图缩放 |
方法
| 方法 | 返回 | 描述 |
|---|---|---|
| setScale(scale: number) | void | 设置尺寸缩放大小 |
示例
ts
// 创建 Ground 移动目标实例
const groundPoint = new Track.GroundPoint({
// Ground 移动目标配置
point: new BMapGL.Point(116.404, 39.915),
rotation: 90,
style: {
image: 'path/to/image.png',
size: new BMapGL.Size(32, 32)
},
adjustSize: true
});
// 设置坐标
groundPoint.setPoint(new BMapGL.Point(116.405, 39.916));
// 设置旋转角
groundPoint.setRotation(180);
// 设置尺寸缩放
groundPoint.setScale(1.5);
// 添加到地图
groundPoint.addToMap(map);