map组件的自定义气泡长度真机不自适应?map组件的标记ios真机移除失败?
发布于 5 年前 作者 ttian 12798 次浏览 来自 问答
  1. map组件的自定义气泡长度渲染真机不一致,模拟器上正常,在真机上所有的气泡长度都是文本最长的气泡长度,气泡长度不能根据文本自适应
<map class="map" longitude="{{position.lng}}" latitude="{{position.lat}}" show-location="true" markers="{{markerArr}}"
  bindcallouttap="markerTap">
  <!-- 自定义气泡 -->
  <cover-view slot="callout">
    <block wx:for="{{markerArr}}" wx:key="index">
      <cover-view marker-id="{{item.id}}" class="customCalloutItem {{activeMarkerId==item.id?'activeCallout':''}}">
        <cover-image src="{{coverImgList[activeIndex]}}" class="typeImg"></cover-image>
        <cover-view></cover-view>
        <cover-view class="title">{{item.title}}</cover-view>
      </cover-view>
    </block>
  </cover-view>
</map>

左图为模拟器,右图为ios真机。

2.map组件的标记ios真机移除失败?

左图模拟器上移除标记正常,安卓真机也正常,右图ios真机标记(学校的标记还在)移除失败。

附上标记点的添加移除代码 (markerArr输出是正常的)

 let _this = this;
    this.qqmapsdk.search({
      keyword, //搜索关键词
      sig: true//签名校验
      page_size: 20,
      location: {
        latitude: _this.data.position.lat,
        longitude: _this.data.position.lng,
      }, //设置周边搜索中心点
      success(res) {
        var mks = [_this.data.centerMak];
        for (var i = 0; i < res.data.length; i++) {
          mks.push({ // 获取返回结果,放到mks数组中
            title: res.data[i].title,
            id: parseInt(res.data[i].id),
            latitude: res.data[i].location.lat,
            longitude: res.data[i].location.lng,
            width: 20,
            height: 30,
            customCallout: {
              display: 'ALWAYS',
            },
          });
        }
        _this.setData({
          markerArr: mks,
        });
        console.log(_this.data.markerArr);
      },
    });
1 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部