yangyanggu / vue-amap

高德地图封装 for vue2 vue3.0
https://vue-amap.guyixi.cn/
MIT License
252 stars 13 forks source link

组件中怎么实现运动轨迹? #55

Open Emmpty opened 1 year ago

Emmpty commented 1 year ago

使用版本

请填写使用版本:

问题描述

yangyanggu commented 1 year ago

运动轨迹可以使用AMap.MoveAnimation插件实现,

initAMapApiLoader({
  key: 'YOUR_KEY',
  securityJsCode: 'securityJsCode', // 新版key需要配合安全密钥使用
 plugins: ['AMap.MoveAnimation']
})

然后在el-marker组件初始化之后,可以拿到marker实例,再执行marker.moveAlong实现按轨迹移动,原生的示例: https://lbs.amap.com/demo/javascript-api-v2/example/marker/replaying-historical-running-data