Google Directions API 和 Using maps.google.com 给出不同的响应

编程入门 行业动态 更新时间:2024-10-27 16:24:33
本文介绍了Google Directions API 和 Using maps.google 给出不同的响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

这里 - > https://maps.google/我查询了参数A : antim chauraha,印多尔,中央邦,印度B : India Collection, Indore, Madhya Pradesh, India

Here - > https://maps.google/ I queried for parameters A : antim chauraha, Indore, Madhya Pradesh, India B : India Collection, Indore, Madhya Pradesh, India

并使用 webservice 获取 XML,来自 Direction API 的相同响应

And using the webservice to get as XML, same response from Direction API

http://maps.googleapis/maps/api/directions/xml?origin=ANTIM%20CHAURAHA,Indore,Madhya%20Pradesh,India&destination=INDIA%20COLLECTION,PALSIKAR,Indore,Madhya%20Pradesh,India&sensor=false

这些响应根本不匹配.你会看到距离、方向或任何东西.

Those responses do not match at all. You see the distance, direction or anything.

我做错了什么吗?

推荐答案

Google 地图 使用附加信息来定位您的请求参数".路线 API 使用邮政地址(大部分情况下).

Google Maps uses additional information to locate your "query string". The directions API uses postal addresses (for the most part).

这些看起来都不是一个特别好的地址"A : antim chauraha,印多尔,中央邦,印度B : India Collection, Indore, Madhya Pradesh, India

Neither of these looks like a particularly good "address" A : antim chauraha, Indore, Madhya Pradesh, India B : India Collection, Indore, Madhya Pradesh, India

通过 Google Maps API v3 地理编码器运行它们,它们都解析到同一个地方(印度中央邦印多尔)

Run them through the Google Maps API v3 geocoder, they both resolve to the same place (Indore, Madhya Pradesh, India)

如果您需要像这样解析地点",请使用 Places API 获取坐标,然后使用路线服务获取坐标之间的路线.

If you need to resolve "places" like that, use the Places API to get coordinates, then use the directions service to get directions between the coordinates.

这篇关于Google Directions API 和 Using maps.google 给出不同的响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 06:03:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1130454.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Directions   Google   API   google   maps

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!