- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想知道是否有人可以帮助我解决这一问题。
我有一个基于谷歌地图的脚本来计算行程。我想知道是否可以获取此行程的数组,例如每 1 公里的经纬度。如果行程长100公里,我将得到一个包含100个数据的数组
我需要它,因为我想建议行程附近的积分兴趣。示例:https://roadtrippers.com/
最佳答案
DirectionsService 类将为您提供 DirectionsResult object 的响应。该对象有一个名为 overview_path
的属性,从文档中可以看出:
An array of LatLngs representing the entire course of this route. The path is simplified in order to make it suitable in contexts where a small number of vertices is required (such as Static Maps API URLs).
您可以使用它们执行地点搜索(使用 places library )以获取 overview_path
数组中返回的每个 LatLng 半径范围内的兴趣点等。
示例:
var request = {
origin: start_point,
destination: end_point,
travelMode: google.maps.TravelMode.DRIVING
};
var directionsService = new google.maps.DirectionsService();
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
var path = (response.routes[0].overview_path);
}
});
关于javascript - 从谷歌地图行程中获取纬度经度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24527772/
我开发了一个 Android 应用程序,允许实时跟踪用户在 map 上制作的类(class)(Google Map Android V2),我接下来要做的是在类(class)结束后我想给例如,用户有机
我一直在bing / google(布尔)搜索中,发现一些命中(主要是在stackoverflow上),并且尝试使用建议的解决方案没有任何运气。 我正在使用Java 8和DBUnit 2.5.1和my
我有一个String[][]。所以它基本上看起来像这样: { { "Dublin", "NYC"}, { "Moscow", "Los-Angeles"}, { "London", "Pa
我是一名优秀的程序员,十分优秀!