久久久久久久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 地理定位不起作用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

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

                  I have ionic native geolocation plugin installed

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

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

                  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的方法.因此,即使用戶在該頁面上啟用它,該方法也不會調(diào)用并且坐標(biāo)仍然未定義.

                  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);
                    });
                  

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

                  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.

                  推薦答案

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

                  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()

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

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

                  diagnostic.registerLocationStateChangeHandler()

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

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

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

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

                  相關(guān)文檔推薦

                  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 - 使用異步數(shù)據(jù)更新 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 中,如何創(chuàng)建使用 Ionic 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態(tài)元素 - 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>
                            主站蜘蛛池模板: 男人天堂亚洲 | 亚洲区一区二 | 日本黄色三级视频 | 色污污 | 国产精品美女久久久久久久久 | 日韩欧美中文在线 | 亚洲激情成人 | 91精品久久久久 | 午夜av在线播放 | 91亚洲国产成人久久精品麻豆 | 亚洲激情一区二区 | 午夜激情小视频 | 五月天婷婷基地 | 国产手机在线视频 | 免费福利在线观看 | 二区在线观看 | 亚洲免费观看 | 国产一区二区中文字幕 | 黄色免费毛片 | 色综合激情 | 国产欧美日韩在线视频 | 秋霞福利视频 | 日本欧美亚洲 | 久久都是精品 | 欧美福利在线观看 | 亚洲永久精品视频 | 五月天综合网 | 一级香蕉视频 | 黄色在线免费观看视频 | 欧美精品二区三区四区免费看视频 | 日韩成人小视频 | 国产精品免费在线 | 毛片91| 韩日欧美 | 色污污| 日本黄色中文字幕 | 户外少妇对白啪啪野战 | 色片在线观看 | 国产欧美综合一区二区三区 | 免费视频一区二区 | 中文字幕综合网 |