Commit d59dfa169d42d85a0ac1d4f40fead035b5cea53d
1 parent
4d91ea5c
地图覆盖物
Showing
2 changed files
with
13 additions
and
4 deletions
src/styles/reset.css
src/views/mapsection.vue
... | ... | @@ -151,10 +151,12 @@ export default { |
151 | 151 | var marker = new BMap.Marker(pt,{icon:myIcon}); |
152 | 152 | } |
153 | 153 | console.log(data) |
154 | + marker.setTop(true,27000000); | |
154 | 155 | map.addOverlay(marker); |
155 | 156 | var myLabel; |
156 | 157 | |
157 | - marker.addEventListener("mouseover", function (e) { | |
158 | + marker.addEventListener("mouseover", (e)=> { | |
159 | + var that = this; | |
158 | 160 | console.log(e) |
159 | 161 | myLabel = new BMap.Label( |
160 | 162 | `<div class="dislog-wrap"> |
... | ... | @@ -177,10 +179,12 @@ export default { |
177 | 179 | // whiteSpace: "normal", |
178 | 180 | backgroundColor: "", |
179 | 181 | border: "0px", |
180 | - // zIndex: "1000" | |
182 | + zIndex: "1000" | |
181 | 183 | } |
182 | 184 | ); |
183 | - map.addOverlay(myLabel); | |
185 | + marker.setLabel(myLabel) | |
186 | + marker.setTop(true,27000000); | |
187 | + | |
184 | 188 | }); |
185 | 189 | |
186 | 190 | marker.addEventListener("mouseout", function (e) { | ... | ... |