为什么wx.getLocatin总是报错:errCode: 404?
发布于 6 年前 作者 bxue 15024 次浏览 来自 官方Issues

wx.getLocatin总是报错:errCode: 404, errMsg: “getLocation:fail:ERROR_SERVER_NOT_LOCATION”。尤其是在4G网络时。最开始一直用都没问题,代码没动,就最近出现的问题。当我换成室内wifi时就不会报这个错误,很是奇怪,请求官方解决这个问题。手机是小米8

function getLocation() {

    wx.showLoading({

        title: ‘正在获取定位…’,

        mask: true

    });

    wx.getLocation({

        type: ‘gcj02’,

        success: function (res) {

            debugLog(‘坐标:’ + res.latitude + ‘–’ + res.longitude);

            getLocal(res.latitude, res.longitude);

        },

        fail: function (res) {

            wx.hideLoading();

            wx.showToast({

                title: ‘位置获取失败’,

                icon: ‘none’

            });

        }

    });

}

3 回复

type 换成 wgs84

赞同

华为有个机型也出现过


按照楼上的建议将type改成wgs84 还是有这个问题存在么?必现的么??

type 换成 wgs84 呢?

回到顶部