h5 markers的标记点图片没有显示
用到高德地图路线规划JSSDK https://ext.dcloud.net.cn/plugin?id=1217的demo
Amap.markers(startPoi,endPoi,wayPoi,function(res){
this.markers.push.apply(that.markers, res)
})
没有显示图片
排查出来问题是:function () {↵ vm._update(vm._render(), hydrating);↵ }
解决方案:
把方法写出来就显示出来了,
let markers1 = [];
//起点
let start = {
iconPath: "/static/amap/startingPoint.png",
id: 0,
longitude: startPoi.split(",")[0],
latitude: startPoi.split(",")[1],
width: 41,
height: 45
}
markers1.push(start)
//终点
let end = {
iconPath: "/static/amap/endPoint.png",
id: 1,
longitude: endPoi.split(",")[0],
latitude: endPoi.split(",")[1],
width: 41,
height: 45
}
markers1.push(end)
//途经点,先将其分隔成为数组
let _waypoints = wayPoi.split(';')
if(_waypoints && _waypoints.length>0){
for (let i = 0, _len = _waypoints.length; i < _len; i++) {
let point = {
iconPath: "/static/amap/Waypoint.png",
id: 10+i,
longitude: parseFloat(_waypoints[i].split(",")[0]),
latitude: parseFloat(_waypoints[i].split(",")[1]),
width: 41,
height: 45
}
markers1.push(point)
}
}
that.markers = markers1
// Amap.markers(startPoi,endPoi,wayPoi,function(res){
// that.markers.push.apply(that.markers, res)
// })
uniapp h5 markers的标记点没有图片 function () {↵ vm._update(vm._render(), hydrating);↵ }
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 分享也是一种美德。欢迎加我技术交流QQ群 :811956471 微信小程序中使用地图(map)组件,通过点击(ta...
- 注:微信小程序较为简单,h5移动端稍微麻烦些 准备工作,注册腾讯地图获取key(不唯一) 1.微信小程序 (1.)...