2013-04-28 9 views
0

我有經/緯度2個Placemark對象,我想,讓他們之間的距離之間的距離。兩個地標

是否有可能採用Yandex的地圖API做什麼?

或什麼是找到距離的首選方式?在JavaScript中使用公式/庫?

回答

1

是的,這是可能的。使用coordSystem.geo.getDistance方法:

ymaps.coordSystem.geo.getDistance(p1.geometry.getCoordinates(), p2.geometry.getCoordinates())