砕月酔夢
砕月酔夢
  • 发布:2022-01-10 11:38
  • 更新:2022-01-10 20:38
  • 阅读:601

【报Bug】map缩放时,markers不会变化

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: windows7

HBuilderX类型: 正式

HBuilderX版本号: 3.3.2

手机系统: iOS

手机系统版本号: iOS 14

手机厂商: 苹果

手机机型: iphoneX

页面类型: nvue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:
<template>  
    <div>  
        <map latitude="39.90792" longitude="116.397517" :markers="markers" :style="{height:height+'px',width:width+'px'}"></map>  
    </div>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                height:'',  
                width:'',  
                markers:[{  
                    id:'1',  
                    latitude:'39.90792',  
                    longitude:'116.397517',  
                }]  
            }  
        },  
        onLoad() {  
            // 获取手机的物理系高度  
            uni.getSystemInfo({  
                success:res=>{  
                    this.height=res.windowHeight  
                    this.width=res.windowWidth  
                }  
            })  
        },  
    }  
</script>

预期结果:

在ios上缩放时会有偏移,markers随着缩放变化

实际结果:

在ios上缩放时会有偏移,markers不会随着缩放变化

bug描述:

map缩放时,markers不会变化(实际查看上感觉像是markers偏移了),附件内有视频

2022-01-10 11:38 负责人:DCloud_iOS_XHY 分享
已邀请:
DCloud_iOS_XHY

DCloud_iOS_XHY

未设置标注图时使用的是高德SDK 内置的 marker 标注图,这个图片下面带了透明区域,图片高度实际上是肉眼看到的大头针的两倍,需要设置 marker 的 anchor

anchor: {  
    x: 0.5,  
    y: 0.5  
},

该问题目前已经被锁定, 无法添加新回复