javascript - 关于 google api 我想在 google API 路线图上显示超过 100 个点

标签 javascript google-api

我想在 google API 路线图上显示 100 多个点.. 我引用此链接显示路线 https://developers.google.com/maps/documentation/roads/inspector但是这个链接不允许我更多感谢 100 个捕捉点来显示路线

最佳答案

根据 API 的概述 overview page说明:

Snap to roads: This service takes up to 100 GPS points collected along a route, and returns a similar set of data with the points snapped to the most likely roads the vehicle was traveling along.

但是,有一些方法可以实现您正在寻找的行为 here .其中指出,对于处理长路径,由于道路捕捉功能限制为每个请求 100 点路径,因此补救措施是产生多个请求,然后:

treat the individual requests as one long path, you should include some overlap, such that the final points from the previous request are included as the first points of the subsequent request. The number of points to include depends on the accuracy of your data

不幸的是,所提供的链接适用于 Google 的 Java 客户端。但是,对于您的应用程序,您可以找到他们的 node.js 示例。 (链接在页面顶部或在他们的 github 页面上)

希望这对您有所帮助!

关于javascript - 关于 google api 我想在 google API 路线图上显示超过 100 个点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42524882/

相关文章:

javascript - 使用 Observable.ajax.post 是否可以捕获 'correct/custom' 错误?

go - 从 golang 代码将文件发送到 Google Drive API 会产生错误 : Unsupported content with type: image/jpeg

jquery - Google API 是否始终位于各自的 URL 上?

java - 创建表记录 - Google Spreadsheets API

php - 使用带有php脚本的google drive api自动刷新 token

php - Google finance API - 无法获取货币汇率

javascript - 键入时根据输入字段动态更改选择选项

javascript - 悬停时更改div颜色

javascript - 虚拟键盘缩放网页

javascript - 动态 Array.map 回调函数的 Typescript 类型