I have just updated my code from v2 to v3. Every thing is working but the function map.fitBounds();
Here is my sample code
var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': 'your address'}, >function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var newPoint = new google.maps.LatLng(results[0].geometry.location.lat(), >results[0].geometry.location.lng()); markerBounds.extend(newPoint); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); } else { alert('Geocode was not successful for the following reason: ' + status); } }); map.fitBounds(markerBounds);
}
I have found that this code looks fine but here fitBounds() will not work. The required change is mention in the answer below.