for (let i in markersData) {
const newMarker = {
id: 1,
iconPath: '../../static/pointDevice.png',
width: 50,
height: 50,
joinCluster: true,
label: {
width: 50,
height: 30,
borderWidth: 1,
borderRadius: 5,
borderColor:'#138FE3',
bgColor: '#ffffff',
anchorX: 0,
anchorY: -10,
content:''
}
}
newMarker.id = i +1
newMarker.latitude = markersData[i].lat
newMarker.longitude = markersData[i].lon
newMarker.label.content = markersData[i].species
newMarker.clusterId = markersData[i].id
this.markerListData.push(newMarker.id)
markers.push(newMarker)
}
this.mapContext.addMarkers({
markers:markers,
clear: true,
complete(res) {
console.log(res,'complete')
},
success(res){
console.log(res,'成功')
}
})
大兄弟,你贴的这个左右分开的代码是想怎么样?
手机真我GT大师探索版