久久久久久久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>
                            主站蜘蛛池模板: 在线国产一区二区 | 欧美婷婷 | 欧美黑人激情 | 亚洲一本 | avav在线看 | 成人a视频片观看免费 | 成人片免费看 | 色姑娘综合网 | 红色av社区| 亚洲精品久久久久久久久久久久久 | 国产一区二区三区免费观看在线 | 91高清视频在线观看 | 国产成人精品免高潮在线观看 | 欧美激情一区二区三级高清视频 | 精品久久中文 | 日韩在线免费看 | 一区二区片 | 综合色久 | 91麻豆精品国产91久久久久久 | 欧美一级片 | 色免费看 | 国产99久久久国产精品 | 日韩乱码在线 | 日日夜夜草 | 久草热8精品视频在线观看 午夜伦4480yy私人影院 | 91九色porny首页最多播放 | a黄视频 | 一级片aaa | 玖玖在线免费视频 | 国产国拍亚洲精品av | 在线观看免费观看在线91 | 91精品国产乱码久久蜜臀 | 天天干免费视频 | 天天干天天爱天天 | 中文字幕一级 | 一区二区三区高清不卡 | 2018天天干天天操 | 日本在线黄色 | 欧美视频第二页 | 中文字幕在线一区二区三区 | 91久久久久久久久久久久久 |