From 4d91ea5c795de69b86986209aacd4b6e6c9b0bcd Mon Sep 17 00:00:00 2001 From: liuqimichale <123456lq> Date: Fri, 14 Dec 2018 10:18:23 +0800 Subject: [PATCH] 地图覆盖物 --- src/styles/reset.css | 2 ++ src/views/mapsection.vue | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/styles/reset.css b/src/styles/reset.css index cab5698..c7621e0 100644 --- a/src/styles/reset.css +++ b/src/styles/reset.css @@ -150,5 +150,7 @@ table { color: #fff; } +.anchorBL{display:none;} /*去掉百度地图logo*/ + diff --git a/src/views/mapsection.vue b/src/views/mapsection.vue index bbccb94..3066c03 100644 --- a/src/views/mapsection.vue +++ b/src/views/mapsection.vue @@ -111,9 +111,11 @@ export default { this.baiduMap(data) }, baiduMap (data) { - var map = new BMap.Map('allmap') + var map = new BMap.Map('allmap', {enableMapClick: false}) var point = new BMap.Point(111.742579, 40.818675) map.centerAndZoom(point, 12) + var mapStyle={ style : "midnight" } + map.setMapStyle(mapStyle); // var marker = new BMap.Marker(point) // 创建标注 // map.addOverlay(marker) // 将标注添加到地图中 @@ -180,6 +182,10 @@ export default { ); map.addOverlay(myLabel); }); + + marker.addEventListener("mouseout", function (e) { + map.removeOverlay(myLabel); + }); i++; })(i); } -- libgit2 0.21.4