Here is my function of delete marker, my function delete marker working it delete the marker when i reload the page.
deleteCurrentMarker: function (marker_id) {
//Find and remove the marker from the Array
var self = this;
for (var i = 0; i < self.markers.length; i++) {
if (self.markers[i].id == marker_id) {
//Remove the marker from Map
self.markers[i].setMap(null);
//Remove the marker from array.
self.markers.splice(i, 1);
}
}
},
and here it is my delete function that call on delete button.
deleteSpot: function () {
var self = this;
console.log("Self ====================================>" + JSON.stringify(self));
if (confirm('Are you sure to delete this Spot?')) {
$.getJSON(lighthouse.serviceURL + "Spots/DeleteSpot", {
SPOT_GUID: Spot_Guid,
}, function (response) {
self.hideOndelete();
lighthouse.googleMap.deleteCurrentMarker(self.selectedMarkerID);
}).fail(function (jqxhr, textStatus, error) {
});
}
},