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

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

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

        • <bdo id='hlMtX'></bdo><ul id='hlMtX'></ul>
      1. <tfoot id='hlMtX'></tfoot>
        <legend id='hlMtX'><style id='hlMtX'><dir id='hlMtX'><q id='hlMtX'></q></dir></style></legend>

        android上的javascript地理定位不起作用

        javascript geolocation on android doesn#39;t work(android上的javascript地理定位不起作用)

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

              <tbody id='Y7iXT'></tbody>
            <legend id='Y7iXT'><style id='Y7iXT'><dir id='Y7iXT'><q id='Y7iXT'></q></dir></style></legend>
            <i id='Y7iXT'><tr id='Y7iXT'><dt id='Y7iXT'><q id='Y7iXT'><span id='Y7iXT'><b id='Y7iXT'><form id='Y7iXT'><ins id='Y7iXT'></ins><ul id='Y7iXT'></ul><sub id='Y7iXT'></sub></form><legend id='Y7iXT'></legend><bdo id='Y7iXT'><pre id='Y7iXT'><center id='Y7iXT'></center></pre></bdo></b><th id='Y7iXT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Y7iXT'><tfoot id='Y7iXT'></tfoot><dl id='Y7iXT'><fieldset id='Y7iXT'></fieldset></dl></div>

              <bdo id='Y7iXT'></bdo><ul id='Y7iXT'></ul>
                • <tfoot id='Y7iXT'></tfoot>
                • 本文介紹了android上的javascript地理定位不起作用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在開發一個依賴于提取移動用戶的地理位置數據的網站.我通過以下方式以典型方式進行操作:

                  I am developing a website that relies on pulling the geolocation data of a mobile user. I am doing it the typical way via:

                  function initialize() {
                     if(window.google && google.gears) {
                          var geo = google.gears.factory.create('beta.geolocation');
                          geo.getCurrentPosition(useLocation, errorOnLocate);
                     }
                     else if(navigator.geolocation) {
                         navigator.geolocation.getCurrentPosition(useLocation, errorOnLocate);
                     }
                     else {
                         alert("no geo found");
                     }
                  }
                  
                  function errorOnLocate(message)
                  {
                      alert(message);
                      zoomTo(-34.397, 150.644);
                  }
                  

                  即使我切換地理定位方法順序,這總是會在 errorOnLocate 函數中出現 [object PositionError] 失敗.

                  This always fails with [object PositionError] in to the errorOnLocate function, even if I switch the geolocation method order.

                  這是使用任何內置瀏覽器的 HTC Hero 和 android 2.1.我的 gps 已打開,我已指示瀏覽器允許網站查看我的位置.手機自帶的谷歌地圖原生應用程序的位置"功能可以很好地獲取我的位置

                  This is on an HTC Hero with android 2.1 using whatever browser is built in. My gps is on and I have instructed the browser to allow websites to view my location. The "location" feature on the google map native application that comes on the phone picks up my location just fine

                  如果我在個人計算機上使用 FireFox 3.5 訪問我的網站,它會正確找到我的位置.(我相信它使用了 ip 和 ap 數據點的組合).無論哪種方式,它都使用相同的 javascript.

                  Further more if I visit my site using FireFox 3.5 on my personal computer it will find my location correctly.(I believe it uses a combination of ip and ap data points). Either way, it uses the same javascript.

                  這是瀏覽器中的 html/js,而不是本機應用程序.此外,確切的錯誤消息是最后一個位置提供程序被禁用"

                  This is html/js in a browser, not a native app. Also the exact error message is 'The last location provider was disabled'

                  推薦答案

                  這是從 WebView 還是從 Android 瀏覽器應用程序訪問的?如果來自 WebView,您可能需要通過 Java 調用啟用地理定位.請參閱 WebView 參考.

                  Is this being accessed from a WebView or from the Android Browser app? If from a WebView, you may need to enable geolocation via a Java call. See the WebView reference for that.

                  否則,我不確定您的 JS 到底出了什么問題,但我知道這里的 HTML+JS 適用于 Android 瀏覽器:

                  Otherwise, I'm not sure precisely what's wrong with your JS, but here's HTML+JS that I know works with the Android browser:

                  <!DOCTYPE html> 
                  <html> 
                  <head> 
                    <script type="text/javascript"> 
                  function watchLocation(successCallback, errorCallback) {
                    successCallback = successCallback || function(){};
                    errorCallback = errorCallback || function(){};
                  
                    // Try HTML5-spec geolocation.
                    var geolocation = navigator.geolocation;
                  
                    if (geolocation) {
                      // We have a real geolocation service.
                      try {
                        function handleSuccess(position) {
                          successCallback(position.coords);
                        }
                  
                        geolocation.watchPosition(handleSuccess, errorCallback, {
                          enableHighAccuracy: true,
                          maximumAge: 5000 // 5 sec.
                        });
                      } catch (err) {
                        errorCallback();
                      }
                    } else {
                      errorCallback();
                    }
                  }
                  
                  function init() {
                    watchLocation(function(coords) {
                      document.getElementById('test').innerHTML = 'coords: ' + coords.latitude + ',' + coords.longitude;
                    }, function() {
                      document.getElementById('test').innerHTML = 'error';
                    });
                  }
                    </script> 
                  </head> 
                  
                  <body onload="init()"> 
                    <div id="test">Loading...</div> 
                  </body> 
                  </html>
                  

                  這篇關于android上的javascript地理定位不起作用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='8aJCK'></small><noframes id='8aJCK'>

                • <legend id='8aJCK'><style id='8aJCK'><dir id='8aJCK'><q id='8aJCK'></q></dir></style></legend>

                      <bdo id='8aJCK'></bdo><ul id='8aJCK'></ul>
                        <i id='8aJCK'><tr id='8aJCK'><dt id='8aJCK'><q id='8aJCK'><span id='8aJCK'><b id='8aJCK'><form id='8aJCK'><ins id='8aJCK'></ins><ul id='8aJCK'></ul><sub id='8aJCK'></sub></form><legend id='8aJCK'></legend><bdo id='8aJCK'><pre id='8aJCK'><center id='8aJCK'></center></pre></bdo></b><th id='8aJCK'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8aJCK'><tfoot id='8aJCK'></tfoot><dl id='8aJCK'><fieldset id='8aJCK'></fieldset></dl></div>
                          <tfoot id='8aJCK'></tfoot>
                              <tbody id='8aJCK'></tbody>
                          • 主站蜘蛛池模板: 日本久久久影视 | 国产精品大片在线观看 | 久久中文字幕一区 | 亚洲精品视频免费 | 中文字幕国产一区 | 狠狠狠色丁香婷婷综合久久五月 | 一区二区亚洲 | 国产成人精品一区二区三区网站观看 | 秋霞国产 | 久久久看 | 波多野结衣在线观看一区二区三区 | 欧美久久视频 | 一区二区三区高清 | 天堂一区在线观看 | 国产免费一级一级 | 91欧美激情一区二区三区成人 | 一区二区在线 | 九九热在线视频免费观看 | 久草新在线 | 国产农村妇女毛片精品久久麻豆 | 国产成人免费视频网站视频社区 | 久久精品亚洲精品国产欧美 | 成人在线视频网 | 欧美综合在线视频 | 日本激情视频在线播放 | 欧美一级片在线播放 | 中文字幕三区 | 久久乐国产精品 | 日韩欧美在线播放 | 亚洲网视频 | 亚洲精品一区中文字幕 | 日本三级播放 | 日韩国产精品一区二区三区 | 拍真实国产伦偷精品 | 亚洲在线 | 色偷偷噜噜噜亚洲男人 | 中文无吗| 综合久久久 | 成人免费在线观看视频 | 波多野结衣中文字幕一区二区三区 | 欧美一级淫片免费视频黄 |