After a user clicks a position on the map, the following javascript function retrieves a javascript variable named marker containing coordinates.
var marker;
function placeMarker(location) {
if ( marker ) {
marker.setPosition(location);
} else {
marker = new google.maps.Marker({
position: location,
map: map
});
}
}
google.maps.event.addListener(map, 'click', function(event) {
placeMarker(event.latLng);
});
Query What is one way to utilize these coordinates as a form input?
<form method="POST" action="/authors" target="" enctype="multipart/form-data">
...
</form>