以下是后台定位代码 startLocationChange() { const that = this const d = new Date() //检查是否已开启后台定位请求 if (!APP.globalData.startLocation) { wx.startLocationUpdateBackground({ success: (res) => { APP.globalData.startLocation = true wx.offLocationChange((result) => {}) wx.onLocationChange((result) => { const second = d.getSeconds() if (second % 30 === 0) { const markers = that.data.markers const polyline = that.data.polyline const timestamp = d.getTime() //获取本地points缓存并存入变量 let points = wx.getStorageSync('points') points = points ? JSON.parse(points) : [] if (Object.keys(result).length > 0) { markers[0].latitude = result.latitude.toFixed(6) markers[0].longitude = result.longitude.toFixed(6) that.setData({ markers }) } //设置缓存用于5分钟上传 points.push({ latitude: markers[0].latitude, longitude: markers[0].longitude, timestamp: parseInt(timestamp / 1000) }) wx.setStorage({ key: 'points', data: JSON.stringify(points) }) //合并30秒获取的points数据到polyline polyline[0].points.push({ latitude: markers[0].latitude, longitude: markers[0].longitude, timestamp: parseInt(timestamp / 1000) }) that.setData({ polyline }) } }) }, fail: (res) => { console.log(res); } }) } },
后台获取定位轨迹乱跳的问题?使用 wx.onLocationChange获取定位数据,每30秒为有效数据。然后展示为polyline,为什么会出现定位乱跳的问题,如下图效果 [图片][图片][图片]
2021-11-17我现在做的一个业务也是,同样的素材media_id变了。请问是啥原因
调用获取永久素材列表接口时,一个item里面的media_id字段值不是唯一的吗,还会变吗?https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html
2021-01-14