http://www.sdsea.top/video.html
调用地图电脑关机?开发者工具中导入官方代码片段,只要含有地图的电脑瞬间cpu跑满,电脑直接关机怎么解决呢,没法正常开发了
2021-06-17解决了吗
扩展主机中错误:spawn E:\node.exe EACCES?[图片]
2021-06-04直接调wx.offLocationChange()然后再注册就不会有重复数据了,调 wx.offLocationChange((result) => {})就会有重复数据,不是太清楚怎么回事
多次调用startLocationUpdateBackground后持续定位会重复多次同时调用开启 startLocationUpdateBackground 后,用stopLocationUpdate关闭,然后再开起后台持续定位 ,onLocationChange 里会同时调用2次 ,如果再关闭定位,然后再开启定位,onLocationChange 里会同时调用3次,以此类推。只要关闭以此再开启 调用次数就会增加。 怎么能再次开启定位时 只调用onLocationChange 一次呢 [图片]
2021-06-01问题解决了吗,方便说说吗
多次调用wx.startLocationUpdateBackground()会出现重重复监听事件?比如我单击按钮 开启后台位置监控调用,再单击关闭后台监控,现在的问题是 开了然后关,再开发现onLocationChange事件触发2次,再关再开就会出现3,4,5次.这是如何避免 //开启后台获取地理位置坐标 async enableLocationUpdateBackground() { const that = this; wx.startLocationUpdateBackground({ success:async res=> { //console.log('开启后台定位', res) Notify({ type: 'success', message: '开启上报定位信息' }); //开始记录 const userId = wx.getStorageSync('userId'); const openId = wx.getStorageSync('openid'); const userInfo = this.data.userInfo; const startloc = await that.getLocation(); const startaddress = await that.reverseGeocoder({ latitude: startloc.latitude, longitude: startloc.longitude }); that.addTrackPath({ "UserId": userId, "TrackingDateTime": moment().format("YYYY-MM-DDTHH:mm:ss.SSS[Z]"), "BeginDateTime": moment().format("YYYY-MM-DDTHH:mm:ss.SSS[Z]"), "Location": JSON.stringify(startloc), "latitude": startloc.latitude, "longitude": startloc.longitude, "Address": startaddress.result.address, "OpenId": openId, "NickName": userInfo.nickName, "AvatarUrl": userInfo.avatarUrl, }) wx.onLocationChange( async res => { //console.log('onLocationChange', res) const loc = await that.reverseGeocoder({ latitude: res.latitude, longitude: res.longitude }); //console.log(loc) that.addTrackPath({ "UserId": userId, "TrackingDateTime": moment().format("YYYY-MM-DDTHH:mm:ss.SSS[Z]"), "Location": JSON.stringify(res), "latitude": res.latitude, "longitude": res.longitude, "Address": loc.result.address, "OpenId": openId, "NickName": userInfo.nickName, "AvatarUrl": userInfo.avatarUrl, }) }); }, fail(res) { that.setData({ enable: false }) console.log('开启后台定位失败', res) Notify({ type: 'danger', message: '开启定位失败' }); Dialog.alert({ message: '请转到设置位置信息[使用小程序期间和离开小程序后]', }).then(() => { wx.navigateTo({ url: '../manage/index', }) }); }, complete: function (res) { // console.log('开启后台定位.complete', res) // wx.openSetting({ // success(res) { // console.log(res.authSetting) // res.authSetting = { // "scope.userInfo": true, // "scope.userLocation": true // } // } // }) }, }); }, //关闭后台获取地理坐标 disableLocationUpdateBackground() { const that = this; wx.stopLocationUpdate({ complete: async (res) => { wx.offLocationChange(res=>{ }) //结束记录 const userId = wx.getStorageSync('userId'); const openId = wx.getStorageSync('openid'); const userInfo = this.data.userInfo; const endloc = await that.getLocation(); const endaddress = await that.reverseGeocoder({ latitude: endloc.latitude, longitude: endloc.longitude }); that.addTrackPath({ "UserId": userId, "TrackingDateTime": moment().format("YYYY-MM-DDTHH:mm:ss.SSS[Z]"), "EndDateTime": moment().format("YYYY-MM-DDTHH:mm:ss.SSS[Z]"), "Location": JSON.stringify(endloc), "latitude": endloc.latitude, "longitude": endloc.longitude, "Address": endaddress.result.address, "OpenId": openId, "NickName": userInfo.nickName, "AvatarUrl": userInfo.avatarUrl, }) Notify({ type: 'primary', message: '停止上报定位信息' }); }, }) },
2021-06-01