|
|
@ -39,7 +39,7 @@ export class MarkerCluster { |
|
|
|
markerCluster; |
|
|
|
infoWindow; |
|
|
|
|
|
|
|
data = []; |
|
|
|
data = []; //标注集合
|
|
|
|
|
|
|
|
constructor() {} |
|
|
|
|
|
|
@ -115,7 +115,7 @@ export class MarkerCluster { |
|
|
|
window.totalPages = totalPages; |
|
|
|
let num = (page - 1) * pageSize; |
|
|
|
function renderData(page) { |
|
|
|
if (page < 1 || page > totalPages) return; |
|
|
|
if (!data || page < 1 || page > totalPages) return; |
|
|
|
window.page = page; |
|
|
|
const pageSize = window.pageSize; |
|
|
|
const dataContainer = document.getElementById("dataContainer"); |
|
|
@ -127,7 +127,7 @@ export class MarkerCluster { |
|
|
|
const startIndex = (page - 1) * pageSize; |
|
|
|
const endIndex = startIndex + pageSize; |
|
|
|
let num = (page - 1) * pageSize; |
|
|
|
if (!data || data.length === 0 || data.length === 1) { |
|
|
|
if (data.length === 0 || data.length === 1) { |
|
|
|
return this.infoWindow.close(); |
|
|
|
} |
|
|
|
const { latitude: lat, longitude: lng } = data[0].extData; |
|
|
@ -391,6 +391,9 @@ export class MarkerCluster { |
|
|
|
setData() { |
|
|
|
this.markerCluster.setData(this.data); |
|
|
|
} |
|
|
|
clear() { |
|
|
|
this.data = []; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export function getContent(data) { |
|
|
|