Hi Larry,

Thank you for your message it was very helpful.

I found the solution and it works!!

function addAddressToMap(response) {
 map.clearOverlays();
 if (!response || response.Status.code != 200) {
   alert("Sorry, we were unable to geocode that address");
 } else {

   place = response.Placemark[0];
   point = new GLatLng(place.Point.coordinates[1],
                       place.Point.coordinates[0]);
   marker = new GMarker(point);
   map.addOverlay(marker);

var viewport = new GLatLngBounds;
viewport.extend(new GLatLng(place.ExtendedData.LatLonBox.south,
place.ExtendedData.LatLonBox.west));
viewport.extend(new GLatLng(place.ExtendedData.LatLonBox.north,
place.ExtendedData.LatLonBox.east));
map.setCenter(viewport.getCenter(), map.getBoundsZoomLevel
(viewport));
 }
}




On Aug 2, 3:49 pm, "[email protected]" <[email protected]>
wrote:
> On Aug 2, 6:14 am, capo75 <[email protected]> wrote:
>
>
>
> > Hi,
>
> > I am trying to obtain the same result as this (sorry about the Google
> > api server reject error, I have created 4 new API keys but I still get
> > the error...I will look into this later.)
>
> >http://dev.capisani.co.uk/form.aspx
>
> > If you select Europe the map will be centred for Europe, if you select
> > Italy from the second dropdown the map will be centred for Italy and
> > it willzoomin, if then you select Milan the map willzoomin even
> > more and Milan will be at the center of the map.
>
> > At the moment I am doing the zooming using some if statements based on
> > the selected value in the drop down lists but it's not a nice way of
> > doing this.
>
> > Do you know how I can achieve the same result just using google map
> > API?
>
> If you are willing to wait for the geocoder to return its results,
> there is additional data available which can be used to calculate the
> bestzoomlevel in the "ExtendedData" field:
>
>   "ExtendedData": {
>     "LatLonBox": {
>       "north": 40.8811521,
>       "south": 40.7460351,
>       "east": -96.5745606,
>       "west": -96.8306794
>     }
>
> Your mileage may vary.
>
>   -- Larry- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to