@styzy/vue-amap 1.3.0 → 1.4.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/lib/vue-amap.common.js +2747 -411
- package/lib/vue-amap.common.js.map +1 -1
- package/lib/vue-amap.umd.js +2748 -412
- package/lib/vue-amap.umd.js.map +1 -1
- package/lib/vue-amap.umd.min.js +1 -1
- package/lib/vue-amap.umd.min.js.map +1 -1
- package/package.json +63 -55
- package/tsconfig.json +34 -0
- package/types/index.d.ts +102 -0
package/package.json
CHANGED
|
@@ -1,55 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@styzy/vue-amap",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"lib": "vue-cli-service build --target lib --name vue-amap --dest lib src/index.
|
|
29
|
-
},
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@vue/cli-
|
|
43
|
-
"@vue/
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"eslint-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@styzy/vue-amap",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "An AMap Plugins For Vue.js",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"vue",
|
|
8
|
+
"amap",
|
|
9
|
+
"plugin"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git@github.com:styzy/vue-amap.git"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/styzy/vue-amap/issues",
|
|
18
|
+
"email": "styzyreal@126.com"
|
|
19
|
+
},
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "STYZY",
|
|
22
|
+
"email": "styzyreal@126.com",
|
|
23
|
+
"url": "https://our.styzy.cn"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "vue-cli-service serve --open",
|
|
27
|
+
"types": "vue-tsc --project tsconfig.types.json",
|
|
28
|
+
"lib": "vue-cli-service build --target lib --name vue-amap --dest lib src/index.ts"
|
|
29
|
+
},
|
|
30
|
+
"main": "lib/vue-amap.common.js",
|
|
31
|
+
"types": "types/index.d.ts",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"core-js": "^3.6.5",
|
|
34
|
+
"vue": "^2.6.11"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@babel/core": "^7.12.16",
|
|
38
|
+
"@babel/eslint-parser": "^7.12.16",
|
|
39
|
+
"@prettier/plugin-pug": "^1.19.2",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
41
|
+
"@typescript-eslint/parser": "^5.4.0",
|
|
42
|
+
"@vue/cli-plugin-babel": "~5.0.8",
|
|
43
|
+
"@vue/cli-plugin-eslint": "~5.0.8",
|
|
44
|
+
"@vue/cli-plugin-router": "~5.0.8",
|
|
45
|
+
"@vue/cli-plugin-typescript": "~5.0.0",
|
|
46
|
+
"@vue/cli-plugin-vuex": "~5.0.8",
|
|
47
|
+
"@vue/cli-service": "~5.0.8",
|
|
48
|
+
"@vue/eslint-config-prettier": "^6.0.0",
|
|
49
|
+
"@vue/eslint-config-typescript": "^9.1.0",
|
|
50
|
+
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
51
|
+
"eslint": "^7.32.0",
|
|
52
|
+
"eslint-config-prettier": "^8.3.0",
|
|
53
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
54
|
+
"eslint-plugin-vue": "^8.0.3",
|
|
55
|
+
"prettier": "^2.4.1",
|
|
56
|
+
"stylus": "^0.54.7",
|
|
57
|
+
"stylus-loader": "^3.0.2",
|
|
58
|
+
"typescript": "~4.5.5",
|
|
59
|
+
"vue-cli-plugin-pug": "~2.0.0",
|
|
60
|
+
"vue-template-compiler": "^2.6.14"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"strict": true,
|
|
6
|
+
"jsx": "preserve",
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"useDefineForClassFields": true,
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
"baseUrl": ".",
|
|
15
|
+
"types": ["webpack-env"],
|
|
16
|
+
"paths": {
|
|
17
|
+
"@/*": ["src/*"],
|
|
18
|
+
"@types": ["types"]
|
|
19
|
+
},
|
|
20
|
+
"lib": ["esnext", "dom", "dom.iterable", "scripthost"],
|
|
21
|
+
"outDir": "dist"
|
|
22
|
+
},
|
|
23
|
+
"include": [
|
|
24
|
+
"types/index.d.ts",
|
|
25
|
+
"src/**/*.ts",
|
|
26
|
+
"src/**/*.tsx",
|
|
27
|
+
"src/**/*.vue",
|
|
28
|
+
"test/**/*.ts",
|
|
29
|
+
"test/**/*.tsx",
|
|
30
|
+
"test/**/*.vue"
|
|
31
|
+
],
|
|
32
|
+
"exclude": ["node_modules"]
|
|
33
|
+
}
|
|
34
|
+
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
type AMap = any
|
|
2
|
+
|
|
3
|
+
type AMapLoaderConfigOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* 高德地图 API 密钥
|
|
6
|
+
*/
|
|
7
|
+
key: string
|
|
8
|
+
/**
|
|
9
|
+
* SDK 版本
|
|
10
|
+
*/
|
|
11
|
+
version: string
|
|
12
|
+
/**
|
|
13
|
+
* UI库 版本
|
|
14
|
+
*/
|
|
15
|
+
uiVersion: string
|
|
16
|
+
/**
|
|
17
|
+
* 插件列表
|
|
18
|
+
*/
|
|
19
|
+
plugins: Array<string>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 高德地图 SDK 加载器
|
|
24
|
+
*/
|
|
25
|
+
interface IAMapLoader {
|
|
26
|
+
/**
|
|
27
|
+
* 高德地图 API 密钥
|
|
28
|
+
*/
|
|
29
|
+
key: string
|
|
30
|
+
/**
|
|
31
|
+
* SDK 版本
|
|
32
|
+
*/
|
|
33
|
+
version: string
|
|
34
|
+
/**
|
|
35
|
+
* UI库 版本
|
|
36
|
+
*/
|
|
37
|
+
uiVersion: string
|
|
38
|
+
/**
|
|
39
|
+
* 插件列表
|
|
40
|
+
*/
|
|
41
|
+
plugins: Array<string>
|
|
42
|
+
/**
|
|
43
|
+
* 回调函数名称
|
|
44
|
+
*/
|
|
45
|
+
callbackName: string
|
|
46
|
+
/**
|
|
47
|
+
* 是否已加载 SDK
|
|
48
|
+
*/
|
|
49
|
+
isSdkLoaded: boolean
|
|
50
|
+
/**
|
|
51
|
+
* 是否正在加载 SDK
|
|
52
|
+
*/
|
|
53
|
+
isSdkLoading: boolean
|
|
54
|
+
/**
|
|
55
|
+
* 加载完成后的回调函数列表
|
|
56
|
+
*/
|
|
57
|
+
callbacks: Array<() => void>
|
|
58
|
+
/**
|
|
59
|
+
* 配置高德地图 SDK 加载器
|
|
60
|
+
* @param options 高德地图 SDK 加载器配置项
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
config: (options: AMapLoaderConfigOptions) => void
|
|
64
|
+
/**
|
|
65
|
+
* 加载高德地图 SDK
|
|
66
|
+
* - 使用 await 等待加载完成
|
|
67
|
+
* - 加载完成后,返回 AMap 类
|
|
68
|
+
*/
|
|
69
|
+
load: () => Promise<AMap>
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
type InitOptions = AMapLoaderConfigOptions & {
|
|
73
|
+
/**
|
|
74
|
+
* 全局地图选项
|
|
75
|
+
*/
|
|
76
|
+
globalMapOptions: GlobalMapOptions
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type GlobalMapOptions = Record<string, any>
|
|
80
|
+
|
|
81
|
+
declare module '@styzy/vue-amap' {
|
|
82
|
+
import { PluginFunction } from 'vue'
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 高德地图管理器
|
|
86
|
+
*/
|
|
87
|
+
export default class AMapManager {
|
|
88
|
+
/**
|
|
89
|
+
* 高德地图管理器版本号
|
|
90
|
+
*/
|
|
91
|
+
static version: string
|
|
92
|
+
/**
|
|
93
|
+
* 安装高德地图组件,提供给 Vue 安装,注册组件
|
|
94
|
+
*/
|
|
95
|
+
static install: PluginFunction<void>
|
|
96
|
+
/**
|
|
97
|
+
* 初始化高德地图 SDK,加载地图脚本
|
|
98
|
+
* @param options 高德地图 SDK 加载器配置项
|
|
99
|
+
*/
|
|
100
|
+
static initAMap(options: InitOptions): Promise<AMap>
|
|
101
|
+
}
|
|
102
|
+
}
|