my-openlayer 0.1.18 → 1.0.1

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/types.d.ts CHANGED
@@ -49,48 +49,234 @@ export interface AnnotationLayerOptions {
49
49
  visible?: boolean;
50
50
  }
51
51
  export interface HeatMapOptions {
52
+ layerName?: string;
52
53
  radius?: number;
53
54
  blur?: number;
54
55
  gradient?: string[];
55
56
  opacity?: number;
56
57
  visible?: boolean;
57
58
  zIndex?: number;
58
- valueKey: string;
59
+ valueKey?: string;
59
60
  }
60
- export interface OptionsType {
61
+ /**
62
+ * 基础选项接口 - 所有图层的公共配置
63
+ */
64
+ export interface BaseOptions {
65
+ /** 图层名称 */
61
66
  layerName?: string;
62
- nameKey?: string;
63
- img?: string;
64
- scale?: number;
65
- hasImg?: boolean;
67
+ /** 图层层级 */
66
68
  zIndex?: number;
69
+ /** 图层可见性 */
67
70
  visible?: boolean;
71
+ /** 图层透明度 */
72
+ opacity?: number;
73
+ /** 是否适应视图 */
74
+ fitView?: boolean;
75
+ /** 地图裁剪 */
76
+ mapClip?: boolean;
77
+ /** 地图裁剪数据 */
78
+ mapClipData?: MapJSONData;
79
+ /** 投影选项 */
68
80
  projectionOptOptions?: any;
81
+ /** 扩展属性 */
82
+ [propName: string]: any;
83
+ }
84
+ /**
85
+ * 样式选项接口 - 图形样式相关配置
86
+ */
87
+ export interface StyleOptions {
88
+ /** 描边颜色 */
69
89
  strokeColor?: string | number[];
90
+ /** 描边宽度 */
70
91
  strokeWidth?: number;
92
+ /** 线条虚线样式 */
71
93
  lineDash?: number[];
94
+ /** 线条虚线偏移 */
72
95
  lineDashOffset?: number;
96
+ /** 填充颜色 */
73
97
  fillColor?: string;
98
+ /** 填充颜色回调函数 */
74
99
  fillColorCallBack?: (feature: any) => string;
100
+ }
101
+ /**
102
+ * 文本选项接口 - 文本标注相关配置
103
+ */
104
+ export interface TextOptions {
105
+ /** 文本可见性 */
75
106
  textVisible?: boolean;
107
+ /** 文本内容回调函数 */
76
108
  textCallBack?: (feature: any) => string;
109
+ /** 文本字体 */
77
110
  textFont?: string;
111
+ /** 文本填充颜色 */
78
112
  textFillColor?: string;
113
+ /** 文本描边颜色 */
79
114
  textStrokeColor?: string;
115
+ /** 文本描边宽度 */
80
116
  textStrokeWidth?: number;
117
+ /** 文本Y轴偏移 */
81
118
  textOffsetY?: number;
82
- fitView?: boolean;
83
- opacity?: number;
84
- mapClip?: boolean;
85
- mapClipData?: MapJSONData;
119
+ }
120
+ /**
121
+ * 点位选项接口 - 点位图层专用配置
122
+ */
123
+ export interface PointOptions extends BaseOptions, StyleOptions, TextOptions {
124
+ /** 名称字段键 */
125
+ nameKey?: string;
126
+ /** 图标图片 */
127
+ img?: string;
128
+ /** 图标缩放比例 */
129
+ scale?: number;
130
+ /** 是否有图标 */
131
+ hasImg?: boolean;
132
+ /** 图标颜色 */
133
+ iconColor?: string;
134
+ }
135
+ /**
136
+ * 线条选项接口 - 线条图层专用配置
137
+ */
138
+ export interface LineOptions extends BaseOptions, StyleOptions, TextOptions {
139
+ /** 线条类型 */
140
+ type?: string;
141
+ }
142
+ /**
143
+ * 多边形选项接口 - 多边形图层专用配置
144
+ */
145
+ export interface PolygonOptions extends BaseOptions, StyleOptions, TextOptions {
146
+ /** 名称字段键 */
147
+ nameKey?: string;
148
+ /** 是否为蒙版 */
86
149
  mask?: boolean;
150
+ }
151
+ /**
152
+ * 兼容性类型别名 - 保持向后兼容
153
+ * @deprecated 请使用具体的选项接口:PointOptions, LineOptions, PolygonOptions
154
+ */
155
+ export type OptionsType = BaseOptions & StyleOptions & TextOptions & {
156
+ nameKey?: string;
157
+ img?: string;
158
+ scale?: number;
159
+ hasImg?: boolean;
87
160
  iconColor?: string;
88
- [propName: string]: any;
161
+ type?: string;
162
+ mask?: boolean;
163
+ };
164
+ /**
165
+ * 图片图层数据接口
166
+ */
167
+ export interface ImageLayerData {
168
+ img: string;
169
+ extent: number[];
170
+ }
171
+ /**
172
+ * 蒙版图层配置接口
173
+ */
174
+ export interface MaskLayerOptions {
175
+ extent?: any;
176
+ fillColor?: string;
177
+ strokeWidth?: number;
178
+ strokeColor?: string;
179
+ zIndex?: number;
180
+ opacity?: number;
181
+ visible?: boolean;
182
+ layerName?: string;
183
+ }
184
+ /**
185
+ * 颜色映射接口
186
+ */
187
+ export interface ColorMap {
188
+ [level: string]: string;
189
+ }
190
+ /**
191
+ * 要素颜色更新选项接口
192
+ */
193
+ export interface FeatureColorUpdateOptions extends BaseOptions, StyleOptions, TextOptions {
194
+ /** 名称字段键 */
195
+ nameKey?: string;
89
196
  }
197
+ /**
198
+ * 点位数据接口
199
+ */
90
200
  export interface PointData {
91
201
  lgtd: number;
92
202
  lttd: number;
93
- [propName: string]: any;
203
+ [key: string]: any;
204
+ }
205
+ /**
206
+ * 线数据接口
207
+ */
208
+ export interface LineData {
209
+ type: string;
210
+ coordinates: number[][];
211
+ [key: string]: any;
212
+ }
213
+ /**
214
+ * 聚合选项接口
215
+ */
216
+ export interface ClusterOptions extends PointOptions {
217
+ /** 聚合距离 */
218
+ distance?: number;
219
+ /** 最小聚合距离 */
220
+ minDistance?: number;
221
+ }
222
+ /**
223
+ * 测量处理器类型
224
+ */
225
+ export type MeasureHandlerType = 'LineString' | 'Polygon';
226
+ /**
227
+ * 事件类型
228
+ */
229
+ export type EventType = 'click' | 'hover' | 'moveend';
230
+ /**
231
+ * Vue实例接口
232
+ */
233
+ export interface VueInstance {
234
+ mount(element: Element | string): VueInstance;
235
+ unmount?(): void;
236
+ $destroy?(): void;
237
+ [key: string]: any;
238
+ }
239
+ /**
240
+ * Vue应用接口
241
+ */
242
+ export interface VueApp {
243
+ mount(element: Element | string): VueInstance;
244
+ unmount(): void;
245
+ [key: string]: any;
246
+ }
247
+ /**
248
+ * Vue 2.x 实例接口
249
+ */
250
+ export interface VueLegacyInstance {
251
+ $mount(element?: Element | string): VueLegacyInstance;
252
+ $destroy(): void;
253
+ [key: string]: any;
254
+ }
255
+ /**
256
+ * DOM点位状态枚举
257
+ */
258
+ export declare enum DomPointState {
259
+ CREATED = "created",
260
+ MOUNTED = "mounted",
261
+ VISIBLE = "visible",
262
+ HIDDEN = "hidden",
263
+ DESTROYED = "destroyed"
264
+ }
265
+ /**
266
+ * DOM点位选项接口
267
+ */
268
+ export interface DomPointOptions {
269
+ Vue: any;
270
+ Template: any;
271
+ lgtd: number;
272
+ lttd: number;
273
+ props?: any;
274
+ longitude?: number;
275
+ latitude?: number;
276
+ styleType?: 'default' | 'custom';
277
+ positioning?: 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-center' | 'center-right' | 'top-left' | 'top-center' | 'top-right';
278
+ stopEvent?: boolean;
279
+ visible?: boolean;
280
+ className?: string;
281
+ zIndex?: number;
94
282
  }
95
- export type MeasureHandlerType = 'Polygon' | 'LineString';
96
- export type EventType = 'click' | 'moveend' | 'hover';
package/dist/types.js CHANGED
@@ -1 +1,11 @@
1
- export {};
1
+ /**
2
+ * DOM点位状态枚举
3
+ */
4
+ export var DomPointState;
5
+ (function (DomPointState) {
6
+ DomPointState["CREATED"] = "created";
7
+ DomPointState["MOUNTED"] = "mounted";
8
+ DomPointState["VISIBLE"] = "visible";
9
+ DomPointState["HIDDEN"] = "hidden";
10
+ DomPointState["DESTROYED"] = "destroyed";
11
+ })(DomPointState || (DomPointState = {}));
@@ -0,0 +1,102 @@
1
+ /**
2
+ * 错误类型枚举
3
+ */
4
+ export declare enum ErrorType {
5
+ VALIDATION_ERROR = "VALIDATION_ERROR",
6
+ MAP_ERROR = "MAP_ERROR",
7
+ LAYER_ERROR = "LAYER_ERROR",
8
+ COORDINATE_ERROR = "COORDINATE_ERROR",
9
+ DATA_ERROR = "DATA_ERROR",
10
+ COMPONENT_ERROR = "COMPONENT_ERROR"
11
+ }
12
+ /**
13
+ * 自定义错误类
14
+ */
15
+ export declare class MyOpenLayersError extends Error {
16
+ readonly type: ErrorType;
17
+ readonly timestamp: Date;
18
+ readonly context?: any;
19
+ constructor(message: string, type: ErrorType, context?: any);
20
+ }
21
+ /**
22
+ * 错误处理工具类
23
+ */
24
+ export declare class ErrorHandler {
25
+ private static instance;
26
+ private errorCallbacks;
27
+ private logLevel;
28
+ private constructor();
29
+ /**
30
+ * 获取单例实例
31
+ */
32
+ static getInstance(): ErrorHandler;
33
+ /**
34
+ * 设置日志级别
35
+ * @param level 日志级别
36
+ */
37
+ setLogLevel(level: 'debug' | 'info' | 'warn' | 'error'): void;
38
+ /**
39
+ * 添加错误回调
40
+ * @param callback 错误回调函数
41
+ */
42
+ addErrorCallback(callback: (error: MyOpenLayersError) => void): void;
43
+ /**
44
+ * 移除错误回调
45
+ * @param callback 要移除的回调函数
46
+ */
47
+ removeErrorCallback(callback: (error: MyOpenLayersError) => void): void;
48
+ /**
49
+ * 处理错误
50
+ * @param error 错误对象
51
+ */
52
+ handleError(error: MyOpenLayersError): void;
53
+ /**
54
+ * 创建并处理错误
55
+ * @param message 错误消息
56
+ * @param type 错误类型
57
+ * @param context 错误上下文
58
+ */
59
+ createAndHandleError(message: string, type: ErrorType, context?: any): MyOpenLayersError;
60
+ /**
61
+ * 记录错误日志
62
+ * @param error 错误对象
63
+ */
64
+ private logError;
65
+ /**
66
+ * 验证参数
67
+ * @param condition 验证条件
68
+ * @param message 错误消息
69
+ * @param context 错误上下文
70
+ */
71
+ static validate(condition: boolean, message: string, context?: any): void;
72
+ /**
73
+ * 验证地图实例
74
+ * @param map 地图实例
75
+ */
76
+ static validateMap(map: any): void;
77
+ /**
78
+ * 验证坐标
79
+ * @param longitude 经度
80
+ * @param latitude 纬度
81
+ */
82
+ static validateCoordinates(longitude: number, latitude: number): void;
83
+ /**
84
+ * 验证图层名称
85
+ * @param layerName 图层名称
86
+ */
87
+ static validateLayerName(layerName: string): void;
88
+ /**
89
+ * 验证数据
90
+ * @param data 数据
91
+ * @param dataType 数据类型描述
92
+ */
93
+ static validateData(data: any, dataType: string): void;
94
+ /**
95
+ * 安全执行函数
96
+ * @param fn 要执行的函数
97
+ * @param errorMessage 错误消息
98
+ * @param errorType 错误类型
99
+ * @param context 错误上下文
100
+ */
101
+ static safeExecute<T>(fn: () => T, errorMessage: string, errorType?: ErrorType, context?: any): T;
102
+ }
@@ -0,0 +1,191 @@
1
+ /**
2
+ * 错误类型枚举
3
+ */
4
+ export var ErrorType;
5
+ (function (ErrorType) {
6
+ ErrorType["VALIDATION_ERROR"] = "VALIDATION_ERROR";
7
+ ErrorType["MAP_ERROR"] = "MAP_ERROR";
8
+ ErrorType["LAYER_ERROR"] = "LAYER_ERROR";
9
+ ErrorType["COORDINATE_ERROR"] = "COORDINATE_ERROR";
10
+ ErrorType["DATA_ERROR"] = "DATA_ERROR";
11
+ ErrorType["COMPONENT_ERROR"] = "COMPONENT_ERROR";
12
+ })(ErrorType || (ErrorType = {}));
13
+ /**
14
+ * 自定义错误类
15
+ */
16
+ export class MyOpenLayersError extends Error {
17
+ constructor(message, type, context) {
18
+ super(message);
19
+ this.name = 'MyOpenLayersError';
20
+ this.type = type;
21
+ this.timestamp = new Date();
22
+ this.context = context;
23
+ // 确保错误堆栈正确显示(兼容Node.js和浏览器环境)
24
+ if (typeof Error.captureStackTrace === 'function') {
25
+ Error.captureStackTrace(this, MyOpenLayersError);
26
+ }
27
+ else {
28
+ // 在不支持captureStackTrace的环境中,手动设置stack
29
+ this.stack = (new Error()).stack;
30
+ }
31
+ }
32
+ }
33
+ /**
34
+ * 错误处理工具类
35
+ */
36
+ export class ErrorHandler {
37
+ constructor() {
38
+ this.errorCallbacks = [];
39
+ this.logLevel = 'error';
40
+ }
41
+ /**
42
+ * 获取单例实例
43
+ */
44
+ static getInstance() {
45
+ if (!ErrorHandler.instance) {
46
+ ErrorHandler.instance = new ErrorHandler();
47
+ }
48
+ return ErrorHandler.instance;
49
+ }
50
+ /**
51
+ * 设置日志级别
52
+ * @param level 日志级别
53
+ */
54
+ setLogLevel(level) {
55
+ this.logLevel = level;
56
+ }
57
+ /**
58
+ * 添加错误回调
59
+ * @param callback 错误回调函数
60
+ */
61
+ addErrorCallback(callback) {
62
+ this.errorCallbacks.push(callback);
63
+ }
64
+ /**
65
+ * 移除错误回调
66
+ * @param callback 要移除的回调函数
67
+ */
68
+ removeErrorCallback(callback) {
69
+ const index = this.errorCallbacks.indexOf(callback);
70
+ if (index > -1) {
71
+ this.errorCallbacks.splice(index, 1);
72
+ }
73
+ }
74
+ /**
75
+ * 处理错误
76
+ * @param error 错误对象
77
+ */
78
+ handleError(error) {
79
+ // 记录错误日志
80
+ this.logError(error);
81
+ // 调用错误回调
82
+ this.errorCallbacks.forEach(callback => {
83
+ try {
84
+ callback(error);
85
+ }
86
+ catch (callbackError) {
87
+ console.error('Error in error callback:', callbackError);
88
+ }
89
+ });
90
+ }
91
+ /**
92
+ * 创建并处理错误
93
+ * @param message 错误消息
94
+ * @param type 错误类型
95
+ * @param context 错误上下文
96
+ */
97
+ createAndHandleError(message, type, context) {
98
+ const error = new MyOpenLayersError(message, type, context);
99
+ this.handleError(error);
100
+ return error;
101
+ }
102
+ /**
103
+ * 记录错误日志
104
+ * @param error 错误对象
105
+ */
106
+ logError(error) {
107
+ const logMessage = `[${error.type}] ${error.message}`;
108
+ const logData = {
109
+ message: error.message,
110
+ type: error.type,
111
+ timestamp: error.timestamp,
112
+ context: error.context,
113
+ stack: error.stack
114
+ };
115
+ switch (this.logLevel) {
116
+ case 'debug':
117
+ console.debug(logMessage, logData);
118
+ break;
119
+ case 'info':
120
+ console.info(logMessage, logData);
121
+ break;
122
+ case 'warn':
123
+ console.warn(logMessage, logData);
124
+ break;
125
+ case 'error':
126
+ default:
127
+ console.error(logMessage, logData);
128
+ break;
129
+ }
130
+ }
131
+ /**
132
+ * 验证参数
133
+ * @param condition 验证条件
134
+ * @param message 错误消息
135
+ * @param context 错误上下文
136
+ */
137
+ static validate(condition, message, context) {
138
+ if (!condition) {
139
+ throw ErrorHandler.getInstance().createAndHandleError(message, ErrorType.VALIDATION_ERROR, context);
140
+ }
141
+ }
142
+ /**
143
+ * 验证地图实例
144
+ * @param map 地图实例
145
+ */
146
+ static validateMap(map) {
147
+ ErrorHandler.validate(map && typeof map === 'object', 'Map instance is required', { map });
148
+ }
149
+ /**
150
+ * 验证坐标
151
+ * @param longitude 经度
152
+ * @param latitude 纬度
153
+ */
154
+ static validateCoordinates(longitude, latitude) {
155
+ ErrorHandler.validate(typeof longitude === 'number' && !isNaN(longitude), 'Valid longitude is required', { longitude, latitude });
156
+ ErrorHandler.validate(typeof latitude === 'number' && !isNaN(latitude), 'Valid latitude is required', { longitude, latitude });
157
+ ErrorHandler.validate(longitude >= -180 && longitude <= 180, 'Longitude must be between -180 and 180', { longitude, latitude });
158
+ ErrorHandler.validate(latitude >= -90 && latitude <= 90, 'Latitude must be between -90 and 90', { longitude, latitude });
159
+ }
160
+ /**
161
+ * 验证图层名称
162
+ * @param layerName 图层名称
163
+ */
164
+ static validateLayerName(layerName) {
165
+ ErrorHandler.validate(typeof layerName === 'string' && layerName.trim().length > 0, 'Valid layer name is required', { layerName });
166
+ }
167
+ /**
168
+ * 验证数据
169
+ * @param data 数据
170
+ * @param dataType 数据类型描述
171
+ */
172
+ static validateData(data, dataType) {
173
+ ErrorHandler.validate(data !== null && data !== undefined, `${dataType} is required`, { data, dataType });
174
+ }
175
+ /**
176
+ * 安全执行函数
177
+ * @param fn 要执行的函数
178
+ * @param errorMessage 错误消息
179
+ * @param errorType 错误类型
180
+ * @param context 错误上下文
181
+ */
182
+ static safeExecute(fn, errorMessage, errorType = ErrorType.COMPONENT_ERROR, context) {
183
+ try {
184
+ return fn();
185
+ }
186
+ catch (error) {
187
+ const myError = ErrorHandler.getInstance().createAndHandleError(`${errorMessage}: ${error}`, errorType, { originalError: error, context });
188
+ throw myError;
189
+ }
190
+ }
191
+ }
@@ -0,0 +1,162 @@
1
+ /**
2
+ * 验证工具类
3
+ * 统一管理所有验证方法
4
+ */
5
+ export declare class ValidationUtils {
6
+ /**
7
+ * 验证坐标是否有效
8
+ * @param longitude 经度
9
+ * @param latitude 纬度
10
+ * @returns 是否有效
11
+ */
12
+ static isValidCoordinate(longitude: number, latitude: number): boolean;
13
+ /**
14
+ * 验证经纬度坐标(简化版本)
15
+ * @param lgtd 经度
16
+ * @param lttd 纬度
17
+ * @returns 是否有效
18
+ */
19
+ static validateLngLat(lgtd: number, lttd: number): boolean;
20
+ /**
21
+ * 验证点数据数组
22
+ * @param pointData 点数据数组
23
+ * @returns 是否有效
24
+ */
25
+ static validatePointData(pointData: any[]): boolean;
26
+ /**
27
+ * 验证单个点的坐标
28
+ * @param item 包含坐标的数据项
29
+ * @returns 是否有效
30
+ */
31
+ static validateCoordinates(item: any): boolean;
32
+ /**
33
+ * 验证颜色字符串是否有效
34
+ * @param color 颜色字符串
35
+ * @returns 是否有效
36
+ */
37
+ static isValidColor(color: string): boolean;
38
+ /**
39
+ * 验证图层名称是否有效
40
+ * @param layerName 图层名称
41
+ * @returns 是否有效
42
+ */
43
+ static isValidLayerName(layerName: string): boolean;
44
+ /**
45
+ * 验证范围是否有效
46
+ * @param extent 范围数组 [minX, minY, maxX, maxY]
47
+ * @returns 是否有效
48
+ */
49
+ static isValidExtent(extent: number[]): boolean;
50
+ /**
51
+ * 验证GeoJSON数据
52
+ * @param data GeoJSON数据
53
+ * @returns 是否有效
54
+ */
55
+ static validateGeoJSONData(data: any): boolean;
56
+ /**
57
+ * 验证配置选项
58
+ * @param options 配置选项
59
+ * @returns 是否有效
60
+ */
61
+ static validateOptions(options: any): boolean;
62
+ /**
63
+ * 验证数值范围
64
+ * @param value 数值
65
+ * @param min 最小值
66
+ * @param max 最大值
67
+ * @returns 是否有效
68
+ */
69
+ static validateNumberRange(value: number, min: number, max: number): boolean;
70
+ /**
71
+ * 验证DOM元素ID
72
+ * @param id 元素ID
73
+ * @returns 是否有效
74
+ */
75
+ static validateElementId(id: string): boolean;
76
+ /**
77
+ * 验证Vue相关参数
78
+ * @param pointInfoList 点位信息列表
79
+ * @param template Vue组件模板
80
+ * @param Vue Vue实例
81
+ * @returns 是否有效
82
+ */
83
+ static validateVueParams(pointInfoList: any[], template: any, Vue: any): boolean;
84
+ /**
85
+ * 验证图层名称(抛出异常版本)
86
+ * @param layerName 图层名称
87
+ * @throws 如果图层名称无效则抛出异常
88
+ */
89
+ static validateLayerName(layerName: string): void;
90
+ /**
91
+ * 验证图像数据
92
+ * @param imageData 图像数据
93
+ * @throws 如果图像数据无效则抛出异常
94
+ */
95
+ static validateImageData(imageData: any): void;
96
+ /**
97
+ * 验证遮罩数据
98
+ * @param data 遮罩数据
99
+ * @throws 如果遮罩数据无效则抛出异常
100
+ */
101
+ static validateMaskData(data: any): void;
102
+ /**
103
+ * 验证地图实例
104
+ * @param map 地图实例
105
+ * @throws 如果地图实例无效则抛出异常
106
+ */
107
+ static validateMapInstance(map: any): void;
108
+ /**
109
+ * 验证必需参数
110
+ * @param value 要验证的值
111
+ * @param message 错误消息
112
+ * @throws 如果值为空则抛出异常
113
+ */
114
+ static validateRequired(value: any, message: string): void;
115
+ /**
116
+ * 验证坐标(抛出异常版本)
117
+ * @param longitude 经度
118
+ * @param latitude 纬度
119
+ * @throws 如果坐标无效则抛出异常
120
+ */
121
+ static validateCoordinate(longitude: number, latitude: number): void;
122
+ /**
123
+ * 验证类型
124
+ * @param value 要验证的值
125
+ * @param expectedType 期望的类型
126
+ * @param message 错误消息
127
+ * @throws 如果类型不匹配则抛出异常
128
+ */
129
+ static validateType(value: any, expectedType: string, message: string): void;
130
+ /**
131
+ * 验证非空字符串(抛出异常版本)
132
+ * @param str 字符串
133
+ * @param message 错误消息
134
+ * @throws 如果字符串为空则抛出异常
135
+ */
136
+ static validateNonEmptyString(str: string, message: string): void;
137
+ /**
138
+ * 验证地图实例(通用版本)
139
+ * @param map 地图实例
140
+ * @throws 如果地图实例无效则抛出异常
141
+ */
142
+ static validateMap(map: any): void;
143
+ /**
144
+ * 验证测量类型
145
+ * @param type 测量类型
146
+ * @throws 如果测量类型无效则抛出异常
147
+ */
148
+ static validateMeasureType(type: string): void;
149
+ /**
150
+ * 验证正数
151
+ * @param value 数值
152
+ * @param message 错误消息
153
+ * @throws 如果数值不是正数则抛出异常
154
+ */
155
+ static validatePositiveNumber(value: number, message: string): void;
156
+ /**
157
+ * 验证图层名称参数
158
+ * @param layerName 图层名称(字符串或字符串数组)
159
+ * @throws 如果图层名称参数无效则抛出异常
160
+ */
161
+ static validateLayerNameParam(layerName: string | string[]): void;
162
+ }