markers: [{
iconPath: "../../img/bike.png",
id: 0,
latitude: 32.02984542637893,
longitude: 120.87840606613159,
width: 24,
height: 34
},
{
iconPath: "../../img/bike.png",
id: 1,
latitude: 32.02984542637123,
longitude: 120.87840606613122,
width: 24,
height: 34
}]
网友回复:
你试试经纬度相距远一点,估计是重叠了
还是不行 呀~~~~~~~~~~~~~~
你贴个map组件和marker的js 代码图片出来看看
<map class='map_w' id="myMap" markers="{{markers}}" style='height:{{screenHeight}}px;' controls="{{controls}}" longitude='109.518198' latitude='18.257981' bindregionchange="regionchange" show-location>
</map>
markers_new = [{
iconPath: "../../img/bike.png",
id: 0,
latitude: 32.02984542637893,
longitude: 120.87840606613159,
width: 24,
height: 34
},
{
iconPath: "../../img/bike.png",
id: 1,
latitude: 32.02984542123123,
longitude: 120.87840606123123,
width: 24,
height: 34
}];
that.setData({
markers: markers_new
})
我看了你的那个位置,真的重叠了。给你两经纬度
la:23.15239951121;long:113.36770856218
la:23.15319565481; long:113.368644799478
你测一下这两个位置
markers_new = [{
iconPath: "../../img/bike.png",
id: 0,
latitude: 23.15239951121,
longitude: 113.36770856218,
width: 24,
height: 34
},
{
iconPath: "../../img/bike.png",
id: 1,
latitude: 23.15319565481,
longitude: 113.368644799478,
width: 24,
height: 34
}];
that.setData({
markers: markers_new
})
这两个位置还是只显示一个图标呢
你找找是不是还有什么地方setData了那个markers。或者你在wxml显示一下那个markers是不是正确的
代码应该是没什么问题,markers我就setDate过一次
爱盈利-运营小咖秀(www.aiyingli.com) 始终坚持研究分享移动互联网App运营推广经验、策略、全案、渠道等纯干货知识内容;是广大App运营从业者的知识启蒙、成长指导、进阶学习的集聚平台;
想了解更多移动互联网干货知识,请关注微信公众号运营小咖秀(ID: yunyingshow)