Commit 4d91ea5c795de69b86986209aacd4b6e6c9b0bcd
1 parent
48c2893f
地图覆盖物
Showing
2 changed files
with
9 additions
and
1 deletions
src/styles/reset.css
src/views/mapsection.vue
@@ -111,9 +111,11 @@ export default { | @@ -111,9 +111,11 @@ export default { | ||
111 | this.baiduMap(data) | 111 | this.baiduMap(data) |
112 | }, | 112 | }, |
113 | baiduMap (data) { | 113 | baiduMap (data) { |
114 | - var map = new BMap.Map('allmap') | 114 | + var map = new BMap.Map('allmap', {enableMapClick: false}) |
115 | var point = new BMap.Point(111.742579, 40.818675) | 115 | var point = new BMap.Point(111.742579, 40.818675) |
116 | map.centerAndZoom(point, 12) | 116 | map.centerAndZoom(point, 12) |
117 | + var mapStyle={ style : "midnight" } | ||
118 | + map.setMapStyle(mapStyle); | ||
117 | // var marker = new BMap.Marker(point) // 创建标注 | 119 | // var marker = new BMap.Marker(point) // 创建标注 |
118 | // map.addOverlay(marker) // 将标注添加到地图中 | 120 | // map.addOverlay(marker) // 将标注添加到地图中 |
119 | 121 | ||
@@ -180,6 +182,10 @@ export default { | @@ -180,6 +182,10 @@ export default { | ||
180 | ); | 182 | ); |
181 | map.addOverlay(myLabel); | 183 | map.addOverlay(myLabel); |
182 | }); | 184 | }); |
185 | + | ||
186 | + marker.addEventListener("mouseout", function (e) { | ||
187 | + map.removeOverlay(myLabel); | ||
188 | + }); | ||
183 | i++; | 189 | i++; |
184 | })(i); | 190 | })(i); |
185 | } | 191 | } |