my-openlayer 2.0.0 → 2.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/MyOl.d.ts +128 -128
- package/MyOl.js +382 -381
- package/README.md +0 -21
- package/core/ConfigManager.d.ts +88 -88
- package/core/ConfigManager.js +112 -112
- package/core/EventManager.d.ts +141 -141
- package/core/EventManager.js +316 -316
- package/core/Line.d.ts +130 -109
- package/core/Line.js +354 -288
- package/core/MapBaseLayers.d.ts +234 -234
- package/core/MapBaseLayers.js +573 -573
- package/core/MapTools.d.ts +68 -68
- package/core/MapTools.js +202 -201
- package/core/MeasureHandler.d.ts +65 -65
- package/core/MeasureHandler.js +312 -312
- package/core/Point.d.ts +94 -94
- package/core/Point.js +348 -348
- package/core/Polygon.d.ts +157 -139
- package/core/Polygon.js +558 -529
- package/core/VueTemplatePoint.d.ts +51 -51
- package/core/VueTemplatePoint.js +529 -529
- package/index.d.ts +18 -18
- package/index.js +17 -17
- package/package.json +1 -1
- package/types.d.ts +305 -302
- package/types.js +11 -11
- package/utils/ErrorHandler.d.ts +102 -102
- package/utils/ErrorHandler.js +191 -191
- package/utils/ValidationUtils.d.ts +163 -163
- package/utils/ValidationUtils.js +312 -312
package/MyOl.d.ts
CHANGED
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
import View from "ol/View";
|
|
2
|
-
import Map from "ol/Map";
|
|
3
|
-
import Polygon from "./core/Polygon";
|
|
4
|
-
import Point from "./core/Point";
|
|
5
|
-
import Line from "./core/Line";
|
|
6
|
-
import MapBaseLayers from "./core/MapBaseLayers";
|
|
7
|
-
import MapTools from "./core/MapTools";
|
|
8
|
-
import { ErrorHandler } from './utils/ErrorHandler';
|
|
9
|
-
import { EventManager } from './core/EventManager';
|
|
10
|
-
import { ConfigManager } from './core/ConfigManager';
|
|
11
|
-
import { MapInitType } from './types';
|
|
12
|
-
/**
|
|
13
|
-
* MyOl 地图核心类
|
|
14
|
-
* 提供完整的地图操作功能,包括点、线、面要素管理,底图切换,工具操作等
|
|
15
|
-
*/
|
|
16
|
-
export default class MyOl {
|
|
17
|
-
readonly map: Map;
|
|
18
|
-
private _baseLayers?;
|
|
19
|
-
private _polygon?;
|
|
20
|
-
private _mapTools?;
|
|
21
|
-
private _point?;
|
|
22
|
-
private _line?;
|
|
23
|
-
private readonly errorHandler;
|
|
24
|
-
private _eventManager?;
|
|
25
|
-
private readonly configManager;
|
|
26
|
-
private readonly options;
|
|
27
|
-
static readonly DefaultOptions: MapInitType;
|
|
28
|
-
private static readonly PROJECTIONS;
|
|
29
|
-
/**
|
|
30
|
-
* 构造函数
|
|
31
|
-
* @param id 地图容器 DOM 元素 ID
|
|
32
|
-
* @param options 地图初始化配置
|
|
33
|
-
*/
|
|
34
|
-
constructor(id: string, options?: Partial<MapInitType>);
|
|
35
|
-
/**
|
|
36
|
-
* 验证构造函数参数
|
|
37
|
-
* @private
|
|
38
|
-
*/
|
|
39
|
-
private validateConstructorParams;
|
|
40
|
-
/**
|
|
41
|
-
* 初始化坐标系
|
|
42
|
-
* @private
|
|
43
|
-
*/
|
|
44
|
-
private static initializeProjections;
|
|
45
|
-
/**
|
|
46
|
-
* 创建地图控件
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
private createControls;
|
|
50
|
-
/**
|
|
51
|
-
* 初始化事件监听
|
|
52
|
-
* @private
|
|
53
|
-
*/
|
|
54
|
-
private initializeEventListeners;
|
|
55
|
-
/**
|
|
56
|
-
* 创建地图视图
|
|
57
|
-
* @param options 视图配置
|
|
58
|
-
* @returns View 地图视图实例
|
|
59
|
-
*/
|
|
60
|
-
static createView(options?: MapInitType): View;
|
|
61
|
-
/**
|
|
62
|
-
* 获取视图(向后兼容)
|
|
63
|
-
* @deprecated 请使用 createView 方法
|
|
64
|
-
*/
|
|
65
|
-
static getView(options?: MapInitType): View;
|
|
66
|
-
/**
|
|
67
|
-
* 获取面要素操作模块
|
|
68
|
-
* @returns Polygon 面要素操作实例
|
|
69
|
-
*/
|
|
70
|
-
getPolygon(): Polygon;
|
|
71
|
-
/**
|
|
72
|
-
* 获取底图图层管理模块
|
|
73
|
-
* @returns MapBaseLayers 底图管理实例
|
|
74
|
-
*/
|
|
75
|
-
getMapBaseLayers(): MapBaseLayers;
|
|
76
|
-
/**
|
|
77
|
-
* 获取点要素操作模块
|
|
78
|
-
* @returns Point 点要素操作实例
|
|
79
|
-
*/
|
|
80
|
-
getPoint(): Point;
|
|
81
|
-
/**
|
|
82
|
-
* 获取线要素操作模块
|
|
83
|
-
* @returns Line 线要素操作实例
|
|
84
|
-
*/
|
|
85
|
-
getLine(): Line;
|
|
86
|
-
/**
|
|
87
|
-
* 获取地图工具模块
|
|
88
|
-
* @returns MapTools 地图工具实例
|
|
89
|
-
*/
|
|
90
|
-
getTools(): MapTools;
|
|
91
|
-
/**
|
|
92
|
-
* 重置地图位置到初始中心点
|
|
93
|
-
* @param duration 动画持续时间(毫秒)
|
|
94
|
-
*/
|
|
95
|
-
resetPosition(duration?: number): void;
|
|
96
|
-
/**
|
|
97
|
-
* 地图定位到指定坐标
|
|
98
|
-
* @param longitude 经度
|
|
99
|
-
* @param latitude 纬度
|
|
100
|
-
* @param zoom 缩放级别
|
|
101
|
-
* @param duration 动画持续时间(毫秒)
|
|
102
|
-
*/
|
|
103
|
-
locationAction(longitude: number, latitude: number, zoom?: number, duration?: number): void;
|
|
104
|
-
/**
|
|
105
|
-
* 获取错误处理器实例
|
|
106
|
-
* @returns ErrorHandler 错误处理器
|
|
107
|
-
*/
|
|
108
|
-
getErrorHandler(): ErrorHandler;
|
|
109
|
-
/**
|
|
110
|
-
* 获取事件管理器实例
|
|
111
|
-
* @returns EventManager 事件管理器
|
|
112
|
-
*/
|
|
113
|
-
getEventManager(): EventManager;
|
|
114
|
-
/**
|
|
115
|
-
* 获取配置管理器实例
|
|
116
|
-
* @returns ConfigManager 配置管理器
|
|
117
|
-
*/
|
|
118
|
-
getConfigManager(): ConfigManager;
|
|
119
|
-
/**
|
|
120
|
-
* 获取当前地图配置
|
|
121
|
-
* @returns MapInitType 地图配置
|
|
122
|
-
*/
|
|
123
|
-
getMapOptions(): Readonly<MapInitType>;
|
|
124
|
-
/**
|
|
125
|
-
* 销毁地图实例和相关资源
|
|
126
|
-
*/
|
|
127
|
-
destroy(): void;
|
|
128
|
-
}
|
|
1
|
+
import View from "ol/View";
|
|
2
|
+
import Map from "ol/Map";
|
|
3
|
+
import Polygon from "./core/Polygon";
|
|
4
|
+
import Point from "./core/Point";
|
|
5
|
+
import Line from "./core/Line";
|
|
6
|
+
import MapBaseLayers from "./core/MapBaseLayers";
|
|
7
|
+
import MapTools from "./core/MapTools";
|
|
8
|
+
import { ErrorHandler } from './utils/ErrorHandler';
|
|
9
|
+
import { EventManager } from './core/EventManager';
|
|
10
|
+
import { ConfigManager } from './core/ConfigManager';
|
|
11
|
+
import { MapInitType } from './types';
|
|
12
|
+
/**
|
|
13
|
+
* MyOl 地图核心类
|
|
14
|
+
* 提供完整的地图操作功能,包括点、线、面要素管理,底图切换,工具操作等
|
|
15
|
+
*/
|
|
16
|
+
export default class MyOl {
|
|
17
|
+
readonly map: Map;
|
|
18
|
+
private _baseLayers?;
|
|
19
|
+
private _polygon?;
|
|
20
|
+
private _mapTools?;
|
|
21
|
+
private _point?;
|
|
22
|
+
private _line?;
|
|
23
|
+
private readonly errorHandler;
|
|
24
|
+
private _eventManager?;
|
|
25
|
+
private readonly configManager;
|
|
26
|
+
private readonly options;
|
|
27
|
+
static readonly DefaultOptions: MapInitType;
|
|
28
|
+
private static readonly PROJECTIONS;
|
|
29
|
+
/**
|
|
30
|
+
* 构造函数
|
|
31
|
+
* @param id 地图容器 DOM 元素 ID
|
|
32
|
+
* @param options 地图初始化配置
|
|
33
|
+
*/
|
|
34
|
+
constructor(id: string, options?: Partial<MapInitType>);
|
|
35
|
+
/**
|
|
36
|
+
* 验证构造函数参数
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
private validateConstructorParams;
|
|
40
|
+
/**
|
|
41
|
+
* 初始化坐标系
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
private static initializeProjections;
|
|
45
|
+
/**
|
|
46
|
+
* 创建地图控件
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
private createControls;
|
|
50
|
+
/**
|
|
51
|
+
* 初始化事件监听
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
private initializeEventListeners;
|
|
55
|
+
/**
|
|
56
|
+
* 创建地图视图
|
|
57
|
+
* @param options 视图配置
|
|
58
|
+
* @returns View 地图视图实例
|
|
59
|
+
*/
|
|
60
|
+
static createView(options?: MapInitType): View;
|
|
61
|
+
/**
|
|
62
|
+
* 获取视图(向后兼容)
|
|
63
|
+
* @deprecated 请使用 createView 方法
|
|
64
|
+
*/
|
|
65
|
+
static getView(options?: MapInitType): View;
|
|
66
|
+
/**
|
|
67
|
+
* 获取面要素操作模块
|
|
68
|
+
* @returns Polygon 面要素操作实例
|
|
69
|
+
*/
|
|
70
|
+
getPolygon(): Polygon;
|
|
71
|
+
/**
|
|
72
|
+
* 获取底图图层管理模块
|
|
73
|
+
* @returns MapBaseLayers 底图管理实例
|
|
74
|
+
*/
|
|
75
|
+
getMapBaseLayers(): MapBaseLayers;
|
|
76
|
+
/**
|
|
77
|
+
* 获取点要素操作模块
|
|
78
|
+
* @returns Point 点要素操作实例
|
|
79
|
+
*/
|
|
80
|
+
getPoint(): Point;
|
|
81
|
+
/**
|
|
82
|
+
* 获取线要素操作模块
|
|
83
|
+
* @returns Line 线要素操作实例
|
|
84
|
+
*/
|
|
85
|
+
getLine(): Line;
|
|
86
|
+
/**
|
|
87
|
+
* 获取地图工具模块
|
|
88
|
+
* @returns MapTools 地图工具实例
|
|
89
|
+
*/
|
|
90
|
+
getTools(): MapTools;
|
|
91
|
+
/**
|
|
92
|
+
* 重置地图位置到初始中心点
|
|
93
|
+
* @param duration 动画持续时间(毫秒)
|
|
94
|
+
*/
|
|
95
|
+
resetPosition(duration?: number): void;
|
|
96
|
+
/**
|
|
97
|
+
* 地图定位到指定坐标
|
|
98
|
+
* @param longitude 经度
|
|
99
|
+
* @param latitude 纬度
|
|
100
|
+
* @param zoom 缩放级别
|
|
101
|
+
* @param duration 动画持续时间(毫秒)
|
|
102
|
+
*/
|
|
103
|
+
locationAction(longitude: number, latitude: number, zoom?: number, duration?: number): void;
|
|
104
|
+
/**
|
|
105
|
+
* 获取错误处理器实例
|
|
106
|
+
* @returns ErrorHandler 错误处理器
|
|
107
|
+
*/
|
|
108
|
+
getErrorHandler(): ErrorHandler;
|
|
109
|
+
/**
|
|
110
|
+
* 获取事件管理器实例
|
|
111
|
+
* @returns EventManager 事件管理器
|
|
112
|
+
*/
|
|
113
|
+
getEventManager(): EventManager;
|
|
114
|
+
/**
|
|
115
|
+
* 获取配置管理器实例
|
|
116
|
+
* @returns ConfigManager 配置管理器
|
|
117
|
+
*/
|
|
118
|
+
getConfigManager(): ConfigManager;
|
|
119
|
+
/**
|
|
120
|
+
* 获取当前地图配置
|
|
121
|
+
* @returns MapInitType 地图配置
|
|
122
|
+
*/
|
|
123
|
+
getMapOptions(): Readonly<MapInitType>;
|
|
124
|
+
/**
|
|
125
|
+
* 销毁地图实例和相关资源
|
|
126
|
+
*/
|
|
127
|
+
destroy(): void;
|
|
128
|
+
}
|