如何使用设备离线捕获地理位置-Cordova [英] how capturing geolocation with device offline - cordova

查看:91
本文介绍了如何使用设备离线捕获地理位置-Cordova的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用cordova开发应用程序,发现需要获取用户的纬度和经度数据,但是我的应用程序将离线使用(无法访问互联网).

I am developing an application using the cordova and found a need to take the data of latitude and longitude of the User, but my application will be used offline (without internet access).

我有两个问题:

1-如何检查本机是否处于活动GPS状态?

1 - How to check if the unit is active GPS or not?

2-如何在没有互联网连接的情况下离线获得经纬度?有可能吗?

2 - How I can get the latitude and longitude Offline without internet connection? It's possible?

推荐答案

我会尽力回答您的问题

1.--您可以使用 PhoneGap GeoLication API 检查位置,以及是否启用了GPS.也请检查一下:使用PhoneGap来检查GPS是否已启用

1.- There you have the way to use PhoneGap GeoLication API to check location, and if GPS is enabled. Check this too: Use PhoneGap to Check if GPS is enabled

2.-是的,GPS是一个卫星系统,可让您的设备跟踪其在地球上的当前位置.它独立于您的手机运营商,然后独立于Internet连接.然后,您的设备将能够知道其位置. HTML5离线模式和地理位置

2.- Yes, the GPS is a satellite system that allows your device to track it´s current position on earth. It´s independent from your Cellphone operator, and then, from the Internet Connection. Then, your device will be able to know it´s position. HTML5 offline mode and geolocation

此外,您可能需要连接Internet才能显示地图.离线地图的解决方案不多.只是工匠们: http://davidrs.com/wp/phonegap -3-0-leaflet-offline-maps/

In addition, you´ll probably need Internet connection to show a map. There are not much solutions for offline maps. Just artisan ones: http://davidrs.com/wp/phonegap-3-0-leaflet-offline-maps/

希望对您有帮助

记住:打开飞机模式时,大多数设备也会关闭GPS天线.

REMEMBER: When turning on plane mode, most of devices will turn off GPS antenna too.

这篇关于如何使用设备离线捕获地理位置-Cordova的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆