fix map marker width

This commit is contained in:
Timi
2025-12-18 19:21:46 +08:00
parent 186a74bc77
commit 6f74559c01
11 changed files with 130 additions and 128 deletions

View File

@ -13,16 +13,25 @@
bindcallouttap="onCalloutTap"
>
<cover-view slot="callout">
<block wx:for="{{markers}}" wx:key="id" wx:for-index="markerIndex">
<cover-view class="custom-callout" marker-id="{{markerIndex}}">
<block wx:for="{{item.locations}}" wx:key="id" wx:for-item="location">
<cover-view class="location-item">
<cover-view wx:if="{{location.typeLabel}}" class="type">{{location.typeLabel}}</cover-view>
<cover-view class="title">{{location.title || '未命名地点'}}</cover-view>
</cover-view>
</block>
<cover-view
class="marker"
wx:for="{{markers}}"
wx:key="id"
wx:for-item="marker"
wx:for-index="markerIndex"
marker-id="{{markerIndex}}"
>
<cover-view
class="location"
wx:for="{{marker.locations}}"
wx:key="id"
wx:for-item="location"
style="{{'--title-length: ' + location.title.length}}"
>
<cover-view wx:if="{{location.typeLabel}}" class="type">{{location.typeLabel}}</cover-view>
<cover-view class="title">{{location.title || '未命名地点'}}</cover-view>
</cover-view>
</block>
</cover-view>
</cover-view>
</map>
<view wx:if="{{isLoading}}" class="loading">