Detecting location in air

假装没事ソ 提交于 2019-12-24 17:20:21

问题


In my app location should be detected by my mobile when i am in air. Is it possible to detect location using google or Apple map? If anyone of you faced this scenario please give me some solution.


回答1:


You can try reading Google Maps Elevation API documentation. The example JSON returns this:

    {
   "results" : [
      {
         "elevation" : 1608.637939453125,
         "location" : {
            "lat" : 39.73915360,
            "lng" : -104.98470340
         },
         "resolution" : 4.771975994110107
      }
   ],
   "status" : "OK"
}

So, you have to look for the elevation attribute. Then, you ask if elevation is higher than X (Where X is the needed altitude to consider the user is in air), and you're done.



来源:https://stackoverflow.com/questions/39102169/detecting-location-in-air

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!