如何在没有互联网的情况下获得phonegap的地理位置? [英] How to get the geolocation in phonegap without internet?

查看:190
本文介绍了如何在没有互联网的情况下获得phonegap的地理位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phonegap为手机开发Android应用程序。
我使用以下代码:

I am using phonegap to develop android app for mobile. I am using following code :

navigator.geolocation.getCurrentPosition(success,error,{enableHighAccuracy:true,timeout: 30000,maximumAge: 30000});

仍然告诉他们不能给gps。没有互联网就会出现位置错误。
如果互联网是他们的,那么它会提供适当的lonlat。

still it tells can't give gps . It gives position error without internet . If internet is their then it gives proper lonlat.

没有互联网我应该如何使这项工作?
是否只能通过phonegap本身?

Without internet how i should make this work?? Is it possible only from phonegap itself??

我收到错误代码3.

推荐答案

我通过为android编写phonegap原生插件使其成功。我在java中引用了位置管理器,它可以在没有互联网的情

I made it work by writing phonegap native plugin for android . I referred location manager in java , which works without internet .

这篇关于如何在没有互联网的情况下获得phonegap的地理位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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