Here's the current code snippet:
addpolygon: function(e) {
var vm = this;
var point = {
lat: parseFloat(e.latLng.lat()),
lng: parseFloat(e.latLng.lng())
};
vm.coord.push(point);
vm.replot();
vm.marker = new google.maps.Marker({
position: point,
map: vm.map,
icon: "/fred.png"
});
vm.infowindow = new google.maps.InfoWindow({
content:"<a class=\"btn btn-danger\" @click.native=\"removePoint("+vm.markerid+)\">Remove</a>",
maxWidth: 300
});
vm.bindInfoWindow(vm.marker, vm.map, vm.infowindow);
vm.markers[vm.markerid] = {
marker: vm.marker,
point: point
};
vm.markerid++;
},
When I click on Remove, I want to trigger another function called removePoint.
I have defined it like this:
removePoint: function(id) {
alert("adsf")
},
However, I'm unable to make it work with the above code. Nothing happens when I click on the remove button. Can you help me find a solution?