gis-common 5.1.16 → 5.1.18
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/dist/gis-common.es.js +1984 -2057
- package/dist/gis-common.umd.js +1 -1
- package/dist/index.d.ts +1639 -4
- package/package.json +4 -4
- package/dist/constant/CaseType.d.ts +0 -8
- package/dist/constant/ErrorType.d.ts +0 -31
- package/dist/constant/EventType.d.ts +0 -24
- package/dist/constant/FormType.d.ts +0 -6
- package/dist/constant/GraphicTypes.d.ts +0 -26
- package/dist/constant/LayerType.d.ts +0 -10
- package/dist/constant/index.d.ts +0 -6
- package/dist/core/AudioPlayer.d.ts +0 -20
- package/dist/core/CanvasDrawer.d.ts +0 -37
- package/dist/core/Color.d.ts +0 -65
- package/dist/core/Cookie.d.ts +0 -5
- package/dist/core/DateTime.d.ts +0 -43
- package/dist/core/EventDispatcher.d.ts +0 -13
- package/dist/core/FullScreen.d.ts +0 -16
- package/dist/core/HashMap.d.ts +0 -20
- package/dist/core/MqttClient.d.ts +0 -32
- package/dist/core/Storage.d.ts +0 -51
- package/dist/core/WebGL.d.ts +0 -31
- package/dist/core/WebSocketClient.d.ts +0 -15
- package/dist/core/index.d.ts +0 -12
- package/dist/types.d.ts +0 -101
- package/dist/utils/AjaxUtil.d.ts +0 -109
- package/dist/utils/ArrayUtil.d.ts +0 -45
- package/dist/utils/AssertUtil.d.ts +0 -15
- package/dist/utils/BrowserUtil.d.ts +0 -85
- package/dist/utils/CommUtil.d.ts +0 -105
- package/dist/utils/CoordsUtil.d.ts +0 -43
- package/dist/utils/DomUtil.d.ts +0 -90
- package/dist/utils/ExceptionUtil.d.ts +0 -15
- package/dist/utils/FileUtil.d.ts +0 -33
- package/dist/utils/GeoJsonUtil.d.ts +0 -76
- package/dist/utils/GeoUtil.d.ts +0 -151
- package/dist/utils/ImageUtil.d.ts +0 -43
- package/dist/utils/MathUtil.d.ts +0 -37
- package/dist/utils/MessageUtil.d.ts +0 -34
- package/dist/utils/ObjectUtil.d.ts +0 -30
- package/dist/utils/OptimizeUtil.d.ts +0 -43
- package/dist/utils/StringUtil.d.ts +0 -34
- package/dist/utils/TreeUtil.d.ts +0 -25
- package/dist/utils/UrlUtil.d.ts +0 -18
- package/dist/utils/ValidateUtil.d.ts +0 -26
- package/dist/utils/index.d.ts +0 -20
package/dist/utils/AjaxUtil.d.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
export type AjaxGetOption = {
|
|
2
|
-
headers?: any;
|
|
3
|
-
responseType?: any;
|
|
4
|
-
credentials?: any;
|
|
5
|
-
jsonp?: any;
|
|
6
|
-
};
|
|
7
|
-
export type AjaxPostOption = {
|
|
8
|
-
url?: any;
|
|
9
|
-
headers?: any;
|
|
10
|
-
postData?: any;
|
|
11
|
-
cb?: Callback;
|
|
12
|
-
};
|
|
13
|
-
export type Callback = (...params: any[]) => any;
|
|
14
|
-
declare const _default: {
|
|
15
|
-
/**
|
|
16
|
-
* Get JSON data by jsonp
|
|
17
|
-
* @param url - resource url
|
|
18
|
-
* @param callback - callback function when completed
|
|
19
|
-
*/
|
|
20
|
-
jsonp<T>(url: string, callback: (err: null | Error, data: T) => void): void;
|
|
21
|
-
/**
|
|
22
|
-
* Fetch remote resource by HTTP "GET" method
|
|
23
|
-
* @param {String} url - resource url
|
|
24
|
-
* @param {Object} [options=null] - request options
|
|
25
|
-
* @param {Object} [options.headers=null] - HTTP headers
|
|
26
|
-
* @param {String} [options.responseType=null] - responseType
|
|
27
|
-
* @param {String} [options.credentials=null] - if with credentials, set it to "include"
|
|
28
|
-
* @param {Function} cb - callback function when completed
|
|
29
|
-
* @return {Ajax} Ajax
|
|
30
|
-
* @example
|
|
31
|
-
* AjaxUtil.get(
|
|
32
|
-
* 'url/to/resource',
|
|
33
|
-
* (data, err) => {
|
|
34
|
-
* if (err) {
|
|
35
|
-
* throw new Error(err);
|
|
36
|
-
* }
|
|
37
|
-
* // do things with data
|
|
38
|
-
* }
|
|
39
|
-
* );
|
|
40
|
-
*/
|
|
41
|
-
get(url: string, options?: AjaxGetOption, cb?: any): XMLHttpRequest;
|
|
42
|
-
/**
|
|
43
|
-
* Fetch remote resource by HTTP "POST" method
|
|
44
|
-
* @param {String} url - resource url
|
|
45
|
-
* @param {Object} options - request options
|
|
46
|
-
* @param {String|Object} options.postData - post data
|
|
47
|
-
* @param {Object} [options.headers=null] - HTTP headers
|
|
48
|
-
* @param {Function} cb - callback function when completed
|
|
49
|
-
* @return {Ajax} Ajax
|
|
50
|
-
* @example
|
|
51
|
-
* AjaxUtil.post(
|
|
52
|
-
* 'url/to/post',
|
|
53
|
-
* {
|
|
54
|
-
* postData : {
|
|
55
|
-
* 'param0' : 'val0',
|
|
56
|
-
* 'param1' : 1
|
|
57
|
-
* }
|
|
58
|
-
* },
|
|
59
|
-
* (data, err) => {
|
|
60
|
-
* if (err) {
|
|
61
|
-
* throw new Error(err);
|
|
62
|
-
* }
|
|
63
|
-
* // do things with data
|
|
64
|
-
* }
|
|
65
|
-
* );
|
|
66
|
-
*/
|
|
67
|
-
post(url: string, options?: AjaxPostOption, cb?: Callback): XMLHttpRequest;
|
|
68
|
-
_wrapCallback(client: XMLHttpRequest, cb: Callback): () => void;
|
|
69
|
-
_getClient(cb: Callback): XMLHttpRequest;
|
|
70
|
-
/**
|
|
71
|
-
* Fetch resource as arraybuffer.
|
|
72
|
-
* @param {String} url - url
|
|
73
|
-
* @param {Object} [options=null] - options, same as AjaxUtil.get
|
|
74
|
-
* @param {Function} cb - callback function when completed.
|
|
75
|
-
* @example
|
|
76
|
-
* AjaxUtil.getArrayBuffer(
|
|
77
|
-
* 'url/to/resource.bin',
|
|
78
|
-
* (data, err) => {
|
|
79
|
-
* if (err) {
|
|
80
|
-
* throw new Error(err);
|
|
81
|
-
* }
|
|
82
|
-
* // data is a binary array
|
|
83
|
-
* }
|
|
84
|
-
* );
|
|
85
|
-
*/
|
|
86
|
-
getArrayBuffer(url: string, options: AjaxGetOption | Callback, cb: Callback): XMLHttpRequest;
|
|
87
|
-
getImage(img: any, url: string, options: any): XMLHttpRequest;
|
|
88
|
-
/**
|
|
89
|
-
* Fetch resource as a JSON Object.
|
|
90
|
-
* @param {String} url - json's url
|
|
91
|
-
* @param {Object} [options=null] - optional options
|
|
92
|
-
* @param {String} [options.jsonp=false] - fetch by jsonp, false by default
|
|
93
|
-
* @param {Function} cb - callback function when completed.
|
|
94
|
-
* @example
|
|
95
|
-
* AjaxUtil.getJSON(
|
|
96
|
-
* 'url/to/resource.json',
|
|
97
|
-
* { jsonp : true },
|
|
98
|
-
* (json, err) => {
|
|
99
|
-
* if (err) {
|
|
100
|
-
* throw new Error(err);
|
|
101
|
-
* }
|
|
102
|
-
* // json is a JSON Object
|
|
103
|
-
* console.log(json.foo);
|
|
104
|
-
* }
|
|
105
|
-
* );
|
|
106
|
-
*/
|
|
107
|
-
getJSON(url: string, options?: AjaxGetOption | Callback, cb?: Callback): any;
|
|
108
|
-
};
|
|
109
|
-
export default _default;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
/**
|
|
3
|
-
* 创建指定长度的数组,并返回其索引数组
|
|
4
|
-
*
|
|
5
|
-
* @param length 数组长度
|
|
6
|
-
* @returns 索引数组
|
|
7
|
-
*/
|
|
8
|
-
create(length: number): number[];
|
|
9
|
-
/**
|
|
10
|
-
* 合并多个数组,并去重
|
|
11
|
-
*
|
|
12
|
-
* @param args 需要合并的数组
|
|
13
|
-
* @returns 合并后的去重数组
|
|
14
|
-
*/
|
|
15
|
-
union<T>(...args: T[][]): T[];
|
|
16
|
-
/**
|
|
17
|
-
* 求多个数组的交集
|
|
18
|
-
*
|
|
19
|
-
* @param args 多个需要求交集的数组
|
|
20
|
-
* @returns 返回多个数组的交集数组
|
|
21
|
-
*/
|
|
22
|
-
intersection<T>(...args: T[][]): T[];
|
|
23
|
-
/**
|
|
24
|
-
* 将多个数组拼接为一个数组,并去除其中的空值。
|
|
25
|
-
*
|
|
26
|
-
* @param args 需要拼接的数组列表。
|
|
27
|
-
* @returns 拼接并去空后的数组。
|
|
28
|
-
*/
|
|
29
|
-
unionAll(...args: any[]): any[];
|
|
30
|
-
/**
|
|
31
|
-
* 求差集
|
|
32
|
-
*
|
|
33
|
-
* @param args 任意个集合
|
|
34
|
-
* @returns 返回差集结果
|
|
35
|
-
*/
|
|
36
|
-
difference(...args: any[]): any;
|
|
37
|
-
/**
|
|
38
|
-
* 对字符串数组进行中文排序
|
|
39
|
-
*
|
|
40
|
-
* @param arr 待排序的字符串数组
|
|
41
|
-
* @returns 排序后的字符串数组
|
|
42
|
-
*/
|
|
43
|
-
zhSort(arr: any[], f?: (d: any) => string, reverse?: boolean): any[];
|
|
44
|
-
};
|
|
45
|
-
export default _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { LngLat } from '../types';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
assertEmpty(...arg: any[]): void;
|
|
4
|
-
assertInteger(...arg: any[]): void;
|
|
5
|
-
assertNumber(...arg: any[]): void;
|
|
6
|
-
assertArray(...arg: any[]): void;
|
|
7
|
-
assertFunction(...arg: any[]): void;
|
|
8
|
-
assertColor(...arg: any[]): void;
|
|
9
|
-
assertLnglat(...arg: LngLat[]): void;
|
|
10
|
-
assertGeoJson(...arg: any[]): void;
|
|
11
|
-
assertContain(str: string, ...args: string[]): void;
|
|
12
|
-
assertStartWith(value: string, prefix: string): void;
|
|
13
|
-
assertEndWith(value: string, prefix: string): void;
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
interface BrowserType {
|
|
2
|
-
type: string;
|
|
3
|
-
version: string;
|
|
4
|
-
}
|
|
5
|
-
export default class BrowserUtil {
|
|
6
|
-
static readonly document: Document;
|
|
7
|
-
static readonly navigator: Navigator;
|
|
8
|
-
static readonly userAgent: string;
|
|
9
|
-
static readonly screen: Screen;
|
|
10
|
-
/**
|
|
11
|
-
* 获取系统类型
|
|
12
|
-
*
|
|
13
|
-
* @returns 返回一个包含系统类型和版本的对象
|
|
14
|
-
*/
|
|
15
|
-
static getSystem(): BrowserType;
|
|
16
|
-
/**
|
|
17
|
-
* 获取浏览器类型信息
|
|
18
|
-
*
|
|
19
|
-
* @returns 浏览器类型信息,包含浏览器类型和版本号
|
|
20
|
-
*/
|
|
21
|
-
static getExplorer(): BrowserType;
|
|
22
|
-
/**
|
|
23
|
-
* 判断当前浏览器是否支持WebGL
|
|
24
|
-
*
|
|
25
|
-
* @returns 如果支持WebGL则返回true,否则返回false
|
|
26
|
-
*/
|
|
27
|
-
static isSupportWebGL(): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* 获取GPU信息
|
|
30
|
-
*
|
|
31
|
-
* @returns 返回包含GPU类型和型号的对象
|
|
32
|
-
*/
|
|
33
|
-
static getGPU(): {
|
|
34
|
-
type: string;
|
|
35
|
-
model: string;
|
|
36
|
-
spec: {
|
|
37
|
-
maxTextureSize: number;
|
|
38
|
-
maxRenderBufferSize: number;
|
|
39
|
-
maxTextureUnits: number;
|
|
40
|
-
};
|
|
41
|
-
} | {
|
|
42
|
-
type: string;
|
|
43
|
-
model: string;
|
|
44
|
-
spec?: undefined;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* 获取当前浏览器设置的语言
|
|
48
|
-
*
|
|
49
|
-
* @returns 返回浏览器设置的语言,格式为 "语言_地区",例如 "zh_CN"。如果获取失败,则返回 "Unknown"。
|
|
50
|
-
*/
|
|
51
|
-
static getLanguage(): string;
|
|
52
|
-
/**
|
|
53
|
-
* 获取当前环境的时区。
|
|
54
|
-
*
|
|
55
|
-
* @returns 返回当前环境的时区,若获取失败则返回 undefined。
|
|
56
|
-
*/
|
|
57
|
-
static getTimeZone(): string;
|
|
58
|
-
/**
|
|
59
|
-
* 获取屏幕帧率
|
|
60
|
-
*
|
|
61
|
-
* @returns 返回一个Promise,resolve为计算得到的屏幕帧率
|
|
62
|
-
* eg: const fps = await BrowserUtil.getScreenFPS()
|
|
63
|
-
*/
|
|
64
|
-
static getScreenFPS(): Promise<unknown>;
|
|
65
|
-
/**
|
|
66
|
-
* 获取IP地址
|
|
67
|
-
*
|
|
68
|
-
* @returns 返回一个Promise,当成功获取到IP地址时resolve,返回IP地址字符串;当获取失败时reject,返回undefined
|
|
69
|
-
*/
|
|
70
|
-
static getIPAddress(): Promise<unknown>;
|
|
71
|
-
/**
|
|
72
|
-
* 获取网络状态信息
|
|
73
|
-
*
|
|
74
|
-
* @returns 返回包含网络状态信息的对象,包含以下属性:
|
|
75
|
-
* - network: 网络类型,可能的值为 'wifi'、'4g' 等
|
|
76
|
-
* - isOnline: 是否在线,为 true 或 false
|
|
77
|
-
* - ip: 当前设备的 IP 地址
|
|
78
|
-
*/
|
|
79
|
-
static getNetwork(): Promise<{
|
|
80
|
-
network: string;
|
|
81
|
-
isOnline: boolean;
|
|
82
|
-
ip: unknown;
|
|
83
|
-
}>;
|
|
84
|
-
}
|
|
85
|
-
export {};
|
package/dist/utils/CommUtil.d.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
/**
|
|
3
|
-
* 获取数据类型
|
|
4
|
-
*
|
|
5
|
-
* @param data 待判断的数据
|
|
6
|
-
* @returns 返回数据类型字符串
|
|
7
|
-
*/
|
|
8
|
-
getDataType(data: any): any;
|
|
9
|
-
asArray(obj: any): any[];
|
|
10
|
-
asNumber(a: any): number;
|
|
11
|
-
/**
|
|
12
|
-
* 将值转换为字符串
|
|
13
|
-
*
|
|
14
|
-
* @param value 要转换的值
|
|
15
|
-
* @returns 转换后的字符串,如果值为空,则返回空字符串
|
|
16
|
-
*/
|
|
17
|
-
asString(value: any): string;
|
|
18
|
-
/**
|
|
19
|
-
* 判断传入的值是否为空
|
|
20
|
-
*
|
|
21
|
-
* @param value 待判断的值
|
|
22
|
-
* @returns 返回布尔值,表示是否为空
|
|
23
|
-
*/
|
|
24
|
-
isEmpty(value: any): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* 将JSON对象转换为FormData对象
|
|
27
|
-
*
|
|
28
|
-
* @param json 待转换的JSON对象,其属性值为字符串或Blob类型
|
|
29
|
-
* @returns 转换后的FormData对象
|
|
30
|
-
*/
|
|
31
|
-
json2form(json: Record<string, any>): FormData;
|
|
32
|
-
/**
|
|
33
|
-
* 生成GUID
|
|
34
|
-
*
|
|
35
|
-
* @returns 返回一个由8个16进制数组成的GUID字符串
|
|
36
|
-
*/
|
|
37
|
-
guid(): string;
|
|
38
|
-
/**
|
|
39
|
-
* 将参数进行解码并返回解码后的字符串
|
|
40
|
-
*
|
|
41
|
-
* @param args 参数
|
|
42
|
-
* @returns 解码后的字符串
|
|
43
|
-
*/
|
|
44
|
-
decodeDict(...args: any[]): any;
|
|
45
|
-
/**
|
|
46
|
-
* 异步加载script
|
|
47
|
-
*
|
|
48
|
-
* @param {*} url
|
|
49
|
-
*/
|
|
50
|
-
asyncLoadScript(url: string): Promise<HTMLScriptElement>;
|
|
51
|
-
/**
|
|
52
|
-
* 加载样式文件
|
|
53
|
-
*
|
|
54
|
-
* @param urls 样式文件URL数组
|
|
55
|
-
* @returns 无返回值
|
|
56
|
-
*/
|
|
57
|
-
loadStyle(urls: string[]): void;
|
|
58
|
-
/**
|
|
59
|
-
* 将模板字符串中的占位符替换为给定对象中的值
|
|
60
|
-
*
|
|
61
|
-
* @param str 模板字符串
|
|
62
|
-
* @param data 包含替换值的对象
|
|
63
|
-
* @returns 替换后的字符串
|
|
64
|
-
* @throws 当对象中没有找到与占位符对应的值时,抛出错误
|
|
65
|
-
*/
|
|
66
|
-
template<T>(str: string, data: Record<string, T>): string;
|
|
67
|
-
/**
|
|
68
|
-
* 删除对象中所有值为空的属性
|
|
69
|
-
*
|
|
70
|
-
* @param data 待处理的对象
|
|
71
|
-
* @returns 返回处理后的对象
|
|
72
|
-
*/
|
|
73
|
-
deleteEmptyProperty(data: Record<string | number, any>): {
|
|
74
|
-
[k: string]: any;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* 复制文本到剪贴板
|
|
78
|
-
*
|
|
79
|
-
* @param text 要复制的文本
|
|
80
|
-
* @returns 返回一个Promise,表示复制操作的结果
|
|
81
|
-
*/
|
|
82
|
-
handleCopyValue(text: string): Promise<void>;
|
|
83
|
-
isArray(a: any): a is any[];
|
|
84
|
-
isObject(a: any): boolean;
|
|
85
|
-
isNil(a: any): boolean;
|
|
86
|
-
isNumber(a: any): boolean;
|
|
87
|
-
isInteger(a: any): boolean;
|
|
88
|
-
isFunction(obj: Object): obj is Function;
|
|
89
|
-
/**
|
|
90
|
-
* 判断传入参数是否为DOM元素
|
|
91
|
-
*
|
|
92
|
-
* @param a 待判断的参数
|
|
93
|
-
* @returns 返回布尔值,表示是否为DOM元素
|
|
94
|
-
*/
|
|
95
|
-
isElement(a: any): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* 检查版本
|
|
98
|
-
*
|
|
99
|
-
* @param currentV 当前版本号
|
|
100
|
-
* @param targetV 要求版本号
|
|
101
|
-
* @returns 返回布尔值,表示当前版本是否需要升级到目标版本
|
|
102
|
-
*/
|
|
103
|
-
checheVersion(currentV: string, targetV: string): boolean;
|
|
104
|
-
};
|
|
105
|
-
export default _default;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Coordinate, LngLat } from '../types';
|
|
2
|
-
export default class {
|
|
3
|
-
private static readonly PI;
|
|
4
|
-
private static readonly XPI;
|
|
5
|
-
private static delta;
|
|
6
|
-
/**
|
|
7
|
-
* 判断经纬度是否不在中国境内
|
|
8
|
-
*
|
|
9
|
-
* @param lng 经度
|
|
10
|
-
* @param lat 纬度
|
|
11
|
-
* @returns 如果经纬度不在中国境内则返回true,否则返回false
|
|
12
|
-
*/
|
|
13
|
-
static outOfChina(lng: number, lat: number): boolean;
|
|
14
|
-
static gcjEncrypt(wgsLat: number, wgsLon: number): LngLat;
|
|
15
|
-
static gcjDecrypt(gcjLat: number, gcjLon: number): LngLat;
|
|
16
|
-
static gcjDecryptExact(gcjLat: number, gcjLon: number): LngLat;
|
|
17
|
-
static bdEncrypt(gcjLat: number, gcjLon: number): LngLat;
|
|
18
|
-
static bdDecrypt(bdLat: number, bdLon: number): {
|
|
19
|
-
lat: number;
|
|
20
|
-
lng: number;
|
|
21
|
-
};
|
|
22
|
-
static mercatorEncrypt(wgsLat: number, wgsLon: number): LngLat;
|
|
23
|
-
static mercatorDecrypt(mercatorLat: number, mercatorLon: number): LngLat;
|
|
24
|
-
private static transformLat;
|
|
25
|
-
private static transformLon;
|
|
26
|
-
/**
|
|
27
|
-
* 生成一个介于两个坐标之间的随机坐标
|
|
28
|
-
*
|
|
29
|
-
* @param start 起始坐标,包含x和y属性
|
|
30
|
-
* @param end 结束坐标,包含x和y属性
|
|
31
|
-
* @returns 返回一个包含x和y属性的随机坐标
|
|
32
|
-
*/
|
|
33
|
-
static random({ x: minX, y: minY }: Coordinate, { x: maxX, y: maxY }: Coordinate): Coordinate;
|
|
34
|
-
/**
|
|
35
|
-
* 对坐标数组进行解构并应用函数处理
|
|
36
|
-
*
|
|
37
|
-
* @param arr 待解构的数组
|
|
38
|
-
* @param fn 处理函数
|
|
39
|
-
* @param context 函数执行上下文,可选
|
|
40
|
-
* @returns 处理后的数组
|
|
41
|
-
*/
|
|
42
|
-
static deCompose(arr: any[], fn: (arr: number[]) => number[], context?: any): any[];
|
|
43
|
-
}
|
package/dist/utils/DomUtil.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
/**
|
|
3
|
-
* 获取元素的样式值
|
|
4
|
-
*
|
|
5
|
-
* @param el 元素对象
|
|
6
|
-
* @param style 样式属性名称
|
|
7
|
-
* @returns 元素的样式值,如果获取不到则返回 null
|
|
8
|
-
*/
|
|
9
|
-
getStyle(el: HTMLElement, style: keyof CSSStyleDeclaration): any;
|
|
10
|
-
/**
|
|
11
|
-
* 创建一个HTML元素
|
|
12
|
-
*
|
|
13
|
-
* @param tagName 元素标签名
|
|
14
|
-
* @param className 元素类名
|
|
15
|
-
* @param container 父容器,若传入,则新创建的元素会被添加到该容器中
|
|
16
|
-
* @returns 返回新创建的HTML元素
|
|
17
|
-
*/
|
|
18
|
-
create(tagName: any, className: string, container?: HTMLElement): any;
|
|
19
|
-
/**
|
|
20
|
-
* 从父节点中移除指定元素。
|
|
21
|
-
*
|
|
22
|
-
* @param el 要移除的元素对象,必须包含parentNode属性。
|
|
23
|
-
*/
|
|
24
|
-
remove(el: HTMLElement): void;
|
|
25
|
-
/**
|
|
26
|
-
* 清空给定元素的子节点
|
|
27
|
-
*
|
|
28
|
-
* @param el 要清空子节点的元素,包含firstChild和removeChild属性
|
|
29
|
-
*/
|
|
30
|
-
empty(el: HTMLElement): void;
|
|
31
|
-
/**
|
|
32
|
-
* 将元素移到父节点的最前面
|
|
33
|
-
*
|
|
34
|
-
* @param el 要移动的元素,需要包含 parentNode 属性
|
|
35
|
-
*/
|
|
36
|
-
toFront(el: HTMLElement): void;
|
|
37
|
-
/**
|
|
38
|
-
* 将元素移动到其父节点的最前面
|
|
39
|
-
*
|
|
40
|
-
* @param el 要移动的元素,需要包含parentNode属性
|
|
41
|
-
*/
|
|
42
|
-
toBack(el: HTMLElement): void;
|
|
43
|
-
/**
|
|
44
|
-
* 获取元素的类名
|
|
45
|
-
*
|
|
46
|
-
* @param el 包含对应元素和类名的对象
|
|
47
|
-
* @param el.correspondingElement 对应的元素
|
|
48
|
-
* @param el.className 类名对象
|
|
49
|
-
* @param el.className.baseVal 类名字符串
|
|
50
|
-
* @returns 返回元素的类名字符串
|
|
51
|
-
*/
|
|
52
|
-
getClass(el: HTMLElement): string;
|
|
53
|
-
/**
|
|
54
|
-
* 判断元素是否包含指定类名
|
|
55
|
-
*
|
|
56
|
-
* @param el 元素对象,包含classList属性,classList属性包含contains方法
|
|
57
|
-
* @param name 要判断的类名
|
|
58
|
-
* @returns 返回一个布尔值,表示元素是否包含指定类名
|
|
59
|
-
*/
|
|
60
|
-
hasClass(el: HTMLElement, name: string): boolean;
|
|
61
|
-
/**
|
|
62
|
-
* 给指定的 HTML 元素添加类名
|
|
63
|
-
*
|
|
64
|
-
* @param el 要添加类名的 HTML 元素
|
|
65
|
-
* @param name 要添加的类名,多个类名之间用空格分隔
|
|
66
|
-
*/
|
|
67
|
-
addClass(el: HTMLElement, name: string): void;
|
|
68
|
-
/**
|
|
69
|
-
* 从元素中移除指定类名
|
|
70
|
-
*
|
|
71
|
-
* @param el 要移除类名的元素
|
|
72
|
-
* @param name 要移除的类名,多个类名用空格分隔
|
|
73
|
-
*/
|
|
74
|
-
removeClass(el: HTMLElement, name: string): void;
|
|
75
|
-
/**
|
|
76
|
-
* 设置元素的 CSS 类名
|
|
77
|
-
*
|
|
78
|
-
* @param el HTML 或 SVG 元素
|
|
79
|
-
* @param name 要设置的类名,多个类名之间用空格分隔
|
|
80
|
-
*/
|
|
81
|
-
setClass(el: HTMLElement | SVGElement, name: string): void;
|
|
82
|
-
/**
|
|
83
|
-
* 从字符串中解析XML文档,并返回根节点
|
|
84
|
-
*
|
|
85
|
-
* @param str 要解析的XML字符串
|
|
86
|
-
* @returns 解析后的XML文档的根节点
|
|
87
|
-
*/
|
|
88
|
-
parseFromString(str: string): Element;
|
|
89
|
-
};
|
|
90
|
-
export default _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
getException(type: string, message: string): any;
|
|
3
|
-
throwException(msg: string): never;
|
|
4
|
-
throwColorException(msg: string): never;
|
|
5
|
-
throwCoordinateException(msg: string): never;
|
|
6
|
-
throwGeoJsonException(msg: string): never;
|
|
7
|
-
throwEmptyException(msg: string): never;
|
|
8
|
-
throwIntegerException(msg: string): never;
|
|
9
|
-
throwNumberException(msg: string): never;
|
|
10
|
-
throwArrayException(msg: string): never;
|
|
11
|
-
throwFunctionException(msg: string): never;
|
|
12
|
-
throwProcessException(msg: string): never;
|
|
13
|
-
throwNetworkException(msg: string): never;
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
package/dist/utils/FileUtil.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
/**
|
|
3
|
-
* 将Base64编码的字符串转换为Blob对象
|
|
4
|
-
*
|
|
5
|
-
* @param data Base64编码的字符串
|
|
6
|
-
* @returns 转换后的Blob对象
|
|
7
|
-
*/
|
|
8
|
-
convertBase64ToBlob(data: string): Blob;
|
|
9
|
-
/**
|
|
10
|
-
* 将base64字符串转换为文件对象
|
|
11
|
-
*
|
|
12
|
-
* @param dataurl 包含base64字符串的数据URL
|
|
13
|
-
* @param filename 文件的名称
|
|
14
|
-
* @returns 返回文件对象
|
|
15
|
-
*/
|
|
16
|
-
convertBase64ToFile(dataurl: string, filename: string): File;
|
|
17
|
-
/**
|
|
18
|
-
* 从文件下载数据
|
|
19
|
-
*
|
|
20
|
-
* @param data 要下载的数据,可以是字符串数组、BlobPart 或 MediaSource
|
|
21
|
-
* @param saveName 下载后文件的保存名称
|
|
22
|
-
*/
|
|
23
|
-
downloadFromFile(data: string[] | BlobPart | MediaSource, saveName: string): void;
|
|
24
|
-
readFile(file: File | Blob, resolver?: "arrayBuffer" | "text"): Promise<unknown>;
|
|
25
|
-
/**
|
|
26
|
-
* 获取远程文件并读取
|
|
27
|
-
* @param url 远程文件地址
|
|
28
|
-
* @param fileName 文件名
|
|
29
|
-
* @returns Promise<ArrayBuffer>
|
|
30
|
-
*/
|
|
31
|
-
readFileFromUrl(url: string, fileName: string, resolver?: "arrayBuffer" | "text"): Promise<unknown>;
|
|
32
|
-
};
|
|
33
|
-
export default _default;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Coordinate, GeoJSONFeature, GeometryType } from '../types';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
/**
|
|
4
|
-
* 获取GeoJSON要素的几何类型
|
|
5
|
-
*
|
|
6
|
-
* @param feature GeoJSONFeature 类型的要素
|
|
7
|
-
* @returns 返回要素的几何类型,如果要素没有几何属性则返回 null
|
|
8
|
-
*/
|
|
9
|
-
getGeoJsonType(feature: GeoJSONFeature): GeometryType | null;
|
|
10
|
-
/**
|
|
11
|
-
* 判断给定的GeoJSON要素是否为有效的GeoJSON格式
|
|
12
|
-
*
|
|
13
|
-
* @param feature 要判断的GeoJSON要素
|
|
14
|
-
* @returns 如果为有效的GeoJSON格式则返回true,否则返回false
|
|
15
|
-
*/
|
|
16
|
-
isGeoJson(feature: GeoJSONFeature): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* 判断是否为 GeoJSON 多边形
|
|
19
|
-
*
|
|
20
|
-
* @param feature GeoJSONFeature 对象
|
|
21
|
-
* @returns 返回布尔值,表示是否为 GeoJSON 多边形
|
|
22
|
-
*/
|
|
23
|
-
isGeoJsonPolygon(feature: GeoJSONFeature): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* 判断给定的 GeoJSONFeature 是否为 GeoJSON 线
|
|
26
|
-
*
|
|
27
|
-
* @param feature GeoJSONFeature 对象
|
|
28
|
-
* @returns 是 GeoJSON 线返回 true,否则返回 false
|
|
29
|
-
*/
|
|
30
|
-
isGeoJsonLine(feature: GeoJSONFeature): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 判断是否为 GeoJSON 点类型
|
|
33
|
-
*
|
|
34
|
-
* @param feature GeoJSONFeature 对象
|
|
35
|
-
* @returns 是点类型返回 true,否则返回 false
|
|
36
|
-
*/
|
|
37
|
-
isGeoJsonPoint(feature: GeoJSONFeature): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* 判断传入的 GeoJSONFeature 是否为 Multi 类型的 GeoJSON。
|
|
40
|
-
*
|
|
41
|
-
* @param feature GeoJSONFeature 类型的参数,待判断是否为 Multi 类型的 GeoJSON。
|
|
42
|
-
* @returns 返回一个布尔值,如果传入的 GeoJSONFeature 是 Multi 类型的 GeoJSON,则返回 true,否则返回 false。
|
|
43
|
-
*/
|
|
44
|
-
isGeoJsonMulti(feature: GeoJSONFeature): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* 获取GeoJSON要素的坐标数组
|
|
47
|
-
*
|
|
48
|
-
* @param feature GeoJSONFeature对象
|
|
49
|
-
* @returns 返回一个包含坐标数组的数组,可以是二维、三维或四维数组
|
|
50
|
-
*/
|
|
51
|
-
getGeoJsonCoordinates(feature: GeoJSONFeature): Array<number> | Array<Array<number>> | Array<Array<Array<number>>> | Array<Array<Array<Array<number>>>>;
|
|
52
|
-
/**
|
|
53
|
-
* 获取GeoJSON要素的中心点坐标
|
|
54
|
-
*
|
|
55
|
-
* @param feature GeoJSON要素
|
|
56
|
-
* @param out 输出坐标对象,默认为null
|
|
57
|
-
* @returns 返回中心点坐标,如果无法获取则返回null
|
|
58
|
-
*/
|
|
59
|
-
getGeoJsonCenter(feature: GeoJSONFeature, out?: Coordinate): Coordinate | null;
|
|
60
|
-
/**
|
|
61
|
-
* 将一个包含多个点、线或面的 GeoJSON 特征对象拆分成多个独立的 GeoJSON 特征对象数组。
|
|
62
|
-
*
|
|
63
|
-
* @param feature 包含多个点、线或面的 GeoJSON 特征对象
|
|
64
|
-
* @returns 返回一个 GeoJSON 特征对象数组,如果拆分失败则返回 null
|
|
65
|
-
*/
|
|
66
|
-
spliteGeoJsonMulti(feature: GeoJSONFeature): GeoJSONFeature[] | null;
|
|
67
|
-
/**
|
|
68
|
-
* 根据坐标数组生成GeoJSON要素
|
|
69
|
-
*
|
|
70
|
-
* @param coordinates 坐标数组
|
|
71
|
-
* @returns GeoJSONFeature 生成的GeoJSON要素
|
|
72
|
-
* @throws Error 如果coordinates参数格式错误
|
|
73
|
-
*/
|
|
74
|
-
getGeoJsonByCoordinates(coordinates: Array<number> | Array<Array<number>> | Array<Array<Array<number>>> | Array<Array<Array<Array<number>>>>, properties?: Record<string, any>): GeoJSONFeature;
|
|
75
|
-
};
|
|
76
|
-
export default _default;
|