removing previous marker before adding new marker in google maps
问题 I have below code to display marker in the place that I click on map. Its working perfectly and the thing is I want to remove the previous map marker when adding new marker. Where I should make changes to work perfectly. google.maps.event.addListener(map, "click", function (e) { latLng = e.latLng; console.log(e.latLng.lat()); console.log(e.latLng.lng()); image = clientURL + "/common/images/markers/red.png"; console.log("Marker"); marker = new google.maps.Marker({ position: latLng, map: map,