Commit c7343975a450bfc7afa1d7cfec6d460425f25cd4
1 parent
ac775d76
地图
Showing
2 changed files
with
29 additions
and
5 deletions
src/views/map/map.vue
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | :zoom="16"> |
| 22 | 22 | |
| 23 | 23 | |
| 24 | - <bm-label content="22" :position="{lng: 116.3666882, lat: 39.9283467}" :labelStyle="{color: '#fff', fontSize : '16px',background:'#f0f',borderRadius: '50%',padding:'3px'}" title="Hover me"/> | |
| 24 | + <bm-label :content="labelContent" :position="{lng: position.longitude, lat: position.latitude}" :labelStyle="{color: '#FFF', fontSize : '16px',background:position.bgcolor,borderRadius: '50%',padding:'3px',borderColor:'#fff'}" title="Hover me"/> | |
| 25 | 25 | |
| 26 | 26 | </baidu-map> |
| 27 | 27 | |
| ... | ... | @@ -86,11 +86,18 @@ export default { |
| 86 | 86 | popupVisible: false, |
| 87 | 87 | n:10, |
| 88 | 88 | setTimeoutTimer:'', |
| 89 | - latitude:'', | |
| 90 | - longitude:'', | |
| 89 | + latitude:'39.91092455', | |
| 90 | + longitude:'116.41338370', | |
| 91 | 91 | name:'', |
| 92 | 92 | idleberths:'', |
| 93 | - julis:'' | |
| 93 | + julis:'', | |
| 94 | + labelShow: false, | |
| 95 | + labelContent:'', | |
| 96 | + position:{ | |
| 97 | + latitude:'39.91092455', | |
| 98 | + longitude:'116.41338370', | |
| 99 | + bgcolor: '#f00' | |
| 100 | + } | |
| 94 | 101 | } |
| 95 | 102 | }, |
| 96 | 103 | methods: { |
| ... | ... | @@ -158,7 +165,24 @@ export default { |
| 158 | 165 | |
| 159 | 166 | this.latitude = datas.latitude |
| 160 | 167 | this.longitude = datas.longitude |
| 168 | + this.position.latitude = datas.latitude | |
| 169 | + this.position.longitude = datas.longitude | |
| 161 | 170 | this.idleberths = datas.idleberths |
| 171 | + this.labelContent = datas.idleberths | |
| 172 | + if(datas.idleberths>10){ | |
| 173 | + this.position.bgcolor = '#0f0' | |
| 174 | + }else if(datas.idleberths<=10&&datas.idleberths>0){ | |
| 175 | + this.position.bgcolor = '#ff9e04' | |
| 176 | + }else if(datas.idleberths<=0){ | |
| 177 | + this.position.bgcolor = '#f00' | |
| 178 | + }else{ | |
| 179 | + this.position.bgcolor = '#0f0' | |
| 180 | + } | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 162 | 186 | this.julis = this.dis |
| 163 | 187 | }) |
| 164 | 188 | }, | ... | ... |