这是我的删除标记功能,我的功能删除标记工作,当我重新加载页面时删除标记。
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);
}
}
},
这里是我的删除功能,调用删除按钮。
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) {
});
}
},