Hey developers-

 We have a pretty cool change coming out soon for the API Geocoder.
Now, in the KML/JSON outputs, you'll also get information about the
recommended bounding box associated with a geocode. You can then use
that along with map.getBoundsZoomLevel(GLatLngBounds) to set an
appropriate center and zoom after a geocode.

The KML structure would look something like this (with bogus latlngs):
<kml xmlns="http://earth.google.com/kml/2.0";>
<Response>
 <name>US</name>
 <Status>
  <code>200</code><request>geocode</request>
 </Status>
 <Placemark id="p1">
  <address>USA</address>
  <AddressDetails>...</AddressDetails>
  <ExtendedData>
   <LatLonBox xmlns="http://maps.google.com/geo?output=kml";>
    <north>0.000300</north>
    <south>0.000100</south>
    <east>0.000400</east>
    <west>0.000200</west>
   </LatLonBox>
   </ExtendedData>
   <Point><coordinates>0.000000,0.000000,0</coordinates></Point></
Placemark>
 </Response>
</kml>

And here's a real JSON output:
{"name":"-122.073212,37.400665","Status":{"code":
200,"request":"geocode"},"Placemark":[{"id":"p1","address":"Whisman
Elementary, United States","AddressDetails":{"Country":
{"CountryNameCode":"US","CountryName":"United States","AddressLine":
["Whisman Elementary"]},"Accuracy": 1},"ExtendedData":{"LatLonBox":
{"north":37.477838,"south":
37.391718,"east":-122.059105,"west":-122.115674}},"Point":
{"coordinates":[-122.072382,37.428434,0]}}

And some sample code for using the JSON response in
GClientGeocoder.getLocations:
var exData = location.Placemark[0].ExtendedData;
var bounds = exData ? exData.LatLonBox : undefined;
if (bounds) {
  var llbounds = new GLatLngBounds(
                new GLatLng(bounds.south, bounds.west),
                new GLatLng(bounds.north, bounds.east));
  map.setCenter(point, map.getBoundsZoomLevel(llbounds));
}

Anyway, just wanted to give you a heads up, since it affects the HTTP
geocoder output. Pending any technical or legal obstacles, the change
should be out in a few weeks.

- pamela
--~--~---------~--~----~------------~-------~--~----~
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