onLoad: function (options) {
var newPoint = {};
var that = this;
for(var i = 0;i < this.data.points.length;i++){
newPoint = {
iconPath: "/resources/others.png",
id: i,
latitude: this.data.points[i].latitude,
longitude: this.data.points[i].longitude,
width: 50,
height: 50,
};
that.data.markers.push(newPoint);
console.log(newPoint);
}
console.log(this.data.markers);
},
|
onLoad这里我是这样写的,最后打印在console的this.data.markers也是有新数据的。。如果有错误,那请问应该改动哪里呢?