Monday, October 4, 2010

[Google Maps API v2] A wrong locality (city name) using "getFromLocation"

Hi..

I've using Google API 7 and Eclipse..

When getting a locality value with
(GEOdata(latitude=37.3737692,longitude=-122.0862458),
adroid API returns "San Jose" as a city name..

But it is definitely an error because the all return value of this Geo
data is like below..

< Return value about "getFromLocation(37.3737692, -122.0862458,1) >

Address[addressLines=[0:"774-776 Cuesta Dr",1:"Mountain View, CA
94040",2:"USA"],feature=774-776,admin=California,sub-admin=Santa
Clara,locality=San Jose,thoroughfare=Cuesta
Dr,postalCode=94040,countryCode=US,countryName=United
States,hasLatitude=true,latitude=37.3737692,hasLongitude=true,longitude=-122.0862458,phone=null,url=null,extras=null]

As you can see it, zip code is 94040 that is one of zip codes for
Mountan View and San Jose isn't in addressLines..

Does "addresse.get(index).getLocality()" have some problems?

I saw these problems several times...

/// My Codes to get a real address from Geodata..

List<Address> addresses =
mGeocoder.getFromLocation(mMarkGeoPoint.getLatitudeE6()*0.000001,
mMarkGeoPoint.getLongitudeE6()*0.000001, 1);
mAddressString = new String[5];
if (addresses.size() > 0) {

mAddressString[0] = addresses.get(0).getFeatureName();
mAddressString[1] = addresses.get(0).getThoroughfare();
mAddressString[2] = addresses.get(0).getLocality();
mAddressString[3] = addresses.get(0).getAdminArea();
mAddressString[4] = addresses.get(0).getPostalCode();
}

Thank you for your help.

--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate