久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <i id='8xG9u'><tr id='8xG9u'><dt id='8xG9u'><q id='8xG9u'><span id='8xG9u'><b id='8xG9u'><form id='8xG9u'><ins id='8xG9u'></ins><ul id='8xG9u'></ul><sub id='8xG9u'></sub></form><legend id='8xG9u'></legend><bdo id='8xG9u'><pre id='8xG9u'><center id='8xG9u'></center></pre></bdo></b><th id='8xG9u'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8xG9u'><tfoot id='8xG9u'></tfoot><dl id='8xG9u'><fieldset id='8xG9u'></fieldset></dl></div>
  1. <tfoot id='8xG9u'></tfoot>

        <bdo id='8xG9u'></bdo><ul id='8xG9u'></ul>

      <legend id='8xG9u'><style id='8xG9u'><dir id='8xG9u'><q id='8xG9u'></q></dir></style></legend>

      <small id='8xG9u'></small><noframes id='8xG9u'>

      phonegap 地理位置總是在超時時失敗

      phonegap geolocation always fail on timeout(phonegap 地理位置總是在超時時失敗)
        1. <i id='CkqnS'><tr id='CkqnS'><dt id='CkqnS'><q id='CkqnS'><span id='CkqnS'><b id='CkqnS'><form id='CkqnS'><ins id='CkqnS'></ins><ul id='CkqnS'></ul><sub id='CkqnS'></sub></form><legend id='CkqnS'></legend><bdo id='CkqnS'><pre id='CkqnS'><center id='CkqnS'></center></pre></bdo></b><th id='CkqnS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CkqnS'><tfoot id='CkqnS'></tfoot><dl id='CkqnS'><fieldset id='CkqnS'></fieldset></dl></div>
            <legend id='CkqnS'><style id='CkqnS'><dir id='CkqnS'><q id='CkqnS'></q></dir></style></legend>
              <bdo id='CkqnS'></bdo><ul id='CkqnS'></ul>
                  <tbody id='CkqnS'></tbody>

              • <tfoot id='CkqnS'></tfoot>

              • <small id='CkqnS'></small><noframes id='CkqnS'>

                本文介紹了phonegap 地理位置總是在超時時失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我在我的應用程序中使用 sencha-touch 2.0 和 phonegap 2.0.0 來檢索用戶的位置.在我的本地主機上運行時,一切正常.但是,當將 .apk 加載到我的 android 15 api 設備(使用 eclipse 和 adt 插件)時,每次調用 getCurrentLocation 或 watchPosition 都不會返回...

                I'm using sencha-touch 2.0 and phonegap 2.0.0 in my app to retrieve user's location. When runing on my locahost, everything works just fine. However, when loading the .apk to my android 15 api's device (using eclipse and the adt plugin), every call to getCurrentLocation or watchPosition never returns...

                這是我的代碼:

                geoOn: function(){
                    var geoReady = navigator.geolocation || undefined;
                
                    var onSuccess = function(position){
                            Top5.app.alert('Geolocation success '+String(position.coords.latitude) + ' ' + String(position.coords.longitude),'Geolocation');
                            var scope = Ext.getCmp('nestedList');
                            scope.updateDistance(position.coords);
                    };
                
                    var onFailure = function(error){Top5.app.alert('Geolocation failed: '+String(error.code) + ' '+String(error.message),'Geolocation');};
                    if (geoReady) {
                        this.watchId = navigator.geolocation.watchPosition(onSuccess ,onFailure,{timeout:6000,maximumAge: 3000,enableHighAccuracy: true});    
                    }
                    else{
                        Ext.device.Geolocation.watchPosition({
                                 frequency: 3000, // Update every 3 seconds
                                 callback: function(position) {
                                        this.updateDistance(position.coords);
                                 },
                                 failure: function() {
                                   console.log('Geolocation Failure!');
                                 },
                                 scope:this
                        });
                    }
                 },
                 geoGet: function(){
                     var geoReady = navigator.geolocation || undefined;
                     if (geoReady) {
                
                         var onSuccess = function(position){
                             Top5.app.alert('Geolocation successful!!!');
                             var scope = Ext.getCmp('nestedList');
                             scope.updateDistance(position.coords);          
                         };
                         var onFailure = function(error){Top5.app.alert('Geolocation failed: '+String(error.code) + ' '+String(error.message),'Geolocation');};
                         navigator.geolocation.getCurrentPosition(onSuccess,onFailure);
                     }
                     else{}
                 },
                 geoOff:function(){
                
                     var geoReady = navigator.geolocation || undefined;
                     if (geoReady) {
                         navigator.geolocation.clearWatch(this.watchId);
                         this.watchId = null;
                     }
                     else{
                         Ext.device.Geolocation.clearWatch();
                     }
                
                 },
                 updateDistance:function(coords){
                     Top5.app.alert('updateDist','');
                     var scope = Ext.getCmp('nestedList');
                     var lat = coords.latitude,lon = coords.longitude;
                     var store = scope.getStore();
                     var i,record;
                     for(i = 0; i < store.data.all.length; i++)
                     {
                         record = store.data.all[i];
                         if(record.data.locationX){
                            record.set('distance',Top5.app.getDistance(record.data.locationX,record.data.locationY,lat,lon).toFixed(3));
                         }   
                     }
                }
                

                更新:所以我走出了我的大樓,它奏效了......我需要更頻繁地外出.
                但是,當我禁用 gps 時,我認為 geoLocation 會使用 wifi 連接找到我的位置 - 但它失敗了(我設置 enableHighAccuracy: false).這是為什么呢?

                UPDATE: So I walked out of my building and it worked... I need to go outside more often.
                However, when I'm disabling the gps, I thought geoLocation will find my location using wifi connection - but it failes (I'm setting enableHighAccuracy: false). Why is that?

                更新:讓我重新表述我的問題:navigator.geolocation.watchPosition 是否可以同時使用 GPS 信號和 wifi/g3 信號?如何僅使用互聯網連接檢測用戶位置?目前,我的代碼僅適用于 GPS,當禁用該選項或信號被阻止時,地理定位不起作用.

                UPDATE: Let me rephrase my question: Does navigator.geolocation.watchPosition suppose to work both with GPS signal and wifi/g3 signals? How can I detect user location using internet connection only? currently, my code is working only with GPS, and when that option disabled or signal is blocked, geolocation isn't working.

                推薦答案

                我已經設法解決了.... 但是,我不知道實際解決了什么問題.我所做的只是改變我模型的一個結構.任何人都可以看到與地理位置的聯系嗎?

                I've managed to work it out.... However , I have no idea what actually solved it. All I've done is to change one of my model's structure. Can anyone see the connection to geolocation?

                這篇關于phonegap 地理位置總是在超時時失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經度計算 X 和 Y)
                Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                CLLocation returning negative speed(CLLocation 返回負速度)
                How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)

                <small id='zKN3M'></small><noframes id='zKN3M'>

                  <bdo id='zKN3M'></bdo><ul id='zKN3M'></ul>

                  • <legend id='zKN3M'><style id='zKN3M'><dir id='zKN3M'><q id='zKN3M'></q></dir></style></legend>
                      <tbody id='zKN3M'></tbody>
                  • <tfoot id='zKN3M'></tfoot>

                        <i id='zKN3M'><tr id='zKN3M'><dt id='zKN3M'><q id='zKN3M'><span id='zKN3M'><b id='zKN3M'><form id='zKN3M'><ins id='zKN3M'></ins><ul id='zKN3M'></ul><sub id='zKN3M'></sub></form><legend id='zKN3M'></legend><bdo id='zKN3M'><pre id='zKN3M'><center id='zKN3M'></center></pre></bdo></b><th id='zKN3M'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zKN3M'><tfoot id='zKN3M'></tfoot><dl id='zKN3M'><fieldset id='zKN3M'></fieldset></dl></div>
                          主站蜘蛛池模板: 国产肉体xxxx裸体784大胆 | 91国内精品| 夜夜骚av | 自拍偷拍福利视频 | 国产精品久久一区二区三区 | 亚洲精品乱码久久久久久蜜桃91 | 亚洲一区二区欧美 | 青娱乐av | 国产三级在线观看视频 | 热久久久久 | 免费看的毛片 | 亚洲欧美中文字幕 | 免费毛片视频 | 欧洲av网站 | 国产成人午夜 | 欧美日韩国产一区二区 | 国产特黄 | 国产草草影院 | 国产成人av网站 | www.狠狠操.com| 91片黄在线观看动漫 | 白白色在线观看 | 国产又黄又粗 | 小日子的在线观看免费第8集 | 日韩在线免费 | 美女国产精品 | 久久国产美女 | 一级黄色大片 | 亚洲黄色影院 | 国产极品在线观看 | 99超碰在线观看 | 日日夜夜精品免费 | 日韩欧美在线播放 | 国产伦精品一区二区 | 97久久久| 免费特级毛片 | 亚洲精品久久久 | 婷婷色av | 丁香花在线观看 | 在线看黄的网站 | 久久久精品一区 |