我是角度贴图中的新手。当我在相同坐标处有两个标记时出现问题。我无法点击或看到两个标记。请帮助我。
这是.js: -
this.map = {
center: {
latitude: -33.86,
longitude: 151.2094
},
zoom: 7
};
this.markers = [{
id: 0,
latitude: -34,
longitude: 151
}, {
id: 1,
latitude: -34,
longitude: 151
}];
this.f = f.bind(this); // Binding not needed if f uses g instead of this.g
this.g = g;
function f(marker, eventName, model, eventArgs) {
$window.alert(
'marker position: ' + marker.getPosition().toUrlValue() + '\n' +
'event name: ' + eventName + '\n' +
'model id: ' + model.id + '\n' +
'mouse event position: ' + eventArgs[0].latLng.toUrlValue());
this.g();
}
function g() {
$window.alert('other method')
}
HTML: -
<ui-gmap-google-map center="mc.map.center" zoom="mc.map.zoom">
<ui-gmap-markers models="mc.markers" coords="'self'" click="mc.f">
</ui-gmap-markers>
</ui-gmap-google-map>
这是plunker: -