4.2
This commit is contained in:
@@ -130,12 +130,43 @@
|
||||
nextTick(()=>{
|
||||
val[0].forEach((item,index)=>{
|
||||
addMarker(mapIcon,[item.longitude,item.latitude],[40, 60])
|
||||
|
||||
marker.value.addEventListener('click', (e) => {
|
||||
console.log(item,'111111111111')
|
||||
cameraIndexCode.value = item.cameraIndexCode
|
||||
isCollect.value = item.isCollect
|
||||
getPreviewUrl(item.cameraIndexCode)
|
||||
})
|
||||
var opts = {
|
||||
position: new BMapGL.Point(item.longitude, item.latitude), // 指定文本标注所在的地理位置
|
||||
offset: new BMapGL.Size(-100, 30) // 设置文本偏移量
|
||||
};
|
||||
// 创建文本标注对象
|
||||
var label = new BMapGL.Label(item.cameraName, opts);
|
||||
// 自定义文本标注样式
|
||||
label.setStyle({
|
||||
display:'block',
|
||||
color: '#0b61b4',
|
||||
borderRadius: '0',
|
||||
borderColor: 'none',
|
||||
padding: '10px',
|
||||
border:0,
|
||||
fontWeight:'bold',
|
||||
fontFamily: '微软雅黑'
|
||||
});
|
||||
marker.value.addEventListener('mouseover', (e) => {
|
||||
label.setStyle({
|
||||
display:'block'
|
||||
});
|
||||
map.value.addOverlay(label);
|
||||
})
|
||||
marker.value.addEventListener('mouseout', (e) => {
|
||||
console.log('11111')
|
||||
label.setStyle({
|
||||
display:'none'
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user