Calculate km from source to destination using lat n long
I want calculate distance in km from source to destination using latitude and longitude in mvc
Please help me
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit KumarRank #459 · 5.4K reputationPosted Apr 27, 2019, 7:42 PM EDT
Manoj BhoirRank #599 · 4K reputationPosted Apr 27, 2019, 9:52 PM EDT
var sCoord = new GeoCoordinate(sLatitude, sLongitude);
var eCoord = new GeoCoordinate(eLatitude, eLongitude);
return sCoord.GetDistanceTo(eCoord);
The distance is in meters.
You need to reference System.Device.