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

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

  • <tfoot id='Sz3Pm'></tfoot>
    • <bdo id='Sz3Pm'></bdo><ul id='Sz3Pm'></ul>

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

        沒有 SSL 連接的地理位置

        Geolocation Without SSL connection(沒有 SSL 連接的地理位置)

            <tfoot id='73emv'></tfoot>

            <small id='73emv'></small><noframes id='73emv'>

            • <bdo id='73emv'></bdo><ul id='73emv'></ul>
                <tbody id='73emv'></tbody>

              1. <legend id='73emv'><style id='73emv'><dir id='73emv'><q id='73emv'></q></dir></style></legend>

                <i id='73emv'><tr id='73emv'><dt id='73emv'><q id='73emv'><span id='73emv'><b id='73emv'><form id='73emv'><ins id='73emv'></ins><ul id='73emv'></ul><sub id='73emv'></sub></form><legend id='73emv'></legend><bdo id='73emv'><pre id='73emv'><center id='73emv'></center></pre></bdo></b><th id='73emv'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='73emv'><tfoot id='73emv'></tfoot><dl id='73emv'><fieldset id='73emv'></fieldset></dl></div>
                  本文介紹了沒有 SSL 連接的地理位置的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在開發一個使用地理位置坐標的應用程序.我使用 HTML5 地理定位功能來找出網站訪問者的位置,但問題在于 Chrome 不支持不安全來源的 GeoLocation.

                  I am developing an application which uses geolocation coordinates. I used the HTML5 geolocation feature to find out the location of the site visitor, but the issue is with Chrome which doesnt support GeoLocation on insecure origins.

                    function showPosition(){
                      if(navigator.geolocation){
                          navigator.geolocation.getCurrentPosition(function(position){
                              var positionInfo = "Your current position is (" + "Latitude: " + position.coords.latitude + ", " + "Longitude: " + position.coords.longitude + ")";
                              document.getElementById("result").innerHTML = positionInfo;
                          });
                      } else{
                          alert("Sorry, your browser does not support HTML5 geolocation.");
                      }
                  }
                  

                  這里的代碼 getCurrentPosition 無法使用,因為我的網站沒有連接 SSL.

                  Here is the code getCurrentPosition is not working in as my site is not SSL connected .

                  Chrome 警告: getCurrentPosition() 和 watchPosition() 不再適用于不安全的來源.要使用此功能,您應該考慮將您的應用程序切換到安全來源,例如 HTTPS.

                  Warning by Chrome : getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS.

                  還有其他方法可以在 chrome 上獲取坐標/LatLong 值嗎?[僅在不安全的連接上]

                  Is there any other way to get coordinates/LatLong values on chrome ? [on Insecure connection only]

                  EDIT :它在我的機器上使用 localhost:80 工作,但在 http 上的測試 url 中不工作

                  EDIT : It is working in my machine using localhost:80 but not working in test url which is on http

                  推薦答案

                  var apiGeolocationSuccess = function(position) {
                      alert("API geolocation success!
                  
                  lat = " + position.coords.latitude + "
                  lng = " + position.coords.longitude);
                  };
                  
                  var tryAPIGeolocation = function() {
                      jQuery.post( "https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyDCa1LUe1vOczX1hO_iGYgyo8p_jYuGOPU", function(success) {
                          apiGeolocationSuccess({coords: {latitude: success.location.lat, longitude: success.location.lng}});
                    })
                    .fail(function(err) {
                      alert("API Geolocation error! 
                  
                  "+err);
                    });
                  };
                  
                  var browserGeolocationSuccess = function(position) {
                      alert("Browser geolocation success!
                  
                  lat = " + position.coords.latitude + "
                  lng = " + position.coords.longitude);
                  };
                  
                  var browserGeolocationFail = function(error) {
                    switch (error.code) {
                      case error.TIMEOUT:
                        alert("Browser geolocation error !
                  
                  Timeout.");
                        break;
                      case error.PERMISSION_DENIED:
                        if(error.message.indexOf("Only secure origins are allowed") == 0) {
                          tryAPIGeolocation();
                        }
                        break;
                      case error.POSITION_UNAVAILABLE:
                        alert("Browser geolocation error !
                  
                  Position unavailable.");
                        break;
                    }
                  };
                  
                  var tryGeolocation = function() {
                    if (navigator.geolocation) {
                      navigator.geolocation.getCurrentPosition(
                          browserGeolocationSuccess,
                        browserGeolocationFail,
                        {maximumAge: 50000, timeout: 20000, enableHighAccuracy: true});
                    }
                  };
                  
                  tryGeolocation();
                  

                  這篇關于沒有 SSL 連接的地理位置的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創建使用 Ionic 組件的自定義指令?)
                  How to reload the ion-page after pop() in ionic2(如何在 ionic2 中的 pop() 之后重新加載離子頁面)
                  Javascript Convert an URL to a BASE64 Image(Javascript 將 URL 轉換為 BASE64 圖像)
                  Input validation with pattern Angular 2(使用模式 Angular 2 進行輸入驗證)
                  How to change the css class name dynamically in angular 2(如何在角度2中動態更改css類名)

                      <tfoot id='1NtrM'></tfoot>
                      <legend id='1NtrM'><style id='1NtrM'><dir id='1NtrM'><q id='1NtrM'></q></dir></style></legend>
                      • <small id='1NtrM'></small><noframes id='1NtrM'>

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

                            <tbody id='1NtrM'></tbody>
                            <bdo id='1NtrM'></bdo><ul id='1NtrM'></ul>
                            主站蜘蛛池模板: 成人免费视频网站在线看 | 色婷婷综合久久久中字幕精品久久 | 亚洲精品综合 | 国产一在线观看 | 99精品久久| va在线 | 日韩欧美久久精品 | 午夜av在线 | 日本精品免费在线观看 | 最新中文字幕在线 | 久久久亚洲一区 | 欧美日韩在线一区二区三区 | 日韩高清成人 | 麻豆久久精品 | 日韩毛片在线免费观看 | 亚洲高清视频在线 | 精品久久久久久亚洲综合网 | 久久激情五月丁香伊人 | a久久久久久 | 国产一区二区三区高清 | 欧美视频在线播放 | 亚洲精品一区二区在线观看 | 毛片高清| 毛片的网址| 久久99精品久久久久久国产越南 | 羞羞免费网站 | 亚洲三级国产 | 久久久久一区二区 | 男女免费在线观看视频 | 天天综合久久 | 成人午夜免费网站 | 精品国产一区久久 | 成人激情视频免费在线观看 | 黄色成人在线观看 | 亚洲精品二区 | 免费成人毛片 | 成年人在线视频 | 亚洲乱码一区二区三区在线观看 | av官网在线 | 一级a爱片久久毛片 | 日韩三|