06/01/2013 Development / java script

<div id="map-canvas">
<div id="map" style="width:100%;height:300px;"></div>
</div>
</div>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true"></script>

geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(40.730885,-73.997383);
var mapOptions = {
    scrollwheel: true,
    zoom: 15,
    center: latlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map"), mapOptions );

var address = 'Hugo Panasco Alvim';
geocoder.geocode(
    { 'address': address},
    function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
            map.setCenter(results[0].geometry.location);

            var latitude = results[0].geometry.location.lat();
            var longitude = results[0].geometry.location.lng();
           
            marker = new google.maps.Marker({
                draggable: true,
                map: map,
                position: results[0].geometry.location
            });
        } else {
            alert('Localização não encontrada.');
        }
    }
);