perf(global): use larger spacing to avoid high CPU usage

This commit is contained in:
hamster1963 2024-11-22 10:12:38 +08:00
parent 5e51fb3d02
commit d63f5923ea

View File

@ -82,7 +82,7 @@ export async function Global({ countries = [] }: GlobalProps) {
// 获取国家的边界框
const bbox = turf.bbox(feature);
const spacing = 20; // 单位为千米,值越小点越密集
const spacing = 40; // 单位为千米,值越小点越密集
const options = { units: "kilometers" };
// @ts-expect-error ignore
const pointGrid = turf.pointGrid(bbox, spacing, options);