如何使用离散地址组件查询 Google 地图的方向?

发布于 2024-09-15 20:48:34 字数 288 浏览 2 评论 0原文

我想构建一个用于行车路线的 Google 地图查询,但我的应用程序的代码结构需要单独的字段。也就是说,我不能说

?saddr=100+Main+St,Anytown,PA,02154

相反,我需要说

?saddr=100+Main+St&scity=Anytown&sstate=PA&szip=02154

我可以更改查询字符串参数的名称,但我不能省略它们。

有人知道谷歌会接受什么吗?

I want to build a Google Maps query for driving directions, but the code structure of my application requires separate fields. That is, I can't say

?saddr=100+Main+St,Anytown,PA,02154

Instead I need to say

?saddr=100+Main+St&scity=Anytown&sstate=PA&szip=02154

I can change the names of the querystring parameters, but I can't omit them.

Anybody know what Google will accept?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

久光 2024-09-22 20:48:34

Google 地图将忽略它无法识别的参数,因此您可以在 saddr 中创建地址并发送其他参数。

?saddr=100+Main+St+Anytown,+PA+02154&scity=Anytown&sstate=PA&szip=02154

Google maps will ignore the parameters it doesn't recognize so you can create the address in saddr and send the other parameters too.

?saddr=100+Main+St+Anytown,+PA+02154&scity=Anytown&sstate=PA&szip=02154
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文