سؤال

I have two Placemark objects with latitude/longitude and I'd like to get the distance between them.

Is it possible to do using Yandex Maps Api?

Or what is the preferred way of finding the distance? Using formulas/library in JavaScript?

هل كانت مفيدة؟

المحلول

Yes, it's possible. Use coordSystem.geo.getDistance method:

ymaps.coordSystem.geo.getDistance(p1.geometry.getCoordinates(), p2.geometry.getCoordinates())
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top