We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
由于 Google 地图使用纬度和经度,因此您必须转换为您首选的测量系统才能获得直线距离。
这里使用公里;
但是,通过 Google Maps v2 API,您可以从路线获取方向数据。查看 GDirections 以获取 API 参考。我在一个项目中使用过它,效果很好。
Since Google Maps uses latitude and longitude, you have to do a conversion to your preferred measure system to get the distance as the crow flies.
Here's one that uses kilometers;
However, from the Google Maps v2 API you can get directional data from routes. Look into GDirections for the API reference. I've used it in one project, and it works fine.
不知道它是否有帮助,但 Wolfram 允许您查询距离(以及其他功能),例如:
给您这个 answer
但是您也可以查询坐标,因此也许您可以通过用户单击地图并查询以下内容来获取坐标
:给你这个结果< /a>
Don't know if it may helps, but wolfram allows you to query distances (among other features), like:
gives you this answer
But you can also query for coordinates, so maybe you can get the coordinates by users click on your map and query something like:
Which gives you this result
您也可以使用此 MeasureTool for Google Maps
https://github.com/zhenyanghua/MeasureTool-GoogleMaps -V3
例如,引用
geometry
库,然后引用varmeasureTool = new MeasureTool(map);
。这是一个实时演示
You could as well this MeasureTool for Google Maps
https://github.com/zhenyanghua/MeasureTool-GoogleMaps-V3
For example, reference the
geometry
library and thenvar measureTool = new MeasureTool(map);
.Here is a live demo