Google Maps API:在地图上获取两个地点的距离和地图 [英] Google Maps API: get two locations distance and plot on map

查看:201
本文介绍了Google Maps API:在地图上获取两个地点的距离和地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Google地图新手。我想要从一个地方到另一个地方的距离,并将其绘制在地图上。



例如:Place1和Place2
距离 - xxx Km(xx英里)
并将其绘制在地图上。



看看 使用几何图形库 computeDistanceBetween()函数。如果您没有坐标,请使用 Geocoder 获取它们。



示例 (根据文档中的示例


I am new at Google Maps. I want to the get distance from one place to another place and plot it on a map.

e.g: Place1 and Place2 Distance - xxx Km (xx miles) and plot it on map.

Please take a look.

解决方案

Use the geometry library computeDistanceBetween() function. If you don't have the coordinates, use the Geocoder to get them.

Example (based off of the example in the documentation)

这篇关于Google Maps API:在地图上获取两个地点的距离和地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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