Map是底层,全图显示,上层有一个使用绝对定位设置的view,内部含有两个button,大概代码如下。现在点击这个button,不仅仅会触发button的tap,也会触发map的tap,这种情况如何解决?我只需要触发上层button的tap事件即可。
<view class="page-body">
<view class="page-section page-section-gap">
<map id="myMap" style="width: 100vw; height: 100vh;" latitude="{{latitude}}" longitude="{{longitude}}" enable-satellite="false"
markers="{{markers}}" scale="{{map_scale}}" bindtap="onMapTap" bindmarkertap="onPointTap" show-location="true">
<view class="search_bar">
<image src="/image/search.png" style="width:50rpx;height:50rpx;padding-right:10px;" />
<input class="search_view" bindblur="closesuggest" bindconfirm="getsuggest" type="text" confirm-type="search"
value="{{backfill}}" placeholder="输入地址定位(如: 人民广场)">input>
view> map> view> <view class=“btn-area”> <button class=“help-button” style=“padding:0;width:100rpx;” bindtap=“showHelp” hover-class=“help-button-pressed”> <image src="/image/help.png" style=“width:80rpx;height:80rpx;” /> button> <button class=“reset-button” style=“padding:0;width:100rpx;” bindtap=“moveToCurrentLocation” hover-class=“reset-button-pressed”> <image src="/image/gps.png" style=“width:80rpx;height:80rpx;” /> button> view> view>