// 設(shè)置積水點(diǎn)彈窗
setPopupTemplate () {
// 積水點(diǎn)
? return {
titleExp:'$feature.name',
title:'{name}',
content: [{
type:'fields',
fieldInfos: [
{fieldName:'regionName',label:'區(qū)域' },
{fieldName:'name',label:'積水點(diǎn)名稱(chēng)' },
{fieldName:'pondingCondition',label:'積水點(diǎn)情況' },
{fieldName:'manageUnit',label:'管理單位' },
{fieldName:'originCode',label:'來(lái)源' },
{fieldName:'createTime',label:'上報(bào)時(shí)間' },
{fieldName:'annual',label:'年度' },
{fieldName:'address',label:'地址' }
]
}],
// 設(shè)置顯示更多,點(diǎn)擊事件喝噪,初始化時(shí)添加
actions: [
{
title:'查看更多',
id:'more-this',
// obj_uid: uid,
? ? ? ? image:require('@/assets/images/amap/smile.png')
}
]
}
},
?// 設(shè)置字段
setFields () {
return [
{name:'regionName',alias:'區(qū)域',type:'string' },
{name:'name',alias:'積水點(diǎn)名稱(chēng)',type:'string' },
{name:'pondingCondition',alias:'積水點(diǎn)情況',type:'string' },
{name:'originCode',alias:'來(lái)源',type:'string' },
{name:'createTime',alias:'上報(bào)時(shí)間',type:'string' },
{name:'annual',alias:'年度',type:'string' },
{name:'address',alias:'地址',type:'string' },
{name:'manageUnit',alias:'管理單位',type:'string' }
]
},
?// 設(shè)置渲染點(diǎn)
setRenderer () {
const symbol = {
type:'picture-marker',
url:require('@/assets/images/amap/積水點(diǎn).png'),
width:'24px',
height:'24px'
? }
return {
type:'simple',
symbol:symbol
? }
}
// 添加圖層圆兵,自行根據(jù)自己代碼添加
this.currentLayer =this.setPoint(data.data,'memberMap')
JTMapKit.mapView.map.layers.add(this.currentLayer)
// 地圖初始化時(shí)添加監(jiān)聽(tīng)更多點(diǎn)擊事件
// 地圖標(biāo)注氣泡框宙橱,(查看更多)
JTMapKit.mapView.popup.on('trigger-action',function (event) {
if (event.action.id ==='more-this') {
that.dialogVisible =true
? ? // that.hazardId = event.target.features[0].attributes.id
? ? that.dialogForm = event.target.features[0].attributes
? }
})