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

  • <legend id='BIpiY'><style id='BIpiY'><dir id='BIpiY'><q id='BIpiY'></q></dir></style></legend>

    <tfoot id='BIpiY'></tfoot>

    1. <small id='BIpiY'></small><noframes id='BIpiY'>

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

        禁用 GPS 時,Ionic 3 地理定位不起作用

        Ionic 3 geolocation not working when GPS is disabled(禁用 GPS 時,Ionic 3 地理定位不起作用)
          <bdo id='viNsL'></bdo><ul id='viNsL'></ul>
          • <i id='viNsL'><tr id='viNsL'><dt id='viNsL'><q id='viNsL'><span id='viNsL'><b id='viNsL'><form id='viNsL'><ins id='viNsL'></ins><ul id='viNsL'></ul><sub id='viNsL'></sub></form><legend id='viNsL'></legend><bdo id='viNsL'><pre id='viNsL'><center id='viNsL'></center></pre></bdo></b><th id='viNsL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='viNsL'><tfoot id='viNsL'></tfoot><dl id='viNsL'><fieldset id='viNsL'></fieldset></dl></div>

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

                <tbody id='viNsL'></tbody>

                <legend id='viNsL'><style id='viNsL'><dir id='viNsL'><q id='viNsL'></q></dir></style></legend>

                <tfoot id='viNsL'></tfoot>

                  本文介紹了禁用 GPS 時,Ionic 3 地理定位不起作用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我安裝了離子原生地理定位插件

                  I have ionic native geolocation plugin installed

                  "@ionic-native/geolocation": "^4.15.0"
                  

                  我也試過4.6.0"和4.20.0".當我在進入該頁面之前啟用 GPS 時,它工作得非常好.但是當 GPS 未啟用時,它不會要求我打開它,在控制臺上給出錯誤并攜帶未定義的坐標.

                  I have also tried "4.6.0" and "4.20.0". It is working absolutely fine when I keep my GPS enabled before going to that page. But when GPS is not enabled, It won't ask me to turn it ON, gives an error on console and carry undefined coordinates with it.

                  我在constructor/ionViewDidLoad中寫了getCurrentPosition的方法.因此,即使用戶在該頁面上啟用它,該方法也不會調用并且坐標仍然未定義.

                  I wrote the method of getCurrentPosition in constructor/ionViewDidLoad. So even user enable it on that page, the method does not invoke and the coordinates remain undefined.

                  以下是代碼

                  this.geolocation
                    .getCurrentPosition()
                    .then(resp => {
                      console.log(resp);
                      this.longitude = resp.coords.longitude;
                      this.latitude = resp.coords.latitude;
                    })
                    .catch(error => {
                      console.log("Error getting location", error);
                    });
                  

                  我不知道我是否必須手動授予權限或什么?幾個月前我也做過同樣的事情,一切都很好.我第一次遇到這種問題.請幫助我擺脫困境.

                  I don't know if I'll have to give manual permissions or what?? I did the same before a couple of months before and everything was fine. First time I am facing this kind of issue. Please help me to get out of this.

                  推薦答案

                  您應該手動請求權限并請求用戶啟用位置.您可以使用診斷插件 (@ionic-native/diagnostic) 執行此操作.您應該使用以下方法:

                  you should manually ask permission and request the user to enable location. You can do this with the Diagnostic plugin (@ionic-native/diagnostic). You should use the following methods:

                  diagnostic.isLocationEnabled()
                  diagnostic.isLocationAvailable()
                  diagnostic.requestLocationAuthorization()

                  如果您想在獲得權限后更新位置,您可以使用此方法:

                  If you want to update location after permission is granted you you can use this method:

                  diagnostic.registerLocationStateChangeHandler()

                  您可以在此處傳遞回調,檢查位置是否已啟用并且是否可用.

                  You can pass a callback here check if location is enabled and available de what you need.

                  這篇關于禁用 GPS 時,Ionic 3 地理定位不起作用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數據更新 Observable)
                  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 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)
                    <tbody id='XhMk6'></tbody>
                  • <bdo id='XhMk6'></bdo><ul id='XhMk6'></ul>

                    <tfoot id='XhMk6'></tfoot>

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

                          • <legend id='XhMk6'><style id='XhMk6'><dir id='XhMk6'><q id='XhMk6'></q></dir></style></legend>
                          • <i id='XhMk6'><tr id='XhMk6'><dt id='XhMk6'><q id='XhMk6'><span id='XhMk6'><b id='XhMk6'><form id='XhMk6'><ins id='XhMk6'></ins><ul id='XhMk6'></ul><sub id='XhMk6'></sub></form><legend id='XhMk6'></legend><bdo id='XhMk6'><pre id='XhMk6'><center id='XhMk6'></center></pre></bdo></b><th id='XhMk6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='XhMk6'><tfoot id='XhMk6'></tfoot><dl id='XhMk6'><fieldset id='XhMk6'></fieldset></dl></div>
                            主站蜘蛛池模板: 欧美激情久久久 | 午夜丰满少妇一级毛片 | 午夜天堂 | 亚洲永久免费观看 | 99精品免费久久久久久日本 | 欧美日韩国产一区 | 欧美一区二区三区久久精品 | 国产精品视频999 | 国产精品一区视频 | 亚洲精品视频免费 | 国产精品日产欧美久久久久 | 一区二区三区四区在线视频 | 国产一区二区不卡 | 人人九九精 | a级网站| 免费精品 | 国产精品久久国产愉拍 | 网站黄色av | 国产美女在线观看 | 国产一区二区电影 | 国产日韩欧美一区二区 | 视频1区2区 | 99精品视频一区二区三区 | 国产美女一区二区 | 在线视频成人 | 日本一道本视频 | 中文字幕成人免费视频 | 国产羞羞视频在线观看 | 欧洲精品在线观看 | 国产三区在线观看视频 | 色接久久 | 伊人网在线看 | 国产成人精品a视频 | 亚洲精品久久久久久久久久久久久 | 欧美日韩国产综合在线 | 日本黄色激情视频 | 欧美一级久久 | 精品国产免费人成在线观看 | 国产一区二区三区四区在线观看 | 日韩一区二区在线播放 | 四色永久 |