Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在做一个 Android 应用程序,它从LatLng路线的服务器点获取并编写一条折线捕捉到道路。为了获取道路点,我使用了Google API Roads。,但在响应中,我只得到了与我在请求中发送的点相同的点。
LatLng
The request: https://roads.googleapis.com/v1/snapToRoads?interpolate=true&key=AIzaSyCcorJdwrFQp5HpR0she_r3PEVOj1TrUTI&path=43.342592253801136%2C-1.7633818398462608%7C43.333786678427664%2C-1.8170163652393967%7C43.31891938155728%2C-1.9850535434670746
我做错了什么?
谢谢。
我花了 10 分钟才弄清楚这个问题,实际上你的 api 运行良好,但是你发送的数据是错误的,这意味着这些点之间没有可用的路径。
看看这个https://roads.googleapis.com/v1/snapToRoads?interpolate=true&key=AIzaSyCcorJdwrFQp5HpR0she_r3PEVOj1TrUTI&path=43.323579%2C1.960141%7C43.317866%2C1.967716%7C43.318974%2C1.97