my-openlayer 1.0.15 → 2.0.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/core/Polygon.d.ts CHANGED
@@ -1,139 +1,139 @@
1
- import Map from "ol/Map";
2
- import VectorLayer from "ol/layer/Vector";
3
- import VectorSource from "ol/source/Vector";
4
- import { Image as ImageLayer, Heatmap } from "ol/layer";
5
- import { PolygonOptions, MapJSONData, PointData, HeatMapOptions, ImageLayerData, MaskLayerOptions, FeatureColorUpdateOptions } from '../types';
6
- /**
7
- * Polygon 类用于处理地图上的面要素操作
8
- * 包括添加多边形、边框、图片图层、热力图等功能
9
- */
10
- export default class Polygon {
11
- private map;
12
- private colorMap;
13
- [key: string]: any;
14
- /**
15
- * 构造函数
16
- * @param map OpenLayers 地图实例
17
- */
18
- constructor(map: Map);
19
- /**
20
- * 获取等级颜色
21
- * @param lev 等级值,支持字符串或数字
22
- * @returns 对应等级的颜色值,如果等级不存在则返回默认颜色
23
- */
24
- getLevColor(lev: string | number): string;
25
- /**
26
- * 添加地图边框图层
27
- * @param data 图层数据,必须是有效的 GeoJSON 格式
28
- * @param options 图层配置选项
29
- * @returns 创建的图层实例
30
- * @throws 当数据格式无效时抛出错误
31
- */
32
- addBorderPolygon(data: MapJSONData, options?: PolygonOptions): VectorLayer<VectorSource>;
33
- /**
34
- * 添加多边形图层
35
- * @param dataJSON GeoJSON 数据
36
- * @param options 图层配置选项
37
- * @returns 创建的矢量图层
38
- * @throws 当数据格式无效时抛出错误
39
- */
40
- addPolygon(dataJSON: MapJSONData, options?: PolygonOptions): VectorLayer<VectorSource>;
41
- /**
42
- * 设置要素样式
43
- * @param features 要素数组
44
- * @param options 样式配置选项
45
- */
46
- private setFeatureStyles;
47
- /**
48
- * 获取要素文本
49
- * @param feature 要素对象
50
- * @param options 配置选项
51
- * @returns 文本内容
52
- */
53
- private getFeatureText;
54
- /**
55
- * 适应图层视图
56
- * @param layer 图层对象
57
- */
58
- private fitViewToLayer;
59
- /**
60
- * 根据数据数组更新某个面颜色
61
- * @param layerName 图层名称
62
- * @param colorObj 颜色映射对象,键为要素属性值,值为颜色字符串
63
- * @param options 配置项
64
- * @throws 当图层不存在时抛出错误
65
- */
66
- updateFeatureColor(layerName: string, colorObj?: {
67
- [propName: string]: string;
68
- }, options?: FeatureColorUpdateOptions): void;
69
- /**
70
- * 更新单个要素的颜色
71
- * @param feature 要素对象
72
- * @param colorObj 颜色映射对象
73
- * @param options 配置选项
74
- */
75
- private updateSingleFeatureColor;
76
- /**
77
- * 设置外围蒙版图层
78
- *
79
- * 详细文档参考 https_blog.csdn.net/?url=https%3A%2F%2Fblog.csdn.net%2Fu012413551%2Farticle%2Fdetails%2F122739501
80
- *
81
- * @param data
82
- * @param options
83
- */
84
- setOutLayer(data: MapJSONData, options?: {
85
- extent?: any;
86
- fillColor?: string;
87
- strokeWidth?: number;
88
- strokeColor?: string;
89
- zIndex?: number;
90
- }): void;
91
- /**
92
- * 添加图片图层
93
- * @param imageData 图片数据,包含url和extent
94
- * @param options 配置项
95
- * @returns 创建的图片图层
96
- * @throws 当数据格式无效时抛出错误
97
- */
98
- addImageLayer(imageData: ImageLayerData, options?: PolygonOptions): ImageLayer<any>;
99
- /**
100
- * 尝试更新现有图层
101
- * @private
102
- */
103
- private tryUpdateExistingImageLayer;
104
- /**
105
- * 创建新的图像图层
106
- * @private
107
- */
108
- private createNewImageLayer;
109
- /**
110
- * 更新图层属性
111
- * @private
112
- */
113
- private updateImageLayerProperties;
114
- /**
115
- * 配置图层基本属性
116
- * @private
117
- */
118
- private configureImageLayer;
119
- /**
120
- * 添加图层到地图并应用裁剪
121
- * @private
122
- */
123
- private addImageLayerToMap;
124
- /**
125
- * 添加热力图图层
126
- * @param pointData 点数据数组
127
- * @param options 热力图配置
128
- */
129
- addHeatmap(pointData: PointData[], options?: HeatMapOptions): Heatmap;
130
- /**
131
- * 添加遮罩图层
132
- * @param data GeoJSON格式的遮罩数据
133
- * @param options 配置项
134
- * @returns 创建的遮罩图层
135
- * @throws 当数据格式无效时抛出错误
136
- */
137
- addMaskLayer(data: any, options?: MaskLayerOptions): VectorLayer<VectorSource>;
138
- removePolygonLayer(layerName: string): void;
139
- }
1
+ import Map from "ol/Map";
2
+ import VectorLayer from "ol/layer/Vector";
3
+ import VectorSource from "ol/source/Vector";
4
+ import { Image as ImageLayer, Heatmap } from "ol/layer";
5
+ import { PolygonOptions, MapJSONData, PointData, HeatMapOptions, ImageLayerData, MaskLayerOptions, FeatureColorUpdateOptions } from '../types';
6
+ /**
7
+ * Polygon 类用于处理地图上的面要素操作
8
+ * 包括添加多边形、边框、图片图层、热力图等功能
9
+ */
10
+ export default class Polygon {
11
+ private map;
12
+ private colorMap;
13
+ [key: string]: any;
14
+ /**
15
+ * 构造函数
16
+ * @param map OpenLayers 地图实例
17
+ */
18
+ constructor(map: Map);
19
+ /**
20
+ * 获取等级颜色
21
+ * @param lev 等级值,支持字符串或数字
22
+ * @returns 对应等级的颜色值,如果等级不存在则返回默认颜色
23
+ */
24
+ getLevColor(lev: string | number): string;
25
+ /**
26
+ * 添加地图边框图层
27
+ * @param data 图层数据,必须是有效的 GeoJSON 格式
28
+ * @param options 图层配置选项
29
+ * @returns 创建的图层实例
30
+ * @throws 当数据格式无效时抛出错误
31
+ */
32
+ addBorderPolygon(data: MapJSONData, options?: PolygonOptions): VectorLayer<VectorSource>;
33
+ /**
34
+ * 添加多边形图层
35
+ * @param dataJSON GeoJSON 数据
36
+ * @param options 图层配置选项
37
+ * @returns 创建的矢量图层
38
+ * @throws 当数据格式无效时抛出错误
39
+ */
40
+ addPolygon(dataJSON: MapJSONData, options?: PolygonOptions): VectorLayer<VectorSource>;
41
+ /**
42
+ * 设置要素样式
43
+ * @param features 要素数组
44
+ * @param options 样式配置选项
45
+ */
46
+ private setFeatureStyles;
47
+ /**
48
+ * 获取要素文本
49
+ * @param feature 要素对象
50
+ * @param options 配置选项
51
+ * @returns 文本内容
52
+ */
53
+ private getFeatureText;
54
+ /**
55
+ * 适应图层视图
56
+ * @param layer 图层对象
57
+ */
58
+ private fitViewToLayer;
59
+ /**
60
+ * 根据数据数组更新某个面颜色
61
+ * @param layerName 图层名称
62
+ * @param colorObj 颜色映射对象,键为要素属性值,值为颜色字符串
63
+ * @param options 配置项
64
+ * @throws 当图层不存在时抛出错误
65
+ */
66
+ updateFeatureColor(layerName: string, colorObj?: {
67
+ [propName: string]: string;
68
+ }, options?: FeatureColorUpdateOptions): void;
69
+ /**
70
+ * 更新单个要素的颜色
71
+ * @param feature 要素对象
72
+ * @param colorObj 颜色映射对象
73
+ * @param options 配置选项
74
+ */
75
+ private updateSingleFeatureColor;
76
+ /**
77
+ * 设置外围蒙版图层
78
+ *
79
+ * 详细文档参考 https_blog.csdn.net/?url=https%3A%2F%2Fblog.csdn.net%2Fu012413551%2Farticle%2Fdetails%2F122739501
80
+ *
81
+ * @param data
82
+ * @param options
83
+ */
84
+ setOutLayer(data: MapJSONData, options?: {
85
+ extent?: any;
86
+ fillColor?: string;
87
+ strokeWidth?: number;
88
+ strokeColor?: string;
89
+ zIndex?: number;
90
+ }): void;
91
+ /**
92
+ * 添加图片图层
93
+ * @param imageData 图片数据,包含url和extent
94
+ * @param options 配置项
95
+ * @returns 创建的图片图层
96
+ * @throws 当数据格式无效时抛出错误
97
+ */
98
+ addImageLayer(imageData: ImageLayerData, options?: PolygonOptions): ImageLayer<any>;
99
+ /**
100
+ * 尝试更新现有图层
101
+ * @private
102
+ */
103
+ private tryUpdateExistingImageLayer;
104
+ /**
105
+ * 创建新的图像图层
106
+ * @private
107
+ */
108
+ private createNewImageLayer;
109
+ /**
110
+ * 更新图层属性
111
+ * @private
112
+ */
113
+ private updateImageLayerProperties;
114
+ /**
115
+ * 配置图层基本属性
116
+ * @private
117
+ */
118
+ private configureImageLayer;
119
+ /**
120
+ * 添加图层到地图并应用裁剪
121
+ * @private
122
+ */
123
+ private addImageLayerToMap;
124
+ /**
125
+ * 添加热力图图层
126
+ * @param pointData 点数据数组
127
+ * @param options 热力图配置
128
+ */
129
+ addHeatmap(pointData: PointData[], options?: HeatMapOptions): Heatmap;
130
+ /**
131
+ * 添加遮罩图层
132
+ * @param data GeoJSON格式的遮罩数据
133
+ * @param options 配置项
134
+ * @returns 创建的遮罩图层
135
+ * @throws 当数据格式无效时抛出错误
136
+ */
137
+ addMaskLayer(data: any, options?: MaskLayerOptions): VectorLayer<VectorSource>;
138
+ removePolygonLayer(layerName: string): void;
139
+ }