Hey Guyzz when nothing was working for me i planned to take this approach .. and it worked for me.. I took the coordinates from view port and then mapped the same to bounds.. this approach works ..
function codeAddress() {
var address = document.getElementById('address').value;
if(address == null || address== "") {
alert('Address field is Empty.. !');
} else {
geocoder.geocode({
'address' : address
}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
// If geocoder status is OK then locate the geometry,..
var location = results[0].geometry.location
// Obtaining the lat lang of new position on map..
var latlng = new google.maps.LatLng(location.lat(),location.lng());
map.setCenter(location);
// view port gives us the map bounds for a particular location..
**var viewportloc = String(results[0].geometry.viewport);
var res = viewportloc.replace('((','').replace('))','').replace('(','').replace(')','').split(',');
//alert(res[0]+" - "+res[1]+" - "+res[2]+" - "+res[3]);
var sw = new google.maps.LatLng(res[0],res[1]);
var ne = new google.maps.LatLng(res[2],res[3]);
var bounds = new google.maps.LatLngBounds();
bounds.extend(sw);
bounds.extend(ne);
map.fitBounds(bounds);**
addMarker(location);
setonMap(map);
} else {
document.getElementById('address').value = "";
alert('Geocode was not successful for the following reason: ' + status);
}
});
}
}