补充:同样的数据在小程序中渲染的轨迹,android比ios渲染差了很多,android渲染出来的线polyline都是很多毛刺且歪歪扭扭,ios都是笔直的,如图中的行驶轨迹 和停车位边框 @官方 android效果如下: [图片] ios效果如下: [图片]
微信小程序map组件渲染对数据精度做了默认限制吗?有没有办法提升点线面渲染精度?https://developers.weixin.qq.com/miniprogram/dev/component/map.html 问题 使用map组件,通过polyline渲染了停车位边框的数据,出现明显的变形(相邻的停车位的线段),这些数据(小数点后15位)本身在QGIS软件上显示正常,当我将其在小数点第6位进行四舍五入截断,然后在QGIS上进行渲染,发现出现了同样的问题,因为想请问一下,微信小程序map组件的polyline、polygon这些数据是否做了数据截断,如果是的,那么我们有什么方法可以提高渲染的精度,如果不是,请帮忙看下这个渲染是否是出现什么bug,谢谢 附: 图1(微信小程序效果) [图片] 图2(QGIS中渲染正常效果如下) [图片] 图3 (QGIS软件中将数据做小数点后六位四舍五入截断发生同样变形) [图片]
2023-01-05楼主请问解决了吗,我也遇到了同样的问题,安卓真机在绘制车辆轨迹的时候地图一闪一闪的,而且行驶轨迹歪歪扭扭,iOS真机就没有这个两个问题
微信小程序地图动态加载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;[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码]})[代码]
2022-08-22楼主这个解决了么,我这里也发现 iOS渲染运动轨迹: 线平滑、marker稳定动态渲染、 android的: 线段歪歪扭扭且粗糙、marker动态渲染会出现残影、屏幕闪烁
map地图插件渲染轨迹时,总是闪烁实现一个接一个的出现轨迹,一直闪烁
2022-08-22