bueno me autorespondo... lo he logradoo!!!!
aqui va mi codigo espero que le sea de utilidad a alguien
Código HTML:
<script src="http://maps.google.com/maps?file=api&v=2&key=AIzaSyA07VHJApYzXc3uJgFEk4l04KaSABLyaVA"
type="text/javascript"></script>
<script type="text/javascript">
var map = null;
var geocoder = null;
var lat=null;
var long=null;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 1);
map.setUIToDefault();
geocoder = new GClientGeocoder();
}
}
function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 15);
var marker = new GMarker(point, {draggable: true});
map.addOverlay(marker);
GEvent.addListener(marker, "dragend", function() {
document.getElementById('lat').value=marker.getPoint().lat();
document.getElementById('long').value=marker.getPoint().lng();
});
GEvent.addListener(marker, "click", function() {
document.getElementById('lat').value=marker.getPoint().lat();
document.getElementById('long').value=marker.getPoint().lng();
});
GEvent.trigger(marker, "click");
}
}
);
}
}
</script>