微信小程序地图组件使用自定义标记点,真机时图标被截取

34 阅读1分钟

最近使用Uniapp开发微信小程序遇到以下问题,再此记录:

微信开发者工具正常显示,在真机会出现被截断的情况

image.png

多次尝试后发现:使用了svg图标,更换为png图片后解决

image.png

markers.value.push({
     latitude: hotelInfo.value.latitude,
     longitude: hotelInfo.value.longitude,
     iconPath: '/static/card-icons/icon-location.png',
     width: 37,
     height: 40,
     id: 1       
})