uni-app
uni-app copied to clipboard
H5 map地图 markers增加width,height属性会导致位置偏移且缩放会导致markers位置移动
问题描述 map地图 markers增加width,height属性会导致位置偏移且缩放会导致markers位置移动
复现步骤 markers增加width,height属性
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-common-mt">
<view>
<map :latitude="latitude"
:longitude="longitude"
:markers="covers">
</map>
</view>
</view>
</view>
</template>
<script>
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/[email protected]',
// #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/[email protected]',
// #endif
// #ifndef APP-PLUS
iconPath: '../../../static/location.png',
// #endif
width: "34px",
height: "34px",
}]
}
},
methods: {
}
}
</script>
<style>
map {
width: 100%;
height: 600rpx;
}
</style>
预期结果
1.markers根据经纬度显示不偏移
2.缩放地图比例,makers位置不移动
实际结果
系统信息:
- 发行平台:H5
- 操作系统 Android
- 设备信息 一加6