百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

supercluster

> 编程语言
开源

一个适用于浏览器和 Node 的非常快速的地理空间点聚类库。

2.3K stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个适用于浏览器和 Node 的非常快速的地理空间点聚类库。

超级集群 () ()

一个用于浏览器和 Node 的非常快速的 JavaScript 库,用于地理空间点聚类。

javascript
const index = new Supercluster({radius: 40, maxZoom: 16});
index.load(points);

const clusters = index.getClusters([-180, -85, 180, 85], 2);

在 Leaflet 中聚类 600 万个点: Supercluster 专为在 Mapbox GL JS 中实现聚类而构建。请在 Mapbox 博客 中阅读有关其工作原理的信息。

安装

使用 NPM(npm install supercluster) 或 Yarn(yarn add supercluster) 安装,然后:

javascript
// import as a ES module in Node
import Supercluster from 'supercluster';

// import from a CDN in the browser:
import Supercluster from 'https://esm.run/supercluster';

或者在浏览器中使用普通的脚本标签:

xml
<script src="https://unpkg.com/[email protected]/dist/supercluster.min.js"></script>

方法

load(points)

加载 GeoJSON Feature 对象的数组。每个特征的 geometry 必须是 GeoJSON Point 或 MultiPoint — MultiPoint 以每个坐标为单独点进行聚集,每个点继承特征的 properties 和 id。加载后,索引是不可变的。

getTileRaw(z, x, y)

相同的图块,但每个特征都是平面的 - {type: 4, x, y, tags}, 坐标以内联形式显示,而不是包含在嵌套的 geometry 数组中。每个聚集特征都是一个单点,因此

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptalgorithmclusteringcomputational-geometryjavascript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言