uni-app icon indicating copy to clipboard operation
uni-app copied to clipboard

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

Open RunningTree opened this issue 3 years ago • 0 comments

问题描述 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位置不移动 e08b3b1202da8fd88047fa8c853e223 2c4ae8af54f9c8f85e58b4a8f851fc7

实际结果 80408a56a5444061f67875b262d19ad 54e808578133ef918221d8be9136a5b

系统信息:

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

RunningTree avatar Dec 03 '21 07:12 RunningTree