augustine-jkmap 1.1.2 → 1.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "augustine-jkmap",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "A Vue 2 component library",
5
5
  "main": "dist/augustine-jkmap.common.js",
6
6
  "unpkg": "dist/augustine-jkmap.umd.min.js",
@@ -35,7 +35,7 @@
35
35
  "scripts": {
36
36
  "build": "vue-cli-service build --target lib --name augustine-jkmap src/index.js",
37
37
  "prepare": "npm run build",
38
- "upgrade": "npm version patch && npm run build && npm publish --//registry.npmjs.org/:_authToken=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"
38
+ "upgrade": "npm version patch && npm run build && npm publish --//registry.npmjs.org/:_authToken=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"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "vue": "^2.6.0 || ^2.7.0"
@@ -1738,7 +1738,26 @@ async function createMaskLayer(polygonDataList = [], options, context = null, ma
1738
1738
  return null
1739
1739
  }
1740
1740
  }
1741
+ /**
1742
+ * 防抖
1743
+ * @param {*} fn
1744
+ * @param {*} delay
1745
+ * @returns
1746
+ */
1747
+ function debounce(fn, delay = 300) {
1748
+ let timer = null // 存储定时器
1749
+ return function (...args) {
1750
+ // 清除上一次的定时器
1751
+ if (timer) clearTimeout(timer)
1752
+ // 重新设置定时器,延迟执行
1753
+ timer = setTimeout(() => {
1754
+ fn.apply(this, args) // 保留 this 指向和函数参数
1755
+ timer = null // 执行后清空定时器
1756
+ }, delay)
1757
+ }
1758
+ }
1741
1759
  export {
1760
+ debounce,
1742
1761
  arcGISTranformGeoJson,
1743
1762
  geoJsonTranformArcgis,
1744
1763
  geoJsonTranformWkt,
package/src/README.md DELETED
@@ -1,46 +0,0 @@
1
- # augustine_xumap
2
-
3
- A Vue 2 & 3 compatible component library.
4
-
5
- ## 发布代码
6
- ls lib/ # 看是否有 JS 文件
7
- npm pack --dry-run # 看是否包含 lib/ 内容
8
- # 删除命令(谨慎使用)
9
- npm unpublish augustine_xumap@0.0.1
10
- npm publish --//registry.npmjs.org/:_authToken=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
11
-
12
- npm version patch # 0.0.1 → 0.0.2
13
- npm version minor # 0.0.1 → 0.1.0
14
- npm version major # 0.0.1 → 1.0.0
15
-
16
- # 1. 升级版本(比如升补丁版)
17
- npm version patch
18
-
19
- # 输出:v0.0.2
20
-
21
- # 2. 构建(确保 lib/ 是最新的)
22
- npm run build
23
-
24
- # 3. 发布新版本
25
- npm publish
26
-
27
- ## Install
28
-
29
- ```bash
30
- npm install augustine_xumap
31
- ```
32
-
33
- ## Usage
34
-
35
- ### Vue 3 (Vite)
36
- import "augustine_xumap/lib/style.css";
37
- import * as augustineXuMap from "augustine_xumap";
38
- const { mapList } = augustineXuMap;
39
- import { mapJump } from "augustine_xumap/utils/toArcGISPoint";
40
-
41
- ## Supports
42
- - ✅ Vue 2.6+ and Vue 3
43
- - ✅ Vite & Webpack
44
- - ✅ Source Map debugging
45
- - ✅ Tree-shaking
46
- - ✅ Auto-import via `unplugin-vue-components`