Convert Latitude and Longitude into kms

前端 未结 3 730
礼貌的吻别
礼貌的吻别 2021-01-28 19:04

I am building application where i am getting the user\'s latitude and longitude using the below code

          


        
3条回答
  •  悲&欢浪女
    2021-01-28 19:37

    Considering that a latitude and longitude is a specific point, you cannot convert this directly to kilometers, which is a distance i.e. the length separating two points.

    But you can get the distance between two coordinates (lat+long) with a math formula. I am not really good at math, but you could find such formula with a simple search on Google: here is the first result

    You may also find something useful on this topic: How to convert latitude or longitude to meters?

提交回复
热议问题