如何添加中途停留:对于Google Maps Embed中的航路点为false [英] How to add stopover:false for waypoints in Google Maps Embed

查看:99
本文介绍了如何添加中途停留:对于Google Maps Embed中的航路点为false的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为当前正在研究的项目寻找解决方案:

I've been searching for a solution on a project that I'm currently working on:

有用户可以根据需要选择的场所A和场所B.然后,这些地点将通过以下链接转移到嵌入的Google地图中:

There is place A and place B that a user can choose as needed be. These places will then be transferred to google maps embed via the following link:

https://www.google.com/maps/embed/v1/directions?key={$key}&origin={$origin}&destination={$destination}&avoid=tolls&mode=driving&waypoints=stopover:false|{$waypoints}"

此外,添加了航路点.我想要的是正在显示从位置A到位置B的方向,并且在地图上显示航路点,而不是位置A和位置B之间的实际路线的一部分.

Additionally, waypoints are added. What I want is that the directions is being displayed from place A to place B and the waypoints are shown on the map without being part of the actual route between place A and place B.

我发现函数"stopover:false",但是不能像上面使用的那样工作.

I've found the function "stopover:false" but that is not working as used above.

我现在的问题是:我不希望航路点成为计算出的路线的一部分,但看来这只是在与js版本的Google地图配合使用. 那有可能吗?如果是,我可以以某种方式告诉航点(不带js)中途停留应该是假的吗?

My question now: I don't want the waypoints to be part of the calculated route but it seems that is just working with the js version of google maps. Is that even possible? If yes, can I somehow tell the waypoints (without js) that stopover is supposed to be false?

我研究了不同的主题,例如: Google地图中嵌入API的多个亮点 如何在googlemaps网址中设置航点 Google MAPS航路点

I've looked into different topics such as: Several highlights in google maps embed API How to set waypoints in the googlemaps url Google MAPS waypoints

但是我似乎无法找到嵌入api的答案.

But I can't seem to find a answer for the embed api.

提前谢谢!

推荐答案

如果我正确理解这一点,我认为您需要通过:在每个不希望成为中途停留地的航路点添加(并摆脱中途停留地" :错误的").例如

If I understand this correctly, I think you need to add via: to each waypoint you don't want to be a stopover (and get rid of "stopover:false"). E.g.

https://www.google.com/maps/embed/v1/directions?origin = Boston,MA& destination = Concord,MA& waypoints = via:MACharlestown,MA |通过:Lexington,MA& key =

这篇关于如何添加中途停留:对于Google Maps Embed中的航路点为false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆