dcloudio / dcloudio/uni-app

H5 map地图 markers增加width,height属性会导致位置偏移且缩放会导致markers位置移动

Open
#3,042 0 comments 0 reactions 0 assignees View on GitHub
h5 提供了复现方案
Dominant language
JavaScript
Stars
41.6k
Forks
3.7k
Avg merge
7h 6m
Merged PRs (30d)
6

Description

**问题描述**
map地图 markers增加width,height属性会导致位置偏移且缩放会导致markers位置移动

**复现步骤**
markers增加width,height属性

```js









export default {
data () {
return {
title: 'map',
latitude: 39.909,
longitude: 116.39742,
covers: [{
latitude: 39.9085,
longitude: 116.39747,
// #ifdef APP-PLUS
iconPath: '../../../static/app-plus/location@3x.png',
// #endif
// #ifndef APP-PLUS
iconPath: '../../../static/location.png',
// #endif
width: "34px",
height: "34px",
}, {
latitude: 39.90,
longitude: 116.39,
// #ifdef APP-PLUS
iconPath: '../../../static/app-plus/location@3x.png',
// #endif
// #ifndef APP-PLUS
iconPath: '../../../static/location.png',
// #endif
width: "34px",
height: "34px",
}]
}
},
methods: {
}
}

map {
width: 100%;
height: 600rpx;
}

```

**预期结果**
1.markers根据经纬度显示不偏移
2.缩放地图比例,makers位置不移动
![e08b3b1202da8fd88047fa8c853e223](https://user-images.githubusercontent.com/23075780/144563117-dfd11367-df9e-4b07-ace4-d3cdd4cb3f7f.jpg)
![2c4ae8af54f9c8f85e58b4a8f851fc7](https://user-images.githubusercontent.com/23075780/144563131-079f280d-387c-476f-8490-1c32aca0117d.jpg)

**实际结果**
![80408a56a5444061f67875b262d19ad](https://user-images.githubusercontent.com/23075780/144563148-47534daf-10a3-409e-8d52-9195923627a8.jpg)
![54e808578133ef918221d8be9136a5b](https://user-images.githubusercontent.com/23075780/144563165-086e1eca-f4ab-4882-aca0-955788ab4fc3.jpg)

**系统信息:**
- 发行平台:H5
- 操作系统 Android
- 设备信息 一加6

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.