1

I am using the following uri's to connect to Google Api from a C# class. I left the address that I am currently having trouble with in it as an example.

http://maps.googleapis.com/maps/api/geocode/xml?address=Mt%20Vernon&sensor=false

http://maps.googleapis.com/maps/api/geocode/xml?address=Mt%20Vernon,%20IN&sensor=false

The first link only returns what appears to be the top 6 results. The second link is the result I actually need. I understand that I can force the user to supply the state, but the requirements that I am under are explicit that only the city need be entered.

I have searched for a way to increase the result set to no avail. At this point I am looking for any ideas short of switching to some other services (which I am not opposed to if google, indeed has this short coming).

Thanks for whatever help you might be able to provide.

4

1 回答 1

0

如果您在搜索参数中包含 USA,则包含来自 Indiana 的 Mt. Vernon 结果:

http://maps.googleapis.com/maps/api/geocode/xml?address=Mt%20Vernon,USA&sensor=false

不确定它是否有帮助,因为它可能对不同的查询有不同的行为,但它确实满足了原始问题。

于 2012-04-03T22:29:26.370 回答