gpt4 book ai didi

javascript - Google Maps Directions API 等效 URL

转载 作者:可可西里 更新时间:2023-11-01 01:46:16 27 4
gpt4 key购买 nike

一直在寻找答案,找不到。我正在使用 Google Maps V3 API 获取路线和 map 。这一切都可以......

但我想提供一个沼泽标准的 A 标签链接,指向 Google map 本身的等效方向。我有2个邮政编码。如何根据 2 个邮政编码或我的

生成 Google map 方向 URL
 google.maps.DirectionsService

我将使用该 URL 生成一个“在 google map 上查看”按钮和一个“可打印”按钮。

干杯!艾登

最佳答案

这里有一些用于不同 Google map 功能的标准 HTML 链接。 I keep an updated post here.

//Spaces can be changed to "+" or encoded as "%20".

//Linking to a location (No directions)
https://www.google.com/maps?q=760+West+Genesee+Street+Syracuse+NY+13204

//No starting point (User input required to generate directions).
https://www.google.com/maps?daddr=760+West+Genesee+Street+Syracuse+NY+13204

//With a set location as starting point (Automatically generates directions with no user input required).
https://www.google.com/maps?saddr=760+West+Genesee+Street+Syracuse+NY+13204&daddr=314+Avery+Avenue+Syracuse+NY+13204

//With "My Location" as starting point (Automatically generates directions with no user input required).
https://www.google.com/maps?saddr=My+Location&daddr=760+West+Genesee+Street+Syracuse+NY+13204

//Current Location to Latitude and Longitude
https://www.google.com/maps?saddr=My+Location&daddr=43.12345,-76.12345

//Query search of a Latitude and Longitude
//Also shows setting a default zoom level
https://www.google.com/maps?ll=43.12345,-76.12345&q=food&z=14

//String search as destination
https://www.google.com/maps?saddr=My+Location&daddr=Pinckney+Hugo+Group

关于javascript - Google Maps Directions API 等效 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16326143/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com