On Aug 26, 6:25 pm, Ben Appleton <
apple...@google.com> wrote:
> If instead I select an item from your drop-down menu, you geocode the
> address correctly but then call fitMap without the address.:
>
> 24 function fitMap (map) {
> 25 var bounds = new google.maps.LatLngBounds();
> 26 map.fitBounds(bounds);
> 27 //map.set_zoom(map.getBoundsZoomLevel(bounds));
> 28 //map.set_zoom(map.getBoundsZoomLevel(bounds));
> 29 map.set_center(bounds.getCenter());
> 30
> 31}
>
> Line 25 creates an empty LatLngBounds.
> Line 26 fits the map to the empty LatLngBounds. That causes the map
> to zoom out to level 0.
>
> You will need to call map.fitBounds() with the LatLngBounds returned
> by the Geocoder.
>