小程序体验版--打开调试位置调取成功,关闭vconsole调取地图失败
小程序体验版,打开位置按钮
wx.request({ url: 'https://apis.map.qq.com/ws/geocoder/v1/?address=' + that.data.merAddress + '&key=K3GBZ-54X6Q-QWP5F-GPYT3-57EK3-LVFVV' , method: 'GET' , // header: {}, success: function (res) { if (res.data.status == 0) { // success console.log( "请求位置成功" ); that.setData({ lng: res.data.result.location.lng, lat: res.data.result.location.lat }); wx.openLocation({ latitude: res.data.result.location.lat, longitude: res.data.result.location.lng, scale: 18, name: that.data.merchantStore.merStoreName, address: that.data.merchantStore.merAddress }) } }, fail: function () { // fail console.log( "请求位置" ); } |
打开调试vConsole可以调取内置地图查看位置,但是关闭vConsole调取失败,打开地图失败
1 回复