Commit b850acb72e7a43e13a996cf5635a224c0a9e11b3

Authored by liuqimichale
1 parent fdddb2fe

地图覆盖物

src/styles/reset.css
@@ -109,3 +109,7 @@ table { @@ -109,3 +109,7 @@ table {
109 position: absolute; 109 position: absolute;
110 } 110 }
111 111
  112 +.parkpop-content{
  113 + color: #f00;
  114 +}
  115 +
src/views/mapsection.vue
@@ -77,6 +77,9 @@ export default { @@ -77,6 +77,9 @@ export default {
77 currentIndex:0 77 currentIndex:0
78 } 78 }
79 }, 79 },
  80 + created() {
  81 +
  82 + },
80 mounted() { 83 mounted() {
81 this.$nextTick(() => { 84 this.$nextTick(() => {
82 this.scroll = new BScroll(this.$refs.parkwrap,{ 85 this.scroll = new BScroll(this.$refs.parkwrap,{
@@ -149,35 +152,28 @@ export default { @@ -149,35 +152,28 @@ export default {
149 var myLabel; 152 var myLabel;
150 marker.addEventListener("mouseover", function (e) { 153 marker.addEventListener("mouseover", function (e) {
151 myLabel = new BMap.Label( 154 myLabel = new BMap.Label(
152 - '<div class="parkpop-content"> ' +  
153 - '<div class="parkpop-tit">112321312312</div> ' +  
154 - '<div class="parkpop-cont"> ' +  
155 - '<div class="parkpop-freecont"> ' +  
156 -  
157 - '<div class="allspace-tit">总车位</div> ' +  
158 - '</div> ' +  
159 - '</div></div>', 155 + '<div class="parkpop-content" style="font-size: 20px;">12321312</div>',
160 { 156 {
161 offset: new BMap.Size(30, -85), //label的偏移量,为了让label的中心显示在点上 157 offset: new BMap.Size(30, -85), //label的偏移量,为了让label的中心显示在点上
162 position: point 158 position: point
163 }); 159 });
164 160
165 myLabel.setStyle({ 161 myLabel.setStyle({
166 - color: "#F0F0F0", 162 + // color: "#0f0",
167 fontSize: "12px", 163 fontSize: "12px",
168 - padding: "5px",  
169 - whiteSpace: "normal",  
170 - backgroundColor: "#f00",  
171 - border: "0px",  
172 - zIndex: "1000" 164 + // padding: "5px",
  165 + // whiteSpace: "normal",
  166 + // backgroundColor: "#f00",
  167 + // border: "0px",
  168 + // zIndex: "1000"
173 } 169 }
174 ); 170 );
175 console.log('1') 171 console.log('1')
176 map.addOverlay(myLabel); 172 map.addOverlay(myLabel);
177 }); 173 });
178 - marker.addEventListener("mouseout", function () {  
179 - map.removeOverlay(myLabel);  
180 - }) 174 + // marker.addEventListener("mouseout", function () {
  175 + // map.removeOverlay(myLabel);
  176 + // })
181 177
182 // //创建信息窗口 178 // //创建信息窗口
183 // var opts = { 179 // var opts = {
@@ -215,10 +211,11 @@ export default { @@ -215,10 +211,11 @@ export default {
215 left: 0; 211 left: 0;
216 right: 0; 212 right: 0;
217 bottom: 0; 213 bottom: 0;
  214 + .parkpop-content{
  215 + background-color: black;
  216 + }
218 } 217 }
219 - .parkpop-tit{  
220 - color: #000;  
221 - } 218 +
222 .title-wrap{ 219 .title-wrap{
223 display: flex; 220 display: flex;
224 padding-top: 17px; 221 padding-top: 17px;