footprint-globe 1.0.0 → 1.2.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 CHANGED
@@ -15,6 +15,22 @@ npm i footprint-globe maplibre-gl
15
15
 
16
16
  ## 用法
17
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 与 maplibre-gl CSS),无需 importmap、无需另引 CSS。零构建用户**不需要**安装 maplibre-gl(JS 引擎按需从 CDN 加载,可用 `maplibre-url` 自托管)。
31
+
32
+ ### 构建工具(Vite / Webpack)
33
+
18
34
  ```ts
19
35
  import { FootprintGlobe } from 'footprint-globe';
20
36
  import maplibregl from 'maplibre-gl';
@@ -42,7 +58,8 @@ const globe = new FootprintGlobe(document.getElementById('globe')!, {
42
58
 
43
59
  ## 导出
44
60
 
45
- - 类:`FootprintGlobe`
61
+ - 类:`FootprintGlobe` / `FootprintGlobeElement`
62
+ - Web Component:`register` / `autoInit` / `boot`
46
63
  - 工具:`validateConfig` / `normalizeConfig` / `loadData` / `parseCsv` / `parseGeoJson`
47
64
  - 错误:`FootprintError` / `isFootprintError`
48
65
  - 类型:`FootprintConfig` / `Category` / `Pin` / `RenderConfig` / `FootprintGlobeOptions` 等