问题
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