遇到一个问题,自定义的气泡,第一个气泡有时候会显示不全,第二个气泡的宽度并没有自适应,请问有办法解决吗?
代码如下
<map class="pages-dirving__map"
id="map"
longitude="{{longitude}}"
latitude="{{latitude}}"
markers="{{markers}}"
polyline="{{polyline}}"
show-location>
<cover-view slot="callout">
<block wx:for="{{markers}}"
wx:for-index="index"
wx:for-item="item"
wx:key="id">
<cover-view wx:if="{{item.type=='start'}}"
marker-id="{{item.id}}"
class="marker-callout">
<cover-view class="marker-callout__info">
<cover-view class="marker-callout__name">
接驾约
</cover-view>
<cover-view class="marker-callout__time">
{{item.duration}}分钟
</cover-view>
</cover-view>
<cover-view class="marker-callout__title">
{{item.title}}
</cover-view>
</cover-view>
<cover-view wx:elif="{{item.type=='end'}}"
marker-id="{{item.id}}"
class="marker-callout marker-callout--end">
<cover-view class="marker-callout__title">
{{item.title}}
</cover-view>
<cover-view class="marker-callout__info">
全程{{item.distance_label}},约{{item.duration}}分钟
</cover-view>
</cover-view>
</block>
</cover-view>
</map>
请问这个问题有解决吗?
不设置宽度,开发工具上都是自适应宽度,
但是到真机上却是每个customCallout的宽度 = 宽度最长的customCallout的宽度,
同学,解决了嘛
https://developers.weixin.qq.com/miniprogram/dev/component/map.html#marker%20%E4%B8%8A%E7%9A%84%E8%87%AA%E5%AE%9A%E4%B9%89%E6%B0%94%E6%B3%A1%20customCallout
试下相关属性看看