mirage2d 1.2.1 → 1.2.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.
Files changed (73) hide show
  1. package/dist/Enum/typeEnum.d.ts +63 -56
  2. package/dist/Layer/XMap.d.ts +146 -108
  3. package/dist/Layer/graphicLayer/ArcGisFeatureServiceLayer.d.ts +19 -2
  4. package/dist/Layer/graphicLayer/ClusterImageLayer.d.ts +9 -0
  5. package/dist/Layer/graphicLayer/ClusterLayer.d.ts +7 -0
  6. package/dist/Layer/graphicLayer/DayNightLayer.d.ts +7 -0
  7. package/dist/Layer/graphicLayer/DivLayer.d.ts +7 -0
  8. package/dist/Layer/graphicLayer/GraphicImageLayer.d.ts +7 -0
  9. package/dist/Layer/graphicLayer/GraphicLayer.d.ts +2 -2
  10. package/dist/Layer/graphicLayer/HeatmapLayer.d.ts +7 -0
  11. package/dist/Layer/graphicLayer/ImageCanvasLayer.d.ts +1 -1
  12. package/dist/Layer/graphicLayer/KmlLayer.d.ts +7 -0
  13. package/dist/Layer/graphicLayer/PathLayer.d.ts +44 -41
  14. package/dist/Layer/graphicLayer/WfsLayer.d.ts +61 -5
  15. package/dist/Layer/index.d.ts +10 -0
  16. package/dist/Layer/tileLayer/ArcGisMapServerLayer.d.ts +2 -1
  17. package/dist/Layer/tileLayer/ArcGisTileXyzLayer.d.ts +3 -3
  18. package/dist/Layer/tileLayer/GeoImageLayer.d.ts +17 -9
  19. package/dist/Layer/tileLayer/PbfLayer.d.ts +1 -1
  20. package/dist/Layer/tileLayer/TifLayer.d.ts +7 -0
  21. package/dist/Layer/tileLayer/TileBaiDuLayer.d.ts +3 -3
  22. package/dist/Layer/tileLayer/TileGroupLayer.d.ts +13 -2
  23. package/dist/Layer/tileLayer/TileTencentLayer.d.ts +10 -3
  24. package/dist/Layer/tileLayer/TileXyzLayer.d.ts +11 -4
  25. package/dist/Layer/tileLayer/WmsLayer.d.ts +8 -0
  26. package/dist/Layer/tileLayer/WmtsLayer.d.ts +8 -0
  27. package/dist/Layer/tileLayer/imageLayer.d.ts +7 -0
  28. package/dist/MirageHttp.es.js.map +205 -1
  29. package/dist/MirageHttp.umd.js.map +1263 -1
  30. package/dist/Tools/SpatialAnalysis.d.ts +237 -216
  31. package/dist/Tools/defaultStyle.d.ts +7 -0
  32. package/dist/Tools/measure.d.ts +7 -0
  33. package/dist/Tools/secret.d.ts +12 -6
  34. package/dist/Tools/toolbox.d.ts +2 -3
  35. package/dist/Tools/util/format.d.ts +21 -1
  36. package/dist/Tools/util/index.d.ts +10 -0
  37. package/dist/Tools/util/isutil.d.ts +27 -17
  38. package/dist/Tools/util/tools.d.ts +10 -0
  39. package/dist/base/EventType.d.ts +7 -0
  40. package/dist/base/FeatureEventType.d.ts +7 -0
  41. package/dist/base/LayerEventType.d.ts +7 -0
  42. package/dist/base/MapEventType.d.ts +8 -0
  43. package/dist/base/base.d.ts +30 -3
  44. package/dist/base/baseClass.d.ts +22 -5
  45. package/dist/base/baseGraphicLayer.d.ts +225 -45
  46. package/dist/base/baseLayer.d.ts +7 -0
  47. package/dist/base/baseMap.d.ts +7 -0
  48. package/dist/base/baseOptionType.d.ts +40 -8
  49. package/dist/base/baseTileLayer.d.ts +10 -0
  50. package/dist/base/eventTarget.d.ts +10 -0
  51. package/dist/extend/Control/baseLayerSwitch.d.ts +15 -1
  52. package/dist/extend/Control/drawText.d.ts +11 -1
  53. package/dist/extend/Control/imageHJ.d.ts +10 -3
  54. package/dist/extend/Control/index.d.ts +14 -4
  55. package/dist/extend/Control/locationbar.d.ts +10 -3
  56. package/dist/extend/Control/swipe.d.ts +16 -5
  57. package/dist/extend/interaction/SelectTransform.d.ts +4 -5
  58. package/dist/extend/tykg.d.ts +5 -5
  59. package/dist/graphic/Curve.d.ts +10 -0
  60. package/dist/graphic/DivGraphic.d.ts +13 -4
  61. package/dist/graphic/baseGraphic.d.ts +63 -60
  62. package/dist/graphic/index.d.ts +10 -0
  63. package/dist/index.d.ts +7 -0
  64. package/dist/lib/includeLibs.js +23 -24
  65. package/dist/mirage2d.cjs.js +37 -37
  66. package/dist/mirage2d.umd.js +37 -37
  67. package/dist/proj4/proj.d.ts +22 -10
  68. package/dist/query/GaodePOI.d.ts +10 -0
  69. package/dist/query/GaodeRoute.d.ts +17 -0
  70. package/dist/query/baseGaode.d.ts +7 -0
  71. package/dist/query/index.d.ts +10 -0
  72. package/package.json +28 -7
  73. package/readme.md +12 -12
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2021-12-27 21:07:38
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2022-10-10 20:26:33
6
+ * @Description: 功能
7
+ */
1
8
  import { Style } from "ol/style";
2
9
  import { Vector as VectorLayer } from "ol/layer";
3
10
  import { baseClass } from "../base/baseClass";
@@ -1,5 +1,11 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2021-12-18 10:21:19
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2023-05-25 15:34:16
6
+ * @Description: 数据加密解密
7
+ */
1
8
  export declare class Secret {
2
- constructor();
3
9
  getMessage(): void;
4
10
  scanApk(apkinfo: string, ver: string): boolean;
5
11
  getVersionsInfo(ver: string): {
@@ -17,15 +23,15 @@ export declare class Secret {
17
23
  Copyright: string;
18
24
  };
19
25
  /**
20
- * @description:加密
21
- * @param {*}
22
- * @return {*}
26
+ * :加密
27
+ * @param {string} word
28
+ * @returns {*}
23
29
  */
24
30
  private Encrypt1;
25
31
  /**
26
- * @description: 解密
32
+ * 解密
27
33
  * @param {string} word
28
- * @return {*}
34
+ * @returns {*}
29
35
  */
30
36
  private Decrypt1;
31
37
  }
@@ -1,12 +1,11 @@
1
1
  import Feature from "ol/Feature";
2
2
  import { Geometry } from "ol/geom";
3
3
  export declare class toolbox {
4
- constructor();
5
4
  static uuid15(): any;
6
5
  /**
7
- * @description: 检查是否css颜色
6
+ * : 检查是否css颜色
8
7
  * @param {*} bgVal
9
- * @return {*}
8
+ * @returns {*}
10
9
  */
11
10
  static CheckIsColor(bgVal: any): any;
12
11
  static getDefaultImageFillStyle(): any[];
@@ -1,3 +1,23 @@
1
+ /**
2
+ * @author: xd
3
+ * @date: Do not edit
4
+ * @lastEditors: xd
5
+ * @lastEditTime: Do not edit
6
+ * @filePath: Do not edit
7
+ * @description:
8
+ *
9
+ * Copyright (c) 2023 by xd, All Rights Reserved.
10
+ */
11
+ /**
12
+ * @author: xd
13
+ * @Date: 2022-10-11 12:01:34
14
+ * @LastEditors: xd
15
+ * @LastEditTime: 2022-10-22 13:40:00
16
+ * @FilePath: \Map2D\src\Tools\util\format.ts
17
+ * @Description:
18
+ *
19
+ * Copyright (c) 2022 by xd, All Rights Reserved.
20
+ */
1
21
  export declare function ToDegree(degree?: number, minute?: number, second?: number, len?: number): string;
2
22
  export declare function ToDegreeMinuteSecond(val: number | string): {
3
23
  degree: number;
@@ -7,7 +27,7 @@ export declare function ToDegreeMinuteSecond(val: number | string): {
7
27
  export declare function formatDistance(m: any): string;
8
28
  export declare function SecondToHHMMSS(value: any): string;
9
29
  /**
10
- * @function 参数拼接
30
+ * 参数拼接
11
31
  * @param {object} obj 只支持非嵌套的对象
12
32
  * @returns {string}
13
33
  * @author xd 2020-1-15
@@ -1,3 +1,13 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-09-05 09:47:34
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2022-10-13 11:48:40
6
+ * @FilePath: \Map2D\src\Tools\util\index.ts
7
+ * @Description:
8
+ *
9
+ * Copyright (c) 2022 by xd, All Rights Reserved.
10
+ */
1
11
  export { UIsUtil as isutil } from "./isutil";
2
12
  export { UJson as json } from "./json";
3
13
  export * as format from "./format";
@@ -1,24 +1,34 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-09-05 09:35:41
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2022-09-05 09:44:13
6
+ * @FilePath: \Map2D\src\Tools\util\isutil.ts
7
+ * @Description:
8
+ *
9
+ * Copyright (c) 2022 by xd, All Rights Reserved.
10
+ */
1
11
  export declare class UIsUtil {
2
12
  static BUILTIN_OBJECT: {
3
- '[object Function]': boolean;
4
- '[object RegExp]': boolean;
5
- '[object Date]': boolean;
6
- '[object Error]': boolean;
7
- '[object CanvasGradient]': boolean;
8
- '[object CanvasPattern]': boolean;
9
- '[object Image]': boolean;
10
- '[object Canvas]': boolean;
13
+ "[object Function]": boolean;
14
+ "[object RegExp]": boolean;
15
+ "[object Date]": boolean;
16
+ "[object Error]": boolean;
17
+ "[object CanvasGradient]": boolean;
18
+ "[object CanvasPattern]": boolean;
19
+ "[object Image]": boolean;
20
+ "[object Canvas]": boolean;
11
21
  };
12
22
  static TYPED_ARRAY: {
13
- '[object Int8Array]': boolean;
14
- '[object Uint8Array]': boolean;
15
- '[object Uint8ClampedArray]': boolean;
16
- '[object Int16Array]': boolean;
17
- '[object Uint16Array]': boolean;
18
- '[object Int32Array]': boolean;
19
- '[object Uint32Array]': boolean;
20
- '[object Float32Array]': boolean;
21
- '[object Float64Array]': boolean;
23
+ "[object Int8Array]": boolean;
24
+ "[object Uint8Array]": boolean;
25
+ "[object Uint8ClampedArray]": boolean;
26
+ "[object Int16Array]": boolean;
27
+ "[object Uint16Array]": boolean;
28
+ "[object Int32Array]": boolean;
29
+ "[object Uint32Array]": boolean;
30
+ "[object Float32Array]": boolean;
31
+ "[object Float64Array]": boolean;
22
32
  };
23
33
  static primitiveKey: string;
24
34
  static objToString: () => string;
@@ -1 +1,11 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-10-13 11:38:43
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2022-10-13 13:16:01
6
+ * @FilePath: \Map2D\src\Tools\util\tools.ts
7
+ * @Description:
8
+ *
9
+ * Copyright (c) 2022 by xd, All Rights Reserved.
10
+ */
1
11
  export declare function fetchJson(url: string): Promise<any>;
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-01-13 20:39:42
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2022-10-10 20:11:57
6
+ * @Description: 功能
7
+ */
1
8
  export { featureType } from "./FeatureEventType";
2
9
  export { XMapEventType } from "./MapEventType";
3
10
  export { LayerEventType } from "./LayerEventType";
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-01-13 20:47:01
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2023-01-31 11:43:24
6
+ * @Description: 功能
7
+ */
1
8
  export declare enum featureType {
2
9
  onLoadStart = "onLoadStart",
3
10
  onLoadError = "onLoadError",
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-01-25 13:02:32
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2023-04-27 19:41:43
6
+ * @Description: 功能
7
+ */
1
8
  export declare enum LayerEventType {
2
9
  tileloadstart = "tileloadstart",
3
10
  tileloadend = "tileloadend",
@@ -1,9 +1,17 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-01-25 13:02:32
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2022-08-03 15:54:51
6
+ * @Description: 功能
7
+ */
1
8
  export declare enum XMapEventType {
2
9
  onMapContextmenu = "MapContextmenu",
3
10
  onClick = "click",
4
11
  onMapMove = "onMapMove",
5
12
  onMapMoveEnd = "onMapMoveEnd",
6
13
  onZoomChange = "onZoomChange",
14
+ onCenterChange = "onCenterChange",
7
15
  onRemoveLayer = "onRemoveLayer",
8
16
  onChangeBaseLayer = "onChangeBaseLayer"
9
17
  }
@@ -1,8 +1,32 @@
1
1
  import { baseClass } from "./baseClass";
2
+ /**
3
+ * 基础baseClass
4
+ * @extends baseClass
5
+ */
2
6
  export declare class base extends baseClass {
7
+ /**
8
+ * 实例化
9
+ */
3
10
  constructor();
4
- getJSON(url: string | URL): any;
11
+ /**
12
+ * 获取json.
13
+ * @param {string} urlstr - 输入的网址.
14
+ * @returns {any} 返回json格式数据.
15
+ */
16
+ getJSON(urlstr: string): any;
17
+ /**
18
+ * 获取文件
19
+ * @param {string | URL} url - 输入的网址.
20
+ * @param {string} contenttype - 文件类型.
21
+ * @returns {any} 返回json格式数据.
22
+ */
5
23
  getFile(url: string | URL, contenttype: string): any;
24
+ /**
25
+ * 转换坐标到3857坐标
26
+ * @param {string} wkid - 输入的网址.
27
+ * @param {number[]} Coordinates - 文件类型.
28
+ * @returns {any} 返回json格式数据.
29
+ */
6
30
  ConvertCoordinatesTo3857(wkid: string, Coordinates: number[]): number[];
7
31
  ConvertCoordinatesTo4326(wkid: string, Coordinates: any): any;
8
32
  formatJsonTo3857(GeoJson: any): any;
@@ -11,7 +35,10 @@ export declare class base extends baseClass {
11
35
  }>;
12
36
  formatJsonToPoint(GeoJson: any): any;
13
37
  /**
14
- *将十六进制的颜色值转为RGB格式
15
- */
38
+ * 将十六进制的颜色值转为RGB格式
39
+ * @param {string} sHex - 十六进制的颜色值.
40
+ * @param {string} alpha -透明度.
41
+ * @returns {string} rgba(r,g,b,a).
42
+ */
16
43
  colorRgba(sHex: string, alpha: string): string;
17
44
  }
@@ -1,16 +1,33 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-10-10 20:02:02
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2023-06-06 14:42:45
6
+ * @FilePath: \Map2D\src\base\baseClass.ts
7
+ * @Description:
8
+ *
9
+ * Copyright (c) 2023 by xd, All Rights Reserved.
10
+ */
11
+ /**
12
+ * 基类.
13
+ * @class
14
+ */
1
15
  export declare class baseClass {
16
+ /** 容器 */
2
17
  handlers: {};
18
+ /**
19
+ * Creates baseClass instance.
20
+ */
3
21
  constructor();
4
22
  _on(type: string | number, fn: any): this;
5
23
  off(type: string | number, fn: any): this;
6
24
  /**
7
25
  * 绑定一个只执行一次的事件
8
- *
9
- * @param {String} type 事件类型
26
+ * @param {string} type 事件类型
10
27
  * @param {Function} fn 事件处理函数
11
- * @param {Object} scope 要为事件处理函数绑定的执行上下文
12
- * @returns 当前实例对象
28
+ * @param {object} scope 要为事件处理函数绑定的执行上下文
29
+ * @returns {any} 当前实例对象
13
30
  */
14
- onec(type: string | number, fn: Function, scope: any): this;
31
+ onec(type: string | number, fn: Function, scope: any): any;
15
32
  trigger(eName: string | number | symbol, params: any): void;
16
33
  }
@@ -1,3 +1,13 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-07-21 17:38:04
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2023-06-02 12:57:54
6
+ * @FilePath: \Map2D\src\base\baseGraphicLayer.ts
7
+ * @Description:
8
+ *
9
+ * Copyright (c) 2022 by xd, All Rights Reserved.
10
+ */
1
11
  import { baseLayer } from "./baseLayer";
2
12
  import VectorSource from "ol/source/Vector";
3
13
  import { IFeatureAttribute, IGraphicLayerOption, IlevelColor, ITooltipInfo } from "./baseOptionType";
@@ -24,8 +34,28 @@ export declare class baseGraphicLayer extends baseLayer {
24
34
  unbindContextmenu(): void;
25
35
  appendContextmenu(menu: any): void;
26
36
  protected _setFeatureContextmenu(feature: any, contextmenu: any): void;
27
- showTitle(dataType: string, isShow: boolean): void;
28
- showTitleByClassname(classname: string, isShow: boolean): void;
37
+ /**
38
+ * : 显示tile
39
+ * @param {string} dataType dataType字段属性
40
+ * @param {boolean} isShow 显示/关闭
41
+ * @param {string} showFieldName name 显示字段名 默认name
42
+ */
43
+ showTitle(dataType: string, isShow: boolean, showFieldName?: string): void;
44
+ /**
45
+ * : 显示tile
46
+ * @param {string} classname classname字段属性
47
+ * @param {boolean} isShow 显示/关闭
48
+ * @param {string} showFieldName name 显示字段名 默认name
49
+ */
50
+ showTitleByClassname(classname: string, isShow: boolean, showFieldName?: string): void;
51
+ /**
52
+ * : 显示tile
53
+ * @param {string} fieldname 字段名
54
+ * @param {string} fieldval 字段值
55
+ * @param {boolean} isShow 显示/关闭
56
+ * @param {string} showFieldName name 显示字段名 默认name
57
+ */
58
+ showTitleByField(fieldname: string, fieldval: string, isShow: boolean, showFieldName?: string): void;
29
59
  _bindPoupEvent(): void;
30
60
  bindPopup(popupInfo?: Array<ITooltipInfo> | string, option?: {
31
61
  offset: number[];
@@ -44,60 +74,73 @@ export declare class baseGraphicLayer extends baseLayer {
44
74
  protected _showTooltip2(feature: Feature<Geometry>, data: string, option: IGraphicLayerOption["tooltipOption"]): void;
45
75
  closeTooltip(): void;
46
76
  /**
47
- * @description: 添加GeoJSON数据,需要数据库样式匹配
77
+ * : 添加GeoJSON数据,需要数据库样式匹配
48
78
  * @param {string} classname 图层编号
49
79
  * @param {any} GeoJson 标准GeoJson格式
50
80
  */
51
81
  addGeoJson(classname: string, GeoJson: any): void;
82
+ /**
83
+ * : 添加GeoJSON数据,多边形将转为点格式
84
+ * @param {string} classname 图层编号
85
+ * @param {any} GeoJson 标准GeoJson格式
86
+ */
52
87
  addGeoJsonPoint(classname: string, GeoJson: any): void;
88
+ /**
89
+ * 转换geojson到Features
90
+ * @param {any} GeoJson 标准GeoJson格式
91
+ * @returns {any}
92
+ */
53
93
  convertGeoJsontoFeatures(GeoJson: any): any;
54
94
  /**
55
- * @description:设置要素属性
56
- * @param {string} classname 分类名
57
- * @param {Array<Feature<Geometry>>} featuresList 要素数组
58
- * @param {Array<IFeatureAttribute>} attribute 要素属性数组
59
- */
95
+ * :设置要素属性
96
+ * @param {string} classname 分类名
97
+ * @param {Array<Feature<Geometry>>} featuresList 要素数组
98
+ * @param {Array<IFeatureAttribute>} attribute 要素属性数组
99
+ * @param {Function} callback 回调函数
100
+ */
60
101
  addFeatures(classname: string, featuresList: Array<Feature<Geometry>>, attribute?: IFeatureAttribute | any, callback?: Function): void;
61
- _getFeatureAttribute(classname?: string): IFeatureAttribute;
102
+ private _getFeatureAttribute;
62
103
  /**
63
- * @description:设置要素属性
64
- * @param {string} classname 分类名
65
- * @param {Feature<Geometry>} feature 要素
66
- * @param {Array<IFeatureAttribute>} attribute 要素属性数组
67
- */
104
+ * 设置要素属性
105
+ * @param {string} classname 分类名
106
+ * @param {Feature<Geometry>} feature 要素
107
+ * @param {Array<IFeatureAttribute>} attribute 要素属性数组
108
+ * @param {Function} callback 回调函数
109
+ */
68
110
  addFeature(classname: string, feature: Feature<Geometry>, attribute?: IFeatureAttribute | any, callback?: Function): void;
69
111
  /**
70
- * @description:设置要素属性
71
- * @param {IFeatureAttribute} 要素属性数组
72
- */
112
+ * 设置要素属性
113
+ * @param {IFeatureAttribute| any} attribute 要素属性数组
114
+ */
73
115
  setFeaturesAttribute(attribute: IFeatureAttribute | any): void;
74
116
  /**
75
- * @description:设置要素属性
76
- * @param {IFeatureAttribute} 要素属性数组
77
- */
117
+ * :设置要素属性
118
+ * @param {string}classname
119
+ * @param {IFeatureAttribute| any} attribute 要素属性数组
120
+ */
78
121
  setFeaturesAttributeByClassName(classname: string, attribute: IFeatureAttribute | any): void;
79
122
  /**
80
- * @description:设置要素属性
123
+ * :设置要素属性
81
124
  * @param {string} uuid 要素uuid
82
- * @param {Array<IFeatureAttribute>} 要素属性数组
125
+ * @param {Array<IFeatureAttribute>} attribute 要素属性数组
83
126
  */
84
127
  setFeatureAttribute(uuid: string, attribute: IFeatureAttribute | any): void;
85
128
  /**
86
- * @description:返回图层所有要素
87
- * @return {*} 返回要素数组
88
- */
129
+ * 返回图层所有要素
130
+ * @returns {Feature<Geometry>[]} 返回要素数组
131
+ */
89
132
  getFeaturesAll(): Feature<Geometry>[];
90
133
  /**
91
- * @description:按字段名、属性查询
92
- * @param {*} fieldName 字段名
93
- * @param {*} fieldVal 字段值
94
- * @return {*} 返回要素数组
95
- */
134
+ * 按字段名、属性查询
135
+ * @param {*} fieldName 字段名
136
+ * @param {*} fieldVal 字段值
137
+ * @returns {*} 返回要素数组
138
+ */
96
139
  getFeaturesByFieldName(fieldName: any, fieldVal: any): any;
97
140
  /**
98
- * @description:按classname查询
141
+ * classname查询
99
142
  * @param {*} classname 分类名
100
- * @return {*} 返回要素数组
143
+ * @returns {*} 返回要素数组
101
144
  */
102
145
  getFeaturesByClassName(classname: any): any;
103
146
  getFeatures(name: any): any;
@@ -108,42 +151,179 @@ export declare class baseGraphicLayer extends baseLayer {
108
151
  * @param {string} classname
109
152
  */
110
153
  removeFeature(uuid: string | Feature<Geometry>): void;
111
- /**删除GeoJSON数据
112
- * @description:
154
+ /**
155
+ * 删除GeoJSON数据
113
156
  * @param {string} classname
114
157
  */
115
- removeFeatures(classname: any): void;
158
+ removeFeatures(classname: string): void;
116
159
  /**删除GeoJSON数据
117
160
  * @description:
118
161
  * @param {any} json
119
162
  */
120
163
  removeFeaturesByJson(json: any): void;
164
+ /**
165
+ * 替换{}字段
166
+ * @param {string} str
167
+ * @returns {string}
168
+ */
169
+ private replaceField;
170
+ /**
171
+ * 设置所有要素样式
172
+ * @description:
173
+ * @param {any} styleOptions
174
+ * @param {Function} callback 回调函数,可选 回调会返回每个feature的getProperties()属性,根据属性使用回调函数设置每个要素的styleOptions样式
175
+ * @example styleOptions 内容
176
+ * {
177
+ Font: "12px Microsoft YaHei",
178
+ FontColor: "#8B4513",
179
+ FontStrokeColor: "#fff",
180
+ FontStrokeWidth: 2,
181
+ FontoffsetX: 0,
182
+ FontoffsetY: -10,
183
+ fillcolor: "rgba(0, 153, 255,1)",
184
+ strokecolor: "rgba(255, 255, 255,1)", // 通过要素拿到具体的值
185
+ strokewidth: 1,
186
+ radius: 10,
187
+ scale: 1,
188
+ text: "标注示例" //可以用{字段名}格式化显示字段
189
+ }
190
+ */
121
191
  setSymbol(styleOptions: any, callback?: Function): void;
192
+ /**
193
+ * 设置要素分级颜色样式,按字段名及字段值匹配设置
194
+ * @param {object} levelOption json参数
195
+ * @param {string} levelOption.classname 参与分级的要素分组 classname
196
+ * @param {string} levelOption.attributeName 参与分级的要素字段名
197
+ * @param {boolean} levelOption.autolevel 是否自动分级,自动分级时默认5级颜色
198
+ * @param {Array<IlevelColor>} levelOption.levelColor 分级设置
199
+ * @returns { IlevelColor[]}
200
+ * @example
201
+ * levelColor:[
202
+ {
203
+ maxnum: 0, // 分级最大值
204
+ fillcolor: "rgba(255,255,255,0.1)",
205
+ strokecolor: "rgba(255, 255, 255,1)",
206
+ strokewidth: 1
207
+ },
208
+ {
209
+ maxnum: 1, // 分级最大值
210
+ fillcolor: "rgba(255,255,255,0.1)",
211
+ strokecolor: "rgba(255, 255, 255,1)",
212
+ strokewidth: 1
213
+ }
214
+ ]
215
+ */
122
216
  setSymbolLevelColor(levelOption: {
123
217
  classname: string;
124
218
  attributeName: string;
125
219
  autolevel?: boolean;
126
220
  levelColor?: Array<IlevelColor>;
127
221
  }): IlevelColor[];
222
+ /**
223
+ * 根据classname字段设置所有要素样式,按字段名及字段值匹配设置
224
+ * @param {string} classname
225
+ * @param {any[]} styleOptions
226
+ * @param {Function} callback 回调函数,可选 回调会返回每个feature的getProperties()属性,根据属性使用回调函数设置每个要素的styleOptions样式
227
+ * @example styleOptions 是一个json结构
228
+ * {
229
+ Font: "12px Microsoft YaHei",
230
+ FontColor: "#8B4513",
231
+ FontStrokeColor: "#fff",
232
+ FontStrokeWidth: 2,
233
+ FontoffsetX: 0,
234
+ FontoffsetY: -10,
235
+ fillcolor: "rgba(0,0,0,0.5)",
236
+ strokecolor: "rgba(255,255,0,1)",
237
+ strokewidth: 1,
238
+ scale: 1,
239
+ radius: 10,
240
+ text: ""//可以用{字段名}格式化显示字段
241
+ }
242
+ */
128
243
  setSymbolByClassname(classname: any, styleOptions: any, callback?: Function): void;
244
+ /**
245
+ * 根据features设置所有要素样式,按字段名及字段值匹配设置
246
+ * @param {any[]} features
247
+ * @param {any[]} styleOptions
248
+ * @param {Function} callback 回调函数,可选 回调会返回每个feature的getProperties()属性,根据属性使用回调函数设置每个要素的styleOptions样式
249
+ * @example styleOptions 是一个json结构
250
+ * {
251
+ Font: "12px Microsoft YaHei",
252
+ FontColor: "#8B4513",
253
+ FontStrokeColor: "#fff",
254
+ FontStrokeWidth: 2,
255
+ FontoffsetX: 0,
256
+ FontoffsetY: -10,
257
+ fillcolor: "rgba(0,0,0,0.5)",
258
+ strokecolor: "rgba(255,255,0,1)",
259
+ strokewidth: 1,
260
+ scale: 1,
261
+ radius: 10,
262
+ text: ""//可以用{字段名}格式化显示字段
263
+ }
264
+ */
129
265
  setSymbolByFeatures(features: any, styleOptions: any, callback?: Function): void;
266
+ /**
267
+ * 设置所有要素样式,按字段名及字段值匹配设置
268
+ * @description:
269
+ * @param {any[]} styleClassOptions
270
+ * @example styleClassOptions 是一个数组结构
271
+ * [{
272
+ className: "字段名",
273
+ classValue: "字段值",
274
+ style: {
275
+ Font: "12px Microsoft YaHei",
276
+ FontColor: "#8B4513",
277
+ FontStrokeColor: "#fff",
278
+ FontStrokeWidth: 2,
279
+ FontoffsetX: 0,
280
+ FontoffsetY: -10,
281
+ fillcolor: "rgba(0,0,0,0.5)",
282
+ strokecolor: "rgba(255,255,0,1)",
283
+ strokewidth: 1,
284
+ scale: 1,
285
+ radius: 10,
286
+ text: ""//可以用{字段名}格式化显示字段
287
+ }
288
+ }]
289
+ */
130
290
  setSymbolByStyleClass(styleClassOptions: any): void;
131
- setClassSymbol(classname: any, styleClassOptions: any): void;
132
- /**设置标签启用
291
+ /**
292
+ * 设置所有要素样式,根据classname字段设置
133
293
  * @description:
134
294
  * @param {string} classname
295
+ * @param {any[]} styleClassOptions
296
+ * @example styleClassOptions 是一个数组结构
297
+ * [{ style 内是可选参数,根据需要设置
298
+ className: "字段名",
299
+ classValue: "字段值",
300
+ style: {
301
+ Font: "12px Microsoft YaHei",
302
+ FontColor: "#8B4513",
303
+ FontStrokeColor: "#fff",
304
+ FontStrokeWidth: 2,
305
+ FontoffsetX: 0,
306
+ FontoffsetY: -10,
307
+ fillcolor: "rgba(255, 221, 0, 1)",
308
+ strokecolor: "rgba(255, 255, 255,1)", //通过要素拿到具体的值
309
+ strokewidth: 1,
310
+ radius: 3,
311
+ scale: 1,
312
+ text: ""//可以用{字段名}格式化显示字段
313
+ },
314
+ }]
315
+ */
316
+ setClassSymbol(classname: any, styleClassOptions: any): void;
317
+ /**设置标签启用
318
+ * @description: 按dataType字段配置属性
319
+ * @param {string} dataTypeVal 属性中必须包含dataType字段
135
320
  * @param {boolean} isShow
136
321
  */
137
- setFeaturesTileByJson(classname: any, isShow: any): void;
322
+ setFeaturesTileByJson(dataTypeVal: any, isShow: any): void;
138
323
  clear(): void;
139
324
  /**
140
- * @description: 绘制图形
141
- * @param {drawtype} graphictype 图形类型,由drawtype指定
142
- * @param {object} graphicAttribute 属性结合
143
- * @param {string} [graphicAttribute.name=""] graphicAttribute.name,默认""
144
- * @param {string} [graphicAttribute.dataType="未定义"] graphicAttribute.dataType
145
- * @param {Function} [graphicAttribute.success=undefined] graphicAttribute.dataType
146
- * @api
325
+ * 绘制图形
326
+ * @param {object} option 属性结合
147
327
  */
148
328
  startDraw(option: any): void;
149
329
  changeGraphicData(option: any, drawFeature: any): void;
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-01-25 12:44:03
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2023-05-08 17:33:27
6
+ * @Description: 功能
7
+ */
1
8
  import { base } from "./base";
2
9
  import * as EventType from "./EventType";
3
10
  import { Map } from "ol";
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @author: xd
3
+ * @Date: 2022-01-25 12:44:03
4
+ * @LastEditors: xd
5
+ * @LastEditTime: 2023-05-09 12:47:10
6
+ * @Description: 功能
7
+ */
1
8
  import { base } from "./base";
2
9
  import * as EventType from "./EventType";
3
10
  import { Map } from "ol";