footprint-globe 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -2
- package/dist/auto.cjs +1351 -0
- package/dist/auto.cjs.map +1 -0
- package/dist/auto.js +1349 -0
- package/dist/auto.js.map +1 -0
- package/dist/footprint-globe.css +178 -0
- package/dist/index.cjs +1613 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +369 -0
- package/dist/index.d.ts +369 -0
- package/dist/index.js +1579 -0
- package/dist/index.js.map +1 -0
- package/package.json +73 -4
package/README.md
CHANGED
|
@@ -1,3 +1,86 @@
|
|
|
1
|
-
#
|
|
1
|
+
# footprint-globe
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
足迹地球核心引擎。3D 地球,无 token,可嵌入。
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/footprint-globe)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## 安装
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm i footprint-globe maplibre-gl
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`maplibre-gl` 是 peer dependency。
|
|
15
|
+
|
|
16
|
+
## 用法
|
|
17
|
+
|
|
18
|
+
### 零构建(浏览器直接引入,推荐)
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/footprint-globe@1/dist/auto.js"></script>
|
|
22
|
+
|
|
23
|
+
<footprint-globe
|
|
24
|
+
data-src="./pins.json"
|
|
25
|
+
height="480px"
|
|
26
|
+
legend="true">
|
|
27
|
+
</footprint-globe>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`dist/auto.js` 是**自包含**产物(含 Web Component 与 auto-init),无需 importmap。零构建用户**不需要**安装 maplibre-gl(引擎按需从 CDN 加载,可用 `maplibre-url` 自托管)。
|
|
31
|
+
|
|
32
|
+
### 构建工具(Vite / Webpack)
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { FootprintGlobe } from 'footprint-globe';
|
|
36
|
+
import maplibregl from 'maplibre-gl';
|
|
37
|
+
import 'maplibre-gl/dist/maplibre-gl.css';
|
|
38
|
+
import 'footprint-globe/dist/footprint-globe.css';
|
|
39
|
+
|
|
40
|
+
const globe = new FootprintGlobe(document.getElementById('globe')!, {
|
|
41
|
+
config: {
|
|
42
|
+
version: 1,
|
|
43
|
+
categories: [
|
|
44
|
+
{
|
|
45
|
+
id: 'travel',
|
|
46
|
+
label: '旅行',
|
|
47
|
+
color: '#f97316',
|
|
48
|
+
pins: [{ name: '东京', coords: [139.759, 35.682] }],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
maplibre: maplibregl,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// globe.update({ config: { theme: 'dark' } });
|
|
56
|
+
// globe.destroy();
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 导出
|
|
60
|
+
|
|
61
|
+
- 类:`FootprintGlobe` / `FootprintGlobeElement`
|
|
62
|
+
- Web Component:`register` / `autoInit` / `boot`
|
|
63
|
+
- 工具:`validateConfig` / `normalizeConfig` / `loadData` / `parseCsv` / `parseGeoJson`
|
|
64
|
+
- 错误:`FootprintError` / `isFootprintError`
|
|
65
|
+
- 类型:`FootprintConfig` / `Category` / `Pin` / `RenderConfig` / `FootprintGlobeOptions` 等
|
|
66
|
+
- 常量:`DEFAULT_STYLE` / `DEFAULT_CENTER` / `DEFAULT_ZOOM` / `LIMITS` 等
|
|
67
|
+
|
|
68
|
+
## 特性
|
|
69
|
+
|
|
70
|
+
- 3D 地球(globe 投影)
|
|
71
|
+
- 多分类标记、动态图例、单例弹窗
|
|
72
|
+
- 配置协议 v1
|
|
73
|
+
- 数据格式:JSON / CSV / GeoJSON
|
|
74
|
+
- 隐私模式(坐标模糊、仅城市)
|
|
75
|
+
- 优雅降级(WebGL 不可用时列表视图)
|
|
76
|
+
- 事件:`ready` / `error` / `marker:click`
|
|
77
|
+
|
|
78
|
+
## 文档
|
|
79
|
+
|
|
80
|
+
- [完整文档](https://footprint-studio.pages.dev/)
|
|
81
|
+
- [API](https://footprint-studio.pages.dev/api/footprint-globe)
|
|
82
|
+
- [配置协议](https://footprint-studio.pages.dev/guide/config-protocol)
|
|
83
|
+
|
|
84
|
+
## 许可
|
|
85
|
+
|
|
86
|
+
MIT © 2025 Footprint Studio
|