so.. i run into a possibly very common problem.
just started implementing google maps api, and following is my code to resolve a city into lat/lang and center the map there:
function SetMapAddress(address) { // "London, UK" for example
var geocoder = new google.maps.Geocoder();
if (geocoder) {
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var loc = results[0].geometry.location;
document.map.setCenter(new google.maps.LatLng(loc.lat(),loc.lng(), 13));
}
the problem is that i am passing a static zoom (13).
if someone types a name of a country, i'd like to zoom out more. if it is a city, i'd like to zoom in more etc..
the only thing i can think of is to figure out appropriate zoom for every city and country, store them in some hash, and try to figure out which is being used, to pass appropriate zoom.
maybe google thought of a more intelligent approach ?