map上cover-view点击事件不生效?
发布于 4 年前 作者 vmeng 2341 次浏览 来自 问答

微信小程序map,使用自定义callout, cover-view点击事件不生效,使用bindtap和catchtap都不行,真机和模拟器都不行,请问是为什么?

<view class="container">
    <map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="12" class="map" markers="{{clubs}}" zIndex="10">
        <cover-view slot="callout">
            <block wx:for="{{clubs}}" wx:key="index">
                <cover-view marker-id="{{item.id}}" class="callout-container" bind:tap="onMarkerTap" data-item="{{item}}">
                    <cover-image src="https://weapp.tempot.com/club-cover.png" class="image">cover-image>

<cover-view class=“title”>{{item.title}}cover-view> cover-view> block> cover-view> map> view>

2 回复

你好,地图组件从基础库v2.7.0 起支持同层渲染,可以使用view实现。若还有问题,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

换成view不行吗。cover-view和map都是原生组件。真机不行就想其他办法。

回到顶部