叠加物操作
addPoint(coordinates, properties opt) -> {string}
向地图中添加点
参数
名称 | 数据类型 | 说明 |
---|---|---|
coordinates |
number[] | 点坐标 [x, y] 单位:米 |
properties |
object | 可选;自定义属性 |
返回值 string
添加点的 feature 标识
示例
TypeScript | |
---|---|
addLine(coordinates, properties opt) -> {string}
向地图中添加线
参数
名称 | 数据类型 | 说明 |
---|---|---|
coordinates |
array[] | 线上的点坐标数组 单位:米 |
properties |
object | 可选;自定义属性 |
返回值 string
添加线的 feature 标识
示例
TypeScript | |
---|---|
addMarker(imgSrc, coordinates, yaw) -> {any}
向地图中添加 marker
参数
名称 | 数据类型 | 说明 |
---|---|---|
imgSrc |
string | 图片地址 |
coordinates |
number[] | 坐标 [x, y] 单位:米 |
yaw |
number | 朝向角度 单位:度 |
返回值 any
marker 对象
示例
setMarkerProperties(marker, coordinates, yaw) -> {void}
设置 marker 属性
参数
名称 | 数据类型 | 说明 |
---|---|---|
marker |
any | marker 对象 |
coordinates |
number[] | 新坐标 [x, y] 单位:米 |
yaw |
number | 新的朝向角度 单位:度 |
返回值
无
示例
removeMarker(marker) -> {void}
从地图中删除 marker
参数
名称 | 数据类型 | 说明 |
---|---|---|
marker |
any | Marker 对象 |
返回值
无