地图控件 上面加个浮动按钮却不显示
发布于 6 年前 作者 ping45 7963 次浏览 来自 问答

我在map 上面加个悬浮按钮,点击查找自己的位置, 并放大缩小,

在模拟器上可以正常显示, 但是在真机上面却显示不了。

<map id="map" scale="{{scale}}" markers="{{markers}}" latitude="{{latitude}}" longitude="{{longitude}}" controls="{{controls}}" show-location bindcontroltap="controltap" bindregionchange="regionchange" bindmarkertap="markertap" bindcallouttap="callouttap"

  bindpoitap="poitap" style="width: 100%; height: {{view.Height}}px;"

  <!-- 这部分提到map外面也不正常

 <image class='mypos pos' src='/image/icon/mypos.png' bindtap='myposclick'></image>

  <image class='mypos padd' src='/image/icon/add.png' bindtap='addclick'></image>

  <image class='mypos psub' src='/image/icon/sub.png' bindtap='subclick'></image> -->


</map>
 

.mypos {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}
 
.pos {
  left: 10px;
  bottom: 120px;
}

在模拟器上面 如下图,显示正常, 但是在手机上不显示这个图标。

求大神指点。

3 回复

你要么用cover-view标签,里面搞两个button,要么用cover-image标签,直接放图片,可以看官方的组件里写的有。

cover-image了解下

回到顶部