|
|
@ -127,6 +127,12 @@ export class MarkerCluster { |
|
|
|
const startIndex = (page - 1) * pageSize; |
|
|
|
const endIndex = startIndex + pageSize; |
|
|
|
let num = (page - 1) * pageSize; |
|
|
|
if (data.length === 0 || data.length === 1) { |
|
|
|
return this.infoWindow.close(); |
|
|
|
} |
|
|
|
const { latitude: lat, longitude: lng } = data[0].extData; |
|
|
|
const lngLatStr = `${parseFloat(lng)}/${parseFloat(lat)}`; //更新清除节点后的数据
|
|
|
|
data = lngLatMap[lngLatStr]; |
|
|
|
// 截取当前页的数据
|
|
|
|
const currentPageData = data.slice(startIndex, endIndex); |
|
|
|
window.currentPageData = currentPageData; |
|
|
@ -146,7 +152,7 @@ export class MarkerCluster { |
|
|
|
.join(""); |
|
|
|
// 渲染当前页数据
|
|
|
|
dataContainer.innerHTML = itemsTpl; |
|
|
|
dataPage.innerHTML = `第${page}页`; |
|
|
|
dataPage && (dataPage.innerHTML = `第${page}页`); |
|
|
|
bindItemClick(); |
|
|
|
} |
|
|
|
|
|
|
|