vue cli 调取百度地图使用自定义弹框BMapLib.InfoBox() 创建的弹框默认关闭按钮如何隐藏
代码如下
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=1920,initial-scale=1.0"/>
<title>zhihuixunhe</title>
<script src="./static/flv.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=百度密钥"></script>
</head>
<script type="text/javascript" src="./static/InfoBox_min.js"></script>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<style>
div.infoBox img:first-child{
display: none !important;
}
</style>
</html>
不使用BMapLib,直接使用Bmap调取的弹框隐藏关闭按钮的方法
代码如下
map.vue
var infoWindow = new BMapLib.InfoBox(map,"<img id='markerbtn' style='width:390px;height:180px;' src='"+require('./../../assets/ship.png')+"'>", opts); // 创建信息窗口对象
// map.openInfoWindow();
//var infoWindow = new BMap.InfoWindow('这是提示信息')
// 鼠标移上标注点要发生的事
infoWindow.addEventListener('open',function(type, target, point){ //窗口打开是,隐藏自带的关闭按钮
$('.BMap_pop>img').hide();
})