需求:整屏地图,需要在地图上方编写筛选条件,地图中标注经纬度定位与自定义样式
次情形仅用于微信小程序,其他的没去验证过
1,在地图上方编写赛选条件,及其他,不需要根据地图经纬度进行定位,数据获取之类操作,可与map写在同一层,并使用view标记正常z-index就可实现,因为微信小程序目前原生组件均已实现同层渲染
<map :longitude="longitude" :latitude="latitude" class="c-map">
</map>
<view class="c-input">自定义层级</view>
.c-map{
position: relative;
z-index: 1;
width: 100%;
height:100vh;
}
.c-input{
position: fixed;
top: 0;
left: 0;
z-index: 3;
width: 100%;
}
2.在地图中,依靠坐标定位显示:地图气泡自定义,依然需要使用cover-view,marker-id一定得指定,靠其定位
<map :longitude="longitude" :latitude="latitude"
:scale="scale" :markers="markers"
class="mapLookForRoom-map"
@callouttap="markerClick">
<!-- 自定义窗口 -->
<cover-view slot="callout">
<cover-view v-for="(item,index) in markers" :marker-id="item.id" :key='index'>
</cover-view>
</cover-view>
</map>