const res = await delAssessApi()
this.dixiaList = res.data
// let box = 2
// this.dixiahailiang(box)
this.map.clearMap()
var style = [
{
url: jiedao,
anchor: new AMap.Pixel(3, 3),
size: new AMap.Size(5.5, 5.5),
},
]
this.dixiaList = this.dixiaList.map(item => ({
lnglat: new AMap.LngLat(item[0], item[1]), // 如果数据是经纬度数组
}))
var mass = new AMap.MassMarks(this.dixiaList, {
opacity: 0.8,
zIndex: 111,
cursor: 'pointer',
style: style
})
var marker = new AMap.Marker({ content: ' ', map: this.map })
mass.on('mouseover', function (e) {
marker.setPosition(e.data.lnglat)
// marker.setLabel({ content: e.data.name })
})
mass.setMap(this.map)
// 调整视野以适应所有标记
// this.map.setFitView()
const res = await delAssessApi() this.dixiaList = res.data // let box = 2 // this.dixiahailiang(box) this.map.clearMap() var style = [ { url: jiedao, anchor: new AMap.Pixel(3, 3), size: new AMap.Size(5.5, 5.5), }, ] this.dixiaList = this.dixiaList.map(item => ({ lnglat: new AMap.LngLat(item[0], item[1]), // 如果数据是经纬度数组 })) var mass = new AMap.MassMarks(this.dixiaList, { opacity: 0.8, zIndex: 111, cursor: 'pointer', style: style }) var marker = new AMap.Marker({ content: ' ', map: this.map }) mass.on('mouseover', function (e) { marker.setPosition(e.data.lnglat) // marker.setLabel({ content: e.data.name }) }) mass.setMap(this.map) // 调整视野以适应所有标记 // this.map.setFitView()