Refresh map marker

Hi

I'm selecting the location from map by clicking on map which places one marker on map and then stores it at storage using below code

Every thing is working fine except that I only can place the marker for one time and can't move it or adjust location in case I selected wrong location . I went through many posts and I see that setting the marker would help .
How can I refresh the selection of marker or moving it .

----
var placedMarkers = 0;
var availableMarkersToPlace = 1;
setTimeout( function(){
if(placedMarkers >= availableMarkersToPlace)
return;
placedMarkers++;
var map = Appery("google_map").gmap;
google.maps.event.addListenerOnce(map, 'click', function(event) {
localStorage.setItem('selectedLat', event.latLng.lat());
localStorage.setItem('selectedLng', event.latLng.lng());
placeMarker(event.latLng,map);
alert(event.latLng);
});

}, 1000);

-----
1 person has
this question
+1
Reply