2024-01-08 有人解决了吗
微信小程序地图动态加载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;[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码]})[代码]
01-08参数写在下面,不要和页面写一起,输入框左边不是有么“启动页面”,“启动参数”
小程序指定场景跳转出现没有找到页面?场景值:1037 具体测试过程如下: [图片]
2022-12-16上面不是写的很清楚嘛,fail upload avatar timeout 上传头像超时,你把超时时间设置一下就可以了
button组件 open-type=“chooseAvatar” 选择大图报错使用button选择用户头像,弹窗相册选择选项,然后选择图片10mb 或者以上大小图片的原图,就会提示报错信息,工具栏报错 [渲染层错误] [Component] <button>: chooseAvatar:fail upload avatar timeout(env: Windows,mp,1.06.2209190; lib: 2.27.3) ios报错 设置失败,请重试 toast 提示语
2022-11-28用picker-view
picker 如何禁用确定按钮?,或者控制弹出框的显示隐藏?[图片]
2022-11-28https://developers.weixin.qq.com/community/develop/doc/00022c683e8a80b29bed2142b56c01
auth.code2Session正常,但是解析出来的微信昵称是 “微信用户”,头像也不正确,为啥?GET https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code 请求code2Session 结果,传值、返回都正常,但是返回的数据解析结果,openid 是正常的,nickName 返回的是“微信用户”,avatarUrl, 返回的是一个默认头像,都不是当前用户的,之前还正常,什么都没有改就异常了。也不报错。 {"nickName":"微信用户","gender":0,"language":"","city":"","province":"","country":"", "avatarUrl":"https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132" ,"watermark":{"timestamp":1669184024,"appid":"wx6fcc6e3f52dae9b6"}}
2022-11-23camera不是相机吗? 扫码用wx.scanCode
camera组件无法识别二维码,微信自带扫一扫就可以?[图片] 这个二维码camera组件无法识别 微信自带扫一扫却可以 这是什么原因呢? <camera device-position="back" bindscancode="onScancode" mode="scanCode" flash="off" binderror="error" style="width: 500rpx; height: 500rpx;margin:0 auto"></camera> onScancode(e){ console.log(e) }, [图片]
2022-11-11多打几个输出,看下是哪一步输出没有到达预期
在app.js的onLaunch登录接口中设置回调函数,在页面中可以读取,但在组件中读取不到?app.js [图片] page.js [图片] 自定义组件js --> components.js [图片] 在组件中获取不到登录接口返回的数据。
2022-11-11用HBuilder打开
小程序主体部分文件app.js app.json app.wxss 三个文件未找到,怎么处理?[图片]
2022-11-07是在不行,就自己手写个
wx.showModal的输入框能设置默认文字吗?不是提示文字,是文本框默认给值wx.showModal
2022-09-29提示的就是原因啊,原因就是“数据存储量过大”
小程序(安卓、ios)vConsole里打印了“数据量存储过大,有异常”,是什么原因?页面卡顿严重 [图片]
2022-09-26