好像没有解决方案,实时更新运动轨迹也不断闪烁,makers也好,polyline也好,只支持数据整体更新,不支持局部更新,像类似这种写法是不生效的: let points = this.data.lines.length ? this.data.lines[0].points : [] let index = 'lines[0].points['+points.length+']' this.setData({ [index]: {longitude: 121.34, latitude: 35.25} })
微信小程序地图动态加载marker出现闪烁现象- 当前 Bug 的表现(附上截图) [图片] 可以看到拖动地图出现明显的闪烁。 使用微信小程序地图动态展示marker,当用户拖拽或缩放地图时需要加载当前区域内的marker,但是使用setData({markers:markers})出现很明显的闪烁现象,该怎么解决? - 预期表现 移动地图,动态加载marker,地图上的marker无明显闪烁现象,让用户感觉不到marker刷新了。或者能否提供插入或删除单个marker的方法,这种批量操作marker的效率太低了。 - 复现路径 用鼠标拖动地图,marker重新加载会出现闪烁 - 复现 Demo demo如下: map.wxml: [代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"map_container"[代码][代码]>[代码] [代码]<[代码][代码]map[代码] [代码]class[代码][代码]=[代码][代码]"map"[代码] [代码]id[代码][代码]=[代码][代码]"map"[代码] [代码]longitude[代码][代码]=[代码][代码]"{{longitude}}"[代码] [代码]latitude[代码][代码]=[代码][代码]"{{latitude}}"[代码] [代码]scale[代码][代码]=[代码][代码]"14"[代码] [代码]show-location[代码][代码]=[代码][代码]"true"[代码] [代码]markers[代码][代码]=[代码][代码]"{{markers}}"[代码] [代码]bindregionchange[代码][代码]=[代码][代码]"regionchange"[代码][代码]></[代码][代码]map[代码][代码]>[代码] [代码]</[代码][代码]view[代码][代码]>[代码]map.wxss: [代码].map_container{[代码][代码] [代码][代码]position[代码][代码]: [代码][代码]absolute[代码][代码];[代码][代码] [代码][代码]top[代码][代码]: [代码][代码]0[代码][代码];[代码][代码] [代码][代码]bottom[代码][代码]: [代码][代码]0[代码][代码];[代码][代码] [代码][代码]left[代码][代码]: [代码][代码]0[代码][代码];[代码][代码] [代码][代码]right[代码][代码]: [代码][代码]0[代码][代码];[代码][代码]}[代码][代码].map{[代码][代码] [代码][代码]width[代码][代码]: [代码][代码]100%[代码][代码];[代码][代码] [代码][代码]height[代码][代码]: [代码][代码]100%[代码][代码];[代码][代码]}[代码]map.js [代码]var[代码] [代码]amapFile = require([代码][代码]'../../libs/amap-wx.js'[代码][代码]);[代码][代码]var[代码] [代码]markersData = [];[代码][代码]Page({[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]markers: [],[代码][代码] [代码][代码]latitude: [代码][代码]'32.864377803922'[代码][代码],[代码][代码] [代码][代码]longitude: [代码][代码]'115.788491268263'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onShow:[代码][代码]function[代码][代码](){[代码][代码] [代码][代码]//模拟从服务器加载设备[代码][代码] [代码][代码]//模拟网络延迟[代码][代码] [代码][代码]setTimeout(() => {[代码][代码] [代码][代码]var[代码] [代码]markers = [代码][代码]this[代码][代码].getMarkers();[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]markers: markers[代码][代码] [代码][代码]});[代码][代码] [代码][代码]}, 1000);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]regionchange:[代码][代码]function[代码][代码](res){[代码][代码] [代码][代码]if[代码][代码](res.type==[代码][代码]'end'[代码][代码]){[代码][代码] [代码][代码]console.log([代码][代码]"加载设备"[代码][代码]);[代码][代码] [代码][代码]//模拟从服务器加载设备[代码][代码] [代码][代码]//模拟网络延迟[代码][代码] [代码][代码]setTimeout(()=>{[代码][代码] [代码][代码]var[代码] [代码]markers = [代码][代码]this[代码][代码].getMarkers();[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]markers: markers[代码][代码] [代码][代码]});[代码][代码] [代码][代码]},1000);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码] [代码][代码]getMarkers:[代码][代码]function[代码][代码](){[代码][代码] [代码][代码]var[代码] [代码]markers1 = [ [代码][代码] [代码][代码]{ latitude: 32.863684789997, longitude: 115.794747394735 }[代码][代码] [代码][代码], { latitude: 32.866150490718, longitude: 115.779776056454 }[代码][代码] [代码][代码], { latitude: 32.85699840912, longitude: 115.793706230259 }[代码][代码] [代码][代码], { latitude: 32.868802796587, longitude: 115.795851934883 }[代码][代码] [代码][代码], { latitude: 32.868802796587, longitude: 115.795851934883 }[代码][代码] [代码][代码], { latitude: 32.865037454128, longitude: 115.784221396101 }[代码][代码] [代码][代码], { latitude: 32.861683316431, longitude: 115.794735614756 }[代码][代码] [代码][代码], { latitude: 32.86145345, longitude: 115.7946734 }[代码][代码] [代码][代码], { latitude: 32.866980115902, ongitude: 115.779949 }[代码][代码] [代码][代码], { latitude: 32.861960286233, longitude: 115.794732449203 }[代码][代码] [代码][代码], { latitude: 32.861960286233, longitude: 115.794732449203 }[代码][代码] [代码][代码], { latitude: 32.860691527707, longitude: 115.783249338155 }[代码][代码] [代码][代码], { latitude: 32.858660704851, longitude: 115.782761369842 }[代码][代码] [代码][代码], { latitude: 32.861673318033, longitude: 115.782898390111 }[代码][代码] [代码][代码], { latitude: 32.859451402325, longitude: 115.783271050545 }[代码][代码] [代码][代码], { latitude: 32.858075553001, longitude: 115.782085844506 }[代码][代码] [代码][代码], { latitude: 32.85980061309, longitude: 115.782478686392 }[代码][代码] [代码][代码], { latitude: 32.859026954912, longitude: 115.783450959086 }[代码][代码] [代码][代码], { latitude: 32.858902233697, longitude: 115.786543290987 }[代码][代码] [代码][代码]];[代码][代码] [代码][代码]var[代码] [代码]markers2 = [[代码][代码] [代码][代码]{ latitude: 32.863684789997, longitude: 115.794747394735 }[代码][代码] [代码][代码], { latitude: 32.859749503874, longitude: 115.782486744537 }[代码][代码] [代码][代码], { latitude: 32.865891748675, longitude: 115.778707367095 }[代码][代码] [代码][代码], { latitude: 32.868802796587, longitude: 115.795851934883 }[代码][代码] [代码][代码], { latitude: 32.868802796587, longitude: 115.795851934883 }[代码][代码] [代码][代码], { latitude: 32.865037454128, longitude: 115.784221396101 }[代码][代码] [代码][代码], { latitude: 32.861683316431, longitude: 115.794735614756 }[代码][代码] [代码][代码], { latitude: 32.86145345, longitude: 115.7946734 }[代码][代码] [代码][代码], { latitude: 32.866980115902, ongitude: 115.779949 }[代码][代码] [代码][代码], { latitude: 32.861960286233, longitude: 115.794732449203 }[代码][代码] [代码][代码], { latitude: 32.861960286233, longitude: 115.794732449203 }[代码][代码] [代码][代码], { latitude: 32.860691527707, longitude: 115.783249338155 }[代码][代码] [代码][代码], { latitude: 32.858660704851, longitude: 115.782761369842 }[代码][代码] [代码][代码], { latitude: 32.861673318033, longitude: 115.782898390111 }[代码][代码] [代码][代码], { latitude: 32.859451402325, longitude: 115.783271050545 }[代码][代码] [代码][代码], { latitude: 32.858075553001, longitude: 115.782085844506 }[代码][代码] [代码][代码], { latitude: 32.85980061309, longitude: 115.782478686392 }[代码][代码] [代码][代码], { latitude: 32.859026954912, longitude: 115.783450959086 }[代码][代码] [代码][代码], { latitude: 32.858902233697, longitude: 115.786543290987 }[代码][代码] [代码][代码]];[代码][代码] [代码][代码]var[代码] [代码]markers3 = [[代码][代码] [代码][代码]{ latitude: 32.863684789997, longitude: 115.794747394735 }[代码][代码] [代码][代码], { latitude: 32.859749503874, longitude: 115.782486744537 }[代码][代码] [代码][代码], { latitude: 32.85699840912, longitude: 115.793706230259 }[代码][代码] [代码][代码], { latitude: 32.868802796587, longitude: 115.795851934883 }[代码][代码] [代码][代码], { latitude: 32.868802796587, longitude: 115.795851934883 }[代码][代码] [代码][代码], { latitude: 32.865037454128, longitude: 115.784221396101 }[代码][代码] [代码][代码], { latitude: 32.865902040263, longitude: 115.780964494169 }[代码][代码] [代码][代码], { latitude: 32.86145345, longitude: 115.7946734 }[代码][代码] [代码][代码], { latitude: 32.866980115902, ongitude: 115.779949 }[代码][代码] [代码][代码], { latitude: 32.861960286233, longitude: 115.794732449203 }[代码][代码] [代码][代码], { latitude: 32.861960286233, longitude: 115.794732449203 }[代码][代码] [代码][代码], { latitude: 32.860691527707, longitude: 115.783249338155 }[代码][代码] [代码][代码], { latitude: 32.858660704851, longitude: 115.782761369842 }[代码][代码] [代码][代码], { latitude: 32.861673318033, longitude: 115.782898390111 }[代码][代码] [代码][代码], { latitude: 32.859451402325, longitude: 115.783271050545 }[代码][代码] [代码][代码], { latitude: 32.858075553001, longitude: 115.782085844506 }[代码][代码] [代码][代码], { latitude: 32.85980061309, longitude: 115.782478686392 }[代码][代码] [代码][代码], { latitude: 32.859026954912, longitude: 115.783450959086 }[代码][代码] [代码][代码], { latitude: 32.858902233697, longitude: 115.786543290987 }[代码][代码] [代码][代码]];[代码][代码] [代码][代码]var[代码] [代码]rm = (Math.random()*3).toFixed(0);[代码][代码] [代码][代码]console.log([代码][代码]"rm="[代码][代码]+rm);[代码][代码] [代码][代码]if[代码][代码](rm==1){[代码][代码] [代码][代码]return[代码] [代码]markers1;[代码][代码] [代码][代码]}[代码][代码]else[代码] [代码]if[代码][代码](rm == 2){[代码][代码] [代码][代码]return[代码] [代码]markers2;[代码][代码] [代码][代码]}[代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]return[代码] [代码]markers3;[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码]})[代码]
2021-07-09真是搞球,不能直接绑定微信吗,非得弄个邮箱账号,最后又绑定到微信,关键是邮箱账号不够用啊,坑爹呢这是!
微信开放平台和公众平台的账号不通用,但是一个邮箱却又只能注册其中一个这个是不是有点别扭啊。 账号太多就容易丢。然后要注册一堆QQ号。能改一下这个问题吗 ++ 凡是注册过公众平台的账号,登录开放平台都提示密码错误,找回密码就提示邮箱未注册,然后去注册又提示被使用。 能不能让账号通用一下,如果牵扯审核之类的,可以登录后提交资质审核,但是没必要这样把账号应生生的分开啊。 搞一堆账号好别扭啊。很想在微信平台上就用一个号。
2021-07-03<view wx:for="{{list}}" wx:key="{{item.id}}"></view> 改成这样: <view wx:for="{{list}}" wx:key="id"></view>
wx:key报错does not look like a valid key name?[图片] 以前开发也没遇到过这种问题,item.id也没有问题,为什么会报警告
2019-12-18