aruis / cordova-plugin-baidumaplocation

Get device current Location from Baidu Map
https://www.npmjs.com/package/cordova-plugin-baidumaplocation
Apache License 2.0
139 stars 69 forks source link

baidumap_location.getCurrentPosition在安卓中调用无反应,没有报错信息;ios中完美运行 #55

Open subtlecooooder opened 6 years ago

subtlecooooder commented 6 years ago

baidumap_location.getCurrentPosition(function (res) { alert(JSON.stringify(res: ${res}));

  }, function (error) {
    alert(JSON.stringify(`error: ${error}`))
    that.androidPermissions.requestPermissions([
      that.androidPermissions.PERMISSION.ACCESS_COARSE_LOCATION,
      that.androidPermissions.PERMISSION.ACCESS_FINE_LOCATION,
      that.androidPermissions.PERMISSION.ACCESS_LOCATION_EXTRA_COMMANDS]).then(r => {
      // 申请权限成功
      baidumap_location.getCurrentPosition(function (res) {
        alert(JSON.stringify(res));

      });

      }).catch(err => {
        alert(err)
      });
  })
aruis commented 6 years ago

参考这里的 最后一段回复试试呢 https://github.com/aruis/cordova-plugin-baidumaplocation/issues/43

rrandom commented 6 years ago

我这里也出现了,调用多次后定位无反应,手机通知栏一直显示正在搜索GPS

gdongy commented 6 years ago

楼上的问题

我这里也出现了,调用多次后定位无反应,手机通知栏一直显示正在搜索GPS

我这里也出现了,调用多次后定位无反应,手机通知栏一直显示正在搜索GPS

楼上的问题解决了吗,我也遇到了,求指点

garyganyang commented 6 years ago

我也遇到同样问题

maochong513 commented 6 years ago

我android还没测试 但再ios里面碰到问题定位失败 返回{code: -1, message: "Position retrieval timed out."} 这个是什么意思 有人知道吗? Cordova:8.1.2