This commit is contained in:
parent
3b9f4454cd
commit
6c2436be1d
|
|
@ -60,7 +60,7 @@ export default {
|
|||
// 添加label在标点下方并居中
|
||||
const label = new BMapGL.Label(item.proName, {
|
||||
position: point,
|
||||
offset: new BMapGL.Size(-60, 10), // 调整偏移量,使文字在marker正下方
|
||||
offset: new BMapGL.Size(0, 0), // 调整偏移量,使文字在marker正下方
|
||||
})
|
||||
// 设置label样式
|
||||
label.setStyle({
|
||||
|
|
@ -71,6 +71,7 @@ export default {
|
|||
padding: '5px',
|
||||
whiteSpace: 'nowrap', // 防止文字换行
|
||||
fontSize: '18px',
|
||||
transform: 'translateX(-45%)',
|
||||
})
|
||||
this.map.addOverlay(label)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue