|
@@ -66,13 +66,20 @@
|
|
} else {
|
|
} else {
|
|
var icon = require("$project/assets/img/map_1.png");
|
|
var icon = require("$project/assets/img/map_1.png");
|
|
}
|
|
}
|
|
- markArr.push(new AMap.Marker({
|
|
|
|
|
|
+ var marker=new AMap.Marker({
|
|
map: map,
|
|
map: map,
|
|
position: lineArr[index],
|
|
position: lineArr[index],
|
|
icon: icon,
|
|
icon: icon,
|
|
offset: new AMap.Pixel(-26, -13),
|
|
offset: new AMap.Pixel(-26, -13),
|
|
autoRotation: true,
|
|
autoRotation: true,
|
|
- }))
|
|
|
|
|
|
+ extData: item
|
|
|
|
+ });
|
|
|
|
+ markArr.push(marker)
|
|
|
|
+
|
|
|
|
+ AMap.event.addListener(marker, 'click', function(e) {
|
|
|
|
+ var cur = JSON.parse(JSON.stringify(e.target.getExtData()));
|
|
|
|
+ console.log(cur)
|
|
|
|
+ });
|
|
})
|
|
})
|
|
map.add(markArr);
|
|
map.add(markArr);
|
|
|
|
|