Something that took me a while to figure out was how to drag a marker on a map to a new position and then retrieve it's lat/lng (version 3).

This assumes you have the map variable set as an instance of google.maps.Map and latlng which is the current position to show on the map as an instance of google.maps.LatLng.

var marker = new google.maps.Marker({
	map: map,
	draggable: true,
	position: latlng

google.maps.event.addListener(marker, 'dragend', function(){
	var position = marker.getPosition();
	map.setCenter(position); // set the map center to it's new position
	alert( + ',' + position.lng()); // here are the new lat/lng strings