如何在 map 组件上显示用户头像

发布于 6 年前作者 hsu14389 次浏览最后编辑 6 年前来自 ask

根据文档,想要实现在 map 组件上显示内容只能使用 cover-view 和 cover-image ,但除了 button 组件均不能嵌套,所以无法嵌套 open-data 组件。

有没有什么好的解决方案,请教大家

1 回复
lei75
lei751 楼4 年前

用这个方法试试:

wxss文件中添加:

.mapmask {

  position:fixed;

  top: 3rem;

  left: 0;

  bottom: -1;

  right: 0;

  z-index: 1000;

  background-color: rgba(255, 255, 255, 1)

}

wxml文件中添加:

<view class=‘mapmask’ catchtouchstart=‘test’>

    <image src=“…” />

</view>