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