este es mi codigo de google maps
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; function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(37.4419, -122.1419), 1); map.setMapType(G_HYBRID_MAP); 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, 6); var marker = new GMarker(point, {draggable: true}); map.addOverlay(marker); map.addOverlay(polyline); 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>