地图任务返回 2 条记录,其中一条是假的.我能做什么



我正在使用 API 搜索宾夕法尼亚州伊斯顿。发送到mapquest的URL如下所示:

http://www.mapquestapi.com/geocoding/v1/address?key=your_key_here&location=Easton,PA&outFormat=xml&maxresults=1

结果是这些(即使我有maxresults=1(

<lat>40.689353</lat> <lng>-75.216698</lng>

<lat>41.127201</lat> <lng>-79.5411</lng>

我在克拉里昂县找不到伊斯顿。知道为什么它会这样工作,我怎样才能避免这些类型的情况吗?

谢谢你的反对票,真的活该!

我从MapQuest得到了答案。看起来参数名称区分大小写。

不好:

http://www.mapquestapi.com/geocoding/v1/address?key=your_key_here&location=Easton,PA&outFormat=xml&maxresults=1

好:

http://www.mapquestapi.com/geocoding/v1/address?key=your_key_here&location=Easton,PA&outFormat=xml&maxResults=1

最新更新