markers 随中心点重新描绘,本地测试版上没问题,ios9.3.3手机拖动,中心 markers无限卡闪
代码:
/*地图视野变化事件*/
mapChange:function(e){
var that = this;
var latitude = that.data.latitude;
var longitude = that.data.longitude;
var mapLaclNum = that.data.mapLaclNum;
if(mapLaclNum>2){
return;
}
mapLaclNum++;
if(e.type == ‘end’){
that.mapCtx.getCenterLocation({
success: function(res){
console.log(res)
that.setData({
longitude: res.longitude
,latitude: res.latitude,
mapLaclNum:mapLaclNum
// ,markers:[
// {
// id: 0
// ,iconPath: “…/…/…/images/local_c.png”
// ,longitude: Number(res.longitude)
// ,latitude: Number(res.latitude)
// ,width: 30
// ,height: 30
// }
// ]
})
}
})
}else if(e.type == “begin”){
that.setData({
mapLaclNum:0,
})
}
},
HTML
<map id=“map4select” scale="{{mapScale}}" class=“mapStyle” controls="{{controlsImg}}" longitude="{{longitude}}" latitude="{{latitude}}" bindregionchange=“mapChange” markers="{{markers}}"></map>