v-openlayers 2.9.5 → 2.10.2
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/package/v-map/global.d.ts +208 -0
- package/package/v-map/ol/config.d.ts +5 -0
- package/package/v-map/ol/lib/business/OlHandler.d.ts +49 -0
- package/package/v-map/ol/lib/config/mapConfig-4326.d.ts +36 -0
- package/package/v-map/ol/lib/core/VMap.d.ts +556 -0
- package/package/v-map/ol/lib/core/plugins/DrawConditions.d.ts +64 -0
- package/package/v-map/ol/lib/core/plugins/DrawHandler.d.ts +306 -0
- package/package/v-map/ol/lib/core/plugins/FeatureHandler.d.ts +117 -0
- package/package/v-map/ol/lib/core/plugins/GeojsonHandler.d.ts +76 -0
- package/package/v-map/ol/lib/core/plugins/GeometryHandler.d.ts +117 -0
- package/package/v-map/ol/lib/core/plugins/InteractionHandler.d.ts +230 -0
- package/package/v-map/ol/lib/core/plugins/KrigingHandler.d.ts +18 -0
- package/package/v-map/ol/lib/core/plugins/LayerHandler.d.ts +386 -0
- package/package/v-map/ol/lib/core/plugins/MeasureHandler.d.ts +32 -0
- package/package/v-map/ol/lib/core/plugins/Simplify.d.ts +26 -0
- package/package/v-map/ol/lib/core/plugins/StyleHandler.d.ts +72 -0
- package/package/v-map/ol/lib/core/plugins/TransformHandler.d.ts +35 -0
- package/package/v-map/ol/lib/core/plugins/WMTSExplorer.d.ts +108 -0
- package/package/v-map/ol/lib/core/plugins/WfsHandler.d.ts +66 -0
- package/package/v-map/ol/lib/core/plugins/WktHandler.d.ts +62 -0
- package/package/v-map/ol/lib/core/plugins/WmsHandler.d.ts +32 -0
- package/package/v-map/ol/lib/core/plugins/baidu/BaiduMap.d.ts +3 -0
- package/package/v-map/ol/lib/core/plugins/baidu/bd09.d.ts +2 -0
- package/package/v-map/ol/lib/core/plugins/mapbox-streets-v6-style.d.ts +1 -0
- package/package/v-map/ol/types/types.d.ts +84 -0
- package/package/v-map/public/utils/advanced/GradientColor.d.ts +27 -0
- package/package/v-map/public/utils/base/color.d.ts +17 -0
- package/package/v-map/public/utils/base/common.d.ts +126 -0
- package/package/v-map/public/utils/base/date.d.ts +52 -0
- package/package/v-map/public/utils/base/index.d.ts +340 -0
- package/package/v-map/public/utils/base/number.d.ts +21 -0
- package/package/v-map/public/utils/base/string.d.ts +16 -0
- package/package/v-map/public/utils/base/transform.d.ts +12 -0
- package/package/v-map/public/utils/base/type.d.ts +88 -0
- package/package/v-map/public/utils/base/utils.d.ts +155 -0
- package/package/v-map/public/utils/base/validate.d.ts +54 -0
- package/package/v-map/public/utils/map/index.d.ts +15 -0
- package/package/v-map/public/utils/map/ol.d.ts +7 -0
- package/package/v-map/public/utils/map/transform.d.ts +1 -0
- package/package/v-map/public/utils/map/turf.d.ts +1 -0
- package/package/v-openlayers.css +1 -1
- package/package/v-openlayers.d.ts +35 -9578
- package/package/v-openlayers.mjs +31034 -82215
- package/package.json +3 -2
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { Snap } from 'ol/interaction';
|
|
2
|
+
import Map from 'ol/Map';
|
|
3
|
+
import VectorLayer from 'ol/layer/Vector';
|
|
4
|
+
import VectorSource from 'ol/source/Vector';
|
|
5
|
+
import Feature from 'ol/Feature';
|
|
6
|
+
import { Geometry } from 'ol/geom';
|
|
7
|
+
import Collection from 'ol/Collection';
|
|
8
|
+
/**
|
|
9
|
+
* 交互处理器配置选项
|
|
10
|
+
*/
|
|
11
|
+
interface InteractionHandlerOptions {
|
|
12
|
+
layers?: VectorLayer<any>[];
|
|
13
|
+
wrapX?: boolean;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 选择变化回调参数
|
|
18
|
+
*/
|
|
19
|
+
interface SelectChangeParams {
|
|
20
|
+
e: any;
|
|
21
|
+
layer: VectorLayer<any> | null;
|
|
22
|
+
selected?: Feature<Geometry>[];
|
|
23
|
+
selectedAllFeatures?: Feature<Geometry>[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 修改结束回调参数
|
|
27
|
+
*/
|
|
28
|
+
interface ModifyEndParams {
|
|
29
|
+
e: any;
|
|
30
|
+
feature: Feature<Geometry> | null;
|
|
31
|
+
layer: VectorLayer<any> | null;
|
|
32
|
+
selected?: Feature<Geometry>[];
|
|
33
|
+
selectedAllFeatures?: Feature<Geometry>[];
|
|
34
|
+
type?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 选择配置选项
|
|
38
|
+
*/
|
|
39
|
+
interface EnableSelectOptions {
|
|
40
|
+
selectChangeHandler?: (params: SelectChangeParams) => void;
|
|
41
|
+
b?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 编辑配置选项
|
|
45
|
+
*/
|
|
46
|
+
interface EnableModifyOptions {
|
|
47
|
+
modifyEndHandler?: (params: ModifyEndParams) => void;
|
|
48
|
+
selectChangeHandler?: (params: SelectChangeParams) => void;
|
|
49
|
+
b?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 历史记录状态
|
|
53
|
+
*/
|
|
54
|
+
interface HistoryState {
|
|
55
|
+
canBackward: boolean;
|
|
56
|
+
canForward: boolean;
|
|
57
|
+
currentStep: number;
|
|
58
|
+
totalSteps: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @description 交互处理器类
|
|
62
|
+
* 提供地图选择、编辑、捕捉等交互功能
|
|
63
|
+
*/
|
|
64
|
+
export default class InteractionHandler {
|
|
65
|
+
private step;
|
|
66
|
+
private historyModifyedGeometry;
|
|
67
|
+
private selectedFeature;
|
|
68
|
+
private snapList;
|
|
69
|
+
private selectable;
|
|
70
|
+
private modifyable;
|
|
71
|
+
private isModifying;
|
|
72
|
+
private map;
|
|
73
|
+
private layers;
|
|
74
|
+
private select;
|
|
75
|
+
private modify;
|
|
76
|
+
selectChangeHandler?: (params: SelectChangeParams) => void;
|
|
77
|
+
modifyEndHandler?: (params: ModifyEndParams) => void;
|
|
78
|
+
selectChangeHandlerRef?: (params: any) => void | null;
|
|
79
|
+
modifyStartHandlerRef?: (params: any) => void | null;
|
|
80
|
+
modifyChangeHandlerRef?: (params: any) => void | null;
|
|
81
|
+
modifyEndHandlerRef?: (params: any) => void | null;
|
|
82
|
+
constructor(map: Map, options?: InteractionHandlerOptions);
|
|
83
|
+
/**
|
|
84
|
+
* 绑定键盘事件(Ctrl+Z撤销,Ctrl+Y重做)
|
|
85
|
+
*/
|
|
86
|
+
private bindKeyboardEvents;
|
|
87
|
+
/**
|
|
88
|
+
* 设置地图实例
|
|
89
|
+
* @param map - 地图实例
|
|
90
|
+
*/
|
|
91
|
+
setMap(map: Map): void;
|
|
92
|
+
/**
|
|
93
|
+
* 设置配置选项
|
|
94
|
+
* @param options - 配置选项
|
|
95
|
+
*/
|
|
96
|
+
setOptions(options?: InteractionHandlerOptions): void;
|
|
97
|
+
selectChange(e: any): void;
|
|
98
|
+
/**
|
|
99
|
+
* 启用选择功能
|
|
100
|
+
* @param options - 选择配置选项
|
|
101
|
+
*/
|
|
102
|
+
enableSelect(options?: EnableSelectOptions): void;
|
|
103
|
+
/**
|
|
104
|
+
* 禁用选择功能
|
|
105
|
+
*/
|
|
106
|
+
disableSelect(): void;
|
|
107
|
+
modifyStart(e: any): void;
|
|
108
|
+
modifyEnd(e: any): void;
|
|
109
|
+
modifyChange(e: any): void;
|
|
110
|
+
/**
|
|
111
|
+
* 启用编辑功能
|
|
112
|
+
* @param options - 编辑配置选项
|
|
113
|
+
*/
|
|
114
|
+
enableModify(options?: EnableModifyOptions): void;
|
|
115
|
+
/**
|
|
116
|
+
* 禁用编辑功能
|
|
117
|
+
*/
|
|
118
|
+
disableModify(): void;
|
|
119
|
+
/**
|
|
120
|
+
* 启用捕捉功能
|
|
121
|
+
* @param b - 是否启用
|
|
122
|
+
*/
|
|
123
|
+
enableSnap(b?: boolean): void;
|
|
124
|
+
/**
|
|
125
|
+
* 销毁选择功能
|
|
126
|
+
*/
|
|
127
|
+
destroySelect(): void;
|
|
128
|
+
/**
|
|
129
|
+
* 销毁编辑功能
|
|
130
|
+
*/
|
|
131
|
+
destroyModify(): void;
|
|
132
|
+
/**
|
|
133
|
+
* 释放所有交互功能
|
|
134
|
+
*/
|
|
135
|
+
release(): void;
|
|
136
|
+
/**
|
|
137
|
+
* 撤销操作
|
|
138
|
+
*/
|
|
139
|
+
backward(): void;
|
|
140
|
+
/**
|
|
141
|
+
* 重做操作
|
|
142
|
+
*/
|
|
143
|
+
forward(): void;
|
|
144
|
+
/**
|
|
145
|
+
* 检查是否可以撤销
|
|
146
|
+
* @returns 是否可以撤销
|
|
147
|
+
*/
|
|
148
|
+
canBackward(): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* 检查是否可以重做
|
|
151
|
+
* @returns 是否可以重做
|
|
152
|
+
*/
|
|
153
|
+
canForward(): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* 获取历史记录状态
|
|
156
|
+
* @returns 历史记录状态对象
|
|
157
|
+
*/
|
|
158
|
+
getHistoryState(): HistoryState;
|
|
159
|
+
/**
|
|
160
|
+
* 清除历史记录
|
|
161
|
+
*/
|
|
162
|
+
clearHistory(): void;
|
|
163
|
+
/**
|
|
164
|
+
* 比较两个几何体是否相等
|
|
165
|
+
* @param geom1 - 第一个几何体
|
|
166
|
+
* @param geom2 - 第二个几何体
|
|
167
|
+
* @returns 是否相等
|
|
168
|
+
*/
|
|
169
|
+
private isGeometryEqual;
|
|
170
|
+
/**
|
|
171
|
+
* 添加捕捉交互
|
|
172
|
+
* @param options - 捕捉配置
|
|
173
|
+
* @returns 捕捉交互实例
|
|
174
|
+
*/
|
|
175
|
+
addSnap(options: {
|
|
176
|
+
source: VectorSource;
|
|
177
|
+
features?: Collection<Feature<Geometry>>;
|
|
178
|
+
map?: Map;
|
|
179
|
+
}): Snap;
|
|
180
|
+
/**
|
|
181
|
+
* 移除捕捉交互
|
|
182
|
+
* @param snap - 捕捉交互实例
|
|
183
|
+
* @param map - 地图实例
|
|
184
|
+
*/
|
|
185
|
+
removeSnap(snap: Snap, map?: Map): void;
|
|
186
|
+
/**
|
|
187
|
+
* 移除所有捕捉交互
|
|
188
|
+
* @param map - 地图实例
|
|
189
|
+
*/
|
|
190
|
+
removeAllSnap(map?: Map): void;
|
|
191
|
+
/**
|
|
192
|
+
* 获取要素所属的图层
|
|
193
|
+
* @param feature - 要素
|
|
194
|
+
* @returns 图层实例或null
|
|
195
|
+
*/
|
|
196
|
+
private getLayerForFeature;
|
|
197
|
+
/**
|
|
198
|
+
* 获取当前选择状态
|
|
199
|
+
* @returns 是否启用选择
|
|
200
|
+
*/
|
|
201
|
+
isSelectable(): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* 获取当前编辑状态
|
|
204
|
+
* @returns 是否启用编辑
|
|
205
|
+
*/
|
|
206
|
+
isModifyable(): boolean;
|
|
207
|
+
/**
|
|
208
|
+
* 获取当前选中的要素
|
|
209
|
+
* @returns 选中的要素或null
|
|
210
|
+
*/
|
|
211
|
+
getSelectedFeature(): Feature<Geometry> | null;
|
|
212
|
+
/**
|
|
213
|
+
* 获取所有选中的要素
|
|
214
|
+
* @returns 选中的要素数组
|
|
215
|
+
*/
|
|
216
|
+
getSelectedFeatures(): Feature<Geometry>[];
|
|
217
|
+
/**
|
|
218
|
+
* 清除所有选中的要素
|
|
219
|
+
*/
|
|
220
|
+
clearSelection(): void;
|
|
221
|
+
/**
|
|
222
|
+
* 获取是否正在编辑
|
|
223
|
+
* @returns 是否正在编辑
|
|
224
|
+
*/
|
|
225
|
+
/**
|
|
226
|
+
* 移除所有交互
|
|
227
|
+
*/
|
|
228
|
+
removeAllInteractions(): void;
|
|
229
|
+
}
|
|
230
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default kriging;
|
|
2
|
+
declare namespace kriging {
|
|
3
|
+
function train(t: any, x: any, y: any, model: any, sigma2: any, alpha: any): {
|
|
4
|
+
t: any;
|
|
5
|
+
x: any;
|
|
6
|
+
y: any;
|
|
7
|
+
nugget: number;
|
|
8
|
+
range: number;
|
|
9
|
+
sill: number;
|
|
10
|
+
A: number;
|
|
11
|
+
n: number;
|
|
12
|
+
};
|
|
13
|
+
function predict(x: any, y: any, variogram: any): any;
|
|
14
|
+
function variance(x: any, y: any, variogram: any): any;
|
|
15
|
+
function grid(polygons: any, variogram: any, width: any): any[];
|
|
16
|
+
function contour(value: any, polygons: any, variogram: any): void;
|
|
17
|
+
function plot(canvas: any, grid: any, xlim: any, ylim: any, colors: any): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import Map from 'ol/Map';
|
|
2
|
+
import Layer from 'ol/layer/Layer';
|
|
3
|
+
import TileLayer from 'ol/layer/Tile';
|
|
4
|
+
import { Geometry } from 'ol/geom';
|
|
5
|
+
import { ImageArcGISRest, TileArcGISRest } from 'ol/source';
|
|
6
|
+
import TileWMS from 'ol/source/TileWMS';
|
|
7
|
+
import ImageWMS from 'ol/source/ImageWMS';
|
|
8
|
+
import XYZ from 'ol/source/XYZ';
|
|
9
|
+
import WMTS from 'ol/source/WMTS';
|
|
10
|
+
import VectorTileLayer from 'ol/layer/VectorTile.js';
|
|
11
|
+
import { Heatmap as HeatmapLayer } from 'ol/layer';
|
|
12
|
+
import { Vector as VectorLayer } from 'ol/layer';
|
|
13
|
+
import { Image as ImageLayer } from 'ol/layer';
|
|
14
|
+
import Overlay from 'ol/Overlay';
|
|
15
|
+
import Feature from 'ol/Feature';
|
|
16
|
+
import WebGLTileLayer from 'ol/layer/WebGLTile.js';
|
|
17
|
+
import { Style } from 'ol/style';
|
|
18
|
+
import { StyleOptions } from './StyleHandler';
|
|
19
|
+
import BaseLayer from 'ol/layer/Base.js';
|
|
20
|
+
import { StyleFunction, StyleLike } from 'ol/style/Style.js';
|
|
21
|
+
interface LayerOptions {
|
|
22
|
+
id?: string;
|
|
23
|
+
url?: string;
|
|
24
|
+
prj?: string;
|
|
25
|
+
visible?: boolean;
|
|
26
|
+
opacity?: number;
|
|
27
|
+
zIndex?: number;
|
|
28
|
+
}
|
|
29
|
+
interface SuperMapStyleOptions extends LayerOptions {
|
|
30
|
+
styleloaded?: (style: Style) => void;
|
|
31
|
+
}
|
|
32
|
+
interface SuperMapRestOptions extends LayerOptions {
|
|
33
|
+
requestParams?: Record<string, any>;
|
|
34
|
+
}
|
|
35
|
+
interface MapboxVtOptions extends LayerOptions {
|
|
36
|
+
layerStyle?: Function;
|
|
37
|
+
}
|
|
38
|
+
type CustomrLayerStyle = {
|
|
39
|
+
circle?: object;
|
|
40
|
+
icon?: object;
|
|
41
|
+
stroke?: object;
|
|
42
|
+
fill?: object;
|
|
43
|
+
text?: object;
|
|
44
|
+
} | Function;
|
|
45
|
+
interface ICustomLayerFeatures extends Array<ICustomLayerFeaturesItem> {
|
|
46
|
+
}
|
|
47
|
+
interface ICustomLayerFeaturesItem {
|
|
48
|
+
id?: string;
|
|
49
|
+
properties?: object;
|
|
50
|
+
wktstr?: string;
|
|
51
|
+
style?: CustomrLayerStyle;
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
}
|
|
54
|
+
interface CustomrLayerOptions extends LayerOptions {
|
|
55
|
+
layerId?: string;
|
|
56
|
+
features?: ICustomLayerFeatures | [] | any;
|
|
57
|
+
style?: StyleOptions;
|
|
58
|
+
visible?: boolean;
|
|
59
|
+
opacity?: number;
|
|
60
|
+
zIndex?: number;
|
|
61
|
+
map?: Map;
|
|
62
|
+
clear?: boolean;
|
|
63
|
+
multiple?: boolean;
|
|
64
|
+
cluster?: boolean;
|
|
65
|
+
geomField?: string;
|
|
66
|
+
zoomToLayer?: boolean;
|
|
67
|
+
point?: any;
|
|
68
|
+
line?: any;
|
|
69
|
+
polygon?: any;
|
|
70
|
+
url?: string;
|
|
71
|
+
clusterOptions?: object;
|
|
72
|
+
simplify?: boolean;
|
|
73
|
+
simplifyOptions?: object;
|
|
74
|
+
text?: any;
|
|
75
|
+
points?: any[];
|
|
76
|
+
}
|
|
77
|
+
interface VectorLayerOptions {
|
|
78
|
+
id?: string;
|
|
79
|
+
style?: Style | StyleFunction | StyleLike | Style[];
|
|
80
|
+
visible?: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface RingLayerOptions {
|
|
83
|
+
id?: string;
|
|
84
|
+
style?: Style | StyleFunction | StyleLike | Style[];
|
|
85
|
+
center?: any[];
|
|
86
|
+
outerR?: number;
|
|
87
|
+
innerR?: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @description 图层处理工具类
|
|
91
|
+
* 提供图层的创建、添加、移除等操作
|
|
92
|
+
*/
|
|
93
|
+
export default class LayerHandler {
|
|
94
|
+
map: Map;
|
|
95
|
+
/** @type {string} 投影坐标系 */
|
|
96
|
+
prj: string;
|
|
97
|
+
/** @type {boolean} 是否为WGS84坐标系 */
|
|
98
|
+
isWgs84: boolean;
|
|
99
|
+
/** @type {boolean} 是否为WebMercator坐标系 */
|
|
100
|
+
isWebmocat: boolean;
|
|
101
|
+
/** @type {Style} 默认样式对象 */
|
|
102
|
+
defaultStyle: Style;
|
|
103
|
+
/** @type {string} 默认矢量图层ID前缀 */
|
|
104
|
+
defaultVectorLayerId: string;
|
|
105
|
+
/**
|
|
106
|
+
* 构造函数
|
|
107
|
+
* @param {Map} map - OpenLayers地图实例
|
|
108
|
+
* @param {string} prj - 投影坐标系
|
|
109
|
+
*/
|
|
110
|
+
constructor(map: any, prj?: string);
|
|
111
|
+
setMap(map: any): void;
|
|
112
|
+
/**
|
|
113
|
+
* 获取自定义瓦片网格对象
|
|
114
|
+
* @param {*} params 传入参数
|
|
115
|
+
* @param {*} localParams 本地参数
|
|
116
|
+
* @returns {TileGrid} 自定义瓦片网格对象
|
|
117
|
+
*/
|
|
118
|
+
getCustomTileGrid(params: any, localParams: any): {
|
|
119
|
+
resolutions: any;
|
|
120
|
+
origin: any;
|
|
121
|
+
matrixIds: any;
|
|
122
|
+
};
|
|
123
|
+
getWmtsUrl({ url, customParams, }: {
|
|
124
|
+
url: string;
|
|
125
|
+
customParams?: Record<string, any>;
|
|
126
|
+
}): string;
|
|
127
|
+
/**
|
|
128
|
+
* 根据投影坐标系创建WMTS图层
|
|
129
|
+
* @param {string} prj - 投影坐标系
|
|
130
|
+
* @param {Object} options.url - WMTS服务URL
|
|
131
|
+
* @param {Object} options.params - WMTS参数对象
|
|
132
|
+
* @param {Object} options.params.layer - WMTS图层ID
|
|
133
|
+
* @param {Object} options.params.matrixSet - WMTS矩阵集ID
|
|
134
|
+
* @param {Object} options.params.matrixSetPrefix - WMTS矩阵集ID前缀
|
|
135
|
+
* @returns {TileLayer} WMTS图层实例
|
|
136
|
+
*/
|
|
137
|
+
getWmtsByPrj({ prj, options }: {
|
|
138
|
+
prj: any;
|
|
139
|
+
options: any;
|
|
140
|
+
}): TileLayer<WMTS>;
|
|
141
|
+
getWmtsExtent(extent: any): any;
|
|
142
|
+
/**
|
|
143
|
+
* xml
|
|
144
|
+
* @param {*} param0
|
|
145
|
+
* @returns
|
|
146
|
+
*/
|
|
147
|
+
getWmtsByCapabilities(options: any): TileLayer<WMTS>;
|
|
148
|
+
getWmtsGeoserver({ prj, options }: {
|
|
149
|
+
prj?: string;
|
|
150
|
+
options: any;
|
|
151
|
+
}): TileLayer<WMTS>;
|
|
152
|
+
getXYZ(options: any): TileLayer<XYZ>;
|
|
153
|
+
getXYZByPrj({ prj, options }: {
|
|
154
|
+
prj: any;
|
|
155
|
+
options?: {};
|
|
156
|
+
}): TileLayer<XYZ>;
|
|
157
|
+
getTdtByPrj({ prj, options }: {
|
|
158
|
+
prj: any;
|
|
159
|
+
options: any;
|
|
160
|
+
}): TileLayer<XYZ>;
|
|
161
|
+
getTmsLayer(options: any): TileLayer<XYZ>;
|
|
162
|
+
getWmsImage(options: any): ImageLayer<ImageWMS>;
|
|
163
|
+
getWmsImageTile(options: any): TileLayer<TileWMS>;
|
|
164
|
+
getArcgisImage(options: any): ImageLayer<ImageArcGISRest>;
|
|
165
|
+
getArcgisImageTile(options: any): TileLayer<TileArcGISRest>;
|
|
166
|
+
getUserDefinedXYZ(options: any): TileLayer<XYZ>;
|
|
167
|
+
getGeojsonLayer({ id, visible, geojson }: {
|
|
168
|
+
id: any;
|
|
169
|
+
visible?: boolean;
|
|
170
|
+
geojson: any;
|
|
171
|
+
}): VectorLayer<Feature<Geometry>>;
|
|
172
|
+
getWktLayer({ id, visible, wkt }: {
|
|
173
|
+
id: any;
|
|
174
|
+
visible?: boolean;
|
|
175
|
+
wkt: any;
|
|
176
|
+
}): VectorLayer<Feature<Geometry>>;
|
|
177
|
+
getGaodeLayer(options: any): TileLayer<XYZ>;
|
|
178
|
+
getUrl(type: number, x: any, y: any, z: any): string;
|
|
179
|
+
getBaiduLayer(options: any): any;
|
|
180
|
+
getGeojsonLayerWithRender(options: any): VectorLayer<Feature<Geometry>>;
|
|
181
|
+
getHeatMapLayer(geojson: any, options: any): HeatmapLayer<Feature<Geometry>>;
|
|
182
|
+
getOverlayLayer(container: any, { autoPan, className, positioning, }?: {
|
|
183
|
+
autoPan?: boolean;
|
|
184
|
+
className?: string;
|
|
185
|
+
positioning?: string;
|
|
186
|
+
}): Overlay;
|
|
187
|
+
/**
|
|
188
|
+
* 获取矢量图层
|
|
189
|
+
* @param param0 layerId,style
|
|
190
|
+
* @returns vector layer
|
|
191
|
+
*/
|
|
192
|
+
/**
|
|
193
|
+
* 创建矢量图层
|
|
194
|
+
* @param options
|
|
195
|
+
* @param {*} options.id
|
|
196
|
+
* @param {*} options.style
|
|
197
|
+
* @returns vector layer
|
|
198
|
+
*/
|
|
199
|
+
getVectorLayer(options?: VectorLayerOptions, clusterOptions?: {}): VectorLayer<Feature<Geometry>>;
|
|
200
|
+
/**
|
|
201
|
+
* ring
|
|
202
|
+
* @param {*} options
|
|
203
|
+
* @param {*} options.center
|
|
204
|
+
* @param {*} options.outerR
|
|
205
|
+
* @param {*} options.innerR
|
|
206
|
+
* @returns ring layer
|
|
207
|
+
*/
|
|
208
|
+
createRingLayer(options: RingLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
209
|
+
createPoints(options: CustomrLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
210
|
+
createLines(options: CustomrLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
211
|
+
createMultiLines(options: CustomrLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
212
|
+
createPolygons(options: CustomrLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
213
|
+
createMultiPolygons(options: CustomrLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
214
|
+
createLabels(options: CustomrLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
215
|
+
/**
|
|
216
|
+
* 创建矢量点-单个要素
|
|
217
|
+
* @param options 图层配置选项
|
|
218
|
+
* @param {*} options.layerId 图层id
|
|
219
|
+
* @param {*} options.features 要素集合
|
|
220
|
+
* @param {*} options.zIndex 图层zIndex
|
|
221
|
+
* @param {*} options.style 图层样式
|
|
222
|
+
* @param {*} options.map 地图实例
|
|
223
|
+
* @param {*} options.clear 是否清空图层
|
|
224
|
+
* @param {*} options.point 点要素
|
|
225
|
+
* @returns 矢量图层
|
|
226
|
+
*/
|
|
227
|
+
createPoint(options: CustomrLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
228
|
+
/**
|
|
229
|
+
* 创建矢量图层并添加到地图
|
|
230
|
+
* @param options 图层配置选项
|
|
231
|
+
* @param {*} options.layerId 图层id
|
|
232
|
+
* @param {*} options.features 要素集合
|
|
233
|
+
* @param {*} options.zIndex 图层zIndex
|
|
234
|
+
* @param {*} options.style 图层样式
|
|
235
|
+
* @param {*} options.map 地图实例
|
|
236
|
+
* @param {*} options.clear 是否清空图层
|
|
237
|
+
* @param {*} options.multiple 是否多要素
|
|
238
|
+
* @param {*} options.cluster 是否聚类
|
|
239
|
+
* @param {*} options.geomField 几何字段 默认wktstr
|
|
240
|
+
* @param {*} options.zoomToLayer 是否缩放到图层
|
|
241
|
+
* @returns 矢量图层
|
|
242
|
+
*/
|
|
243
|
+
createCustomLayer(options: CustomrLayerOptions): VectorLayer<Feature<Geometry>>;
|
|
244
|
+
getLayerCount(): number;
|
|
245
|
+
getClusterLayer(data: any, { id, visible, distance, minDistance, style, zIndex, geomField, clear, map, simplify, simplifyOptions, }?: {
|
|
246
|
+
id?: string;
|
|
247
|
+
visible?: boolean;
|
|
248
|
+
distance?: number;
|
|
249
|
+
minDistance?: number;
|
|
250
|
+
style?: {};
|
|
251
|
+
zIndex?: number;
|
|
252
|
+
geomField?: string;
|
|
253
|
+
clear?: boolean;
|
|
254
|
+
map?: Map;
|
|
255
|
+
simplify?: boolean;
|
|
256
|
+
simplifyOptions?: {};
|
|
257
|
+
}): VectorLayer<Feature<Geometry>>;
|
|
258
|
+
/**
|
|
259
|
+
* 坐标系转换
|
|
260
|
+
* @param {*} features
|
|
261
|
+
*/
|
|
262
|
+
trasnformPrj(features: any): void;
|
|
263
|
+
/**
|
|
264
|
+
* 纯道格拉斯-普克抽稀算法(内部使用,不包含范围筛选)
|
|
265
|
+
* @param {Array} points - 点集,每个点为 [x, y] 格式的数组
|
|
266
|
+
* @param {number} threshold - 抽稀阈值
|
|
267
|
+
* @returns {Array} 抽稀后的点集
|
|
268
|
+
*/
|
|
269
|
+
douglasPeuckerSimplify2(points: any, threshold: any): any;
|
|
270
|
+
/**
|
|
271
|
+
* 纯道格拉斯-普克抽稀算法(内部使用,支持对象数组格式)
|
|
272
|
+
* @param {Array} points - 点集,每个点为对象格式
|
|
273
|
+
* @param {number} threshold - 抽稀阈值
|
|
274
|
+
* @param {Object} options - 配置选项
|
|
275
|
+
* @param {string} options.longitudeKey - 经度属性名
|
|
276
|
+
* @param {string} options.latitudeKey - 纬度属性名
|
|
277
|
+
* @returns {Array} 抽稀后的点集
|
|
278
|
+
*/
|
|
279
|
+
douglasPeuckerSimplify(points: any, threshold: any, options?: {}): any;
|
|
280
|
+
getMvtOfficial(options: any): VectorTileLayer<import("ol/render/Feature").default>;
|
|
281
|
+
getMatrixIds(matrixIds: any, prj: any): any[];
|
|
282
|
+
getMvt(options: any): VectorTileLayer<any>;
|
|
283
|
+
getMvtGeography(options: any): VectorTileLayer<import("ol/render/Feature").default>;
|
|
284
|
+
/**
|
|
285
|
+
* 获取Mapbox矢量瓦片图层
|
|
286
|
+
* @param options Mapbox矢量瓦片图层选项
|
|
287
|
+
* @param options.layerStyle 图层样式,支持函数或对象
|
|
288
|
+
* @returns Mapbox矢量瓦片图层
|
|
289
|
+
*/
|
|
290
|
+
getMapboxVt(options: MapboxVtOptions): VectorTileLayer<any>;
|
|
291
|
+
getSupermapUrl({ url, requestParams }: {
|
|
292
|
+
url: any;
|
|
293
|
+
requestParams: any;
|
|
294
|
+
}): any;
|
|
295
|
+
/**
|
|
296
|
+
* 获取supermap wmts图层
|
|
297
|
+
* @param options
|
|
298
|
+
* @param options.origin 原点
|
|
299
|
+
* @param options.resolutions 分辨率
|
|
300
|
+
* @param options.matrixIds 矩阵id
|
|
301
|
+
* @returns supermap wmts图层
|
|
302
|
+
*/
|
|
303
|
+
getSuperMapWmts(options: any): TileLayer<XYZ>;
|
|
304
|
+
/**
|
|
305
|
+
* 获取supermap rest图层
|
|
306
|
+
* @param options
|
|
307
|
+
* @param options.url 图层url
|
|
308
|
+
* @param options.requestParams 请求参数
|
|
309
|
+
* @returns supermap rest图层
|
|
310
|
+
*/
|
|
311
|
+
getSuperMapRest(options: SuperMapRestOptions): TileLayer<any>;
|
|
312
|
+
/**
|
|
313
|
+
* 获取supermap XYZ图层
|
|
314
|
+
* @param options
|
|
315
|
+
* @param options.id 图层id
|
|
316
|
+
* @param options.url 图层url
|
|
317
|
+
* @param options.opacity 透明度
|
|
318
|
+
* @param options.visible 是否可见
|
|
319
|
+
* @returns 获取supermap XYZ
|
|
320
|
+
*/
|
|
321
|
+
getSuperMapXYZ(options: any): TileLayer<XYZ>;
|
|
322
|
+
/**
|
|
323
|
+
* 获取supermap style图层
|
|
324
|
+
* @param options
|
|
325
|
+
* @param options.url style url
|
|
326
|
+
* @param options.prj 投影坐标系
|
|
327
|
+
* @param options.styleloaded 样式加载完成回调
|
|
328
|
+
* @returns 矢量图层
|
|
329
|
+
*/
|
|
330
|
+
getSuperMapStyle(options: SuperMapStyleOptions): any;
|
|
331
|
+
/**
|
|
332
|
+
* 获取tif图层
|
|
333
|
+
* @param blob 图if blob
|
|
334
|
+
* @param options 图层选项
|
|
335
|
+
* @returns tif图层
|
|
336
|
+
*/
|
|
337
|
+
getTifLayerBlob(blob: any, options: any): WebGLTileLayer;
|
|
338
|
+
/**
|
|
339
|
+
* 获取tif图层
|
|
340
|
+
* @param url 图层url
|
|
341
|
+
* @param options 图层选项
|
|
342
|
+
* @returns tif图层
|
|
343
|
+
*/
|
|
344
|
+
getTifLayer(url: any, options: any): WebGLTileLayer;
|
|
345
|
+
/**
|
|
346
|
+
* 通过id删除图层
|
|
347
|
+
* @param id 图层id
|
|
348
|
+
* @param map 地图实例
|
|
349
|
+
* @param strict 是否严格匹配,默认true
|
|
350
|
+
*/
|
|
351
|
+
removeLayerById(id: any, map?: Map, strict?: boolean): void;
|
|
352
|
+
/**
|
|
353
|
+
* 通过id获取图层
|
|
354
|
+
* @param id 图层id
|
|
355
|
+
* @param map 地图实例
|
|
356
|
+
* @returns 图层实例
|
|
357
|
+
*/
|
|
358
|
+
getLayerById(id: any, map?: Map): VectorLayer<Feature> | Layer | BaseLayer | null;
|
|
359
|
+
/**
|
|
360
|
+
* 通过id设置图层可见性
|
|
361
|
+
* @param id 图层id
|
|
362
|
+
* @param visible 是否可见
|
|
363
|
+
* @param map 地图实例
|
|
364
|
+
*/
|
|
365
|
+
setLayerVisibleById(id: any, visible: any, map?: Map): void;
|
|
366
|
+
/**
|
|
367
|
+
* 通过id设置图层透明度
|
|
368
|
+
* @param id 图层id
|
|
369
|
+
* @param opacity 透明度
|
|
370
|
+
* @param map 地图实例
|
|
371
|
+
*/
|
|
372
|
+
setLayerOpacityById(id: any, opacity: any, map?: Map): void;
|
|
373
|
+
/**
|
|
374
|
+
* 检查图层是否存在
|
|
375
|
+
* @param id 图层id
|
|
376
|
+
* @param map 地图实例
|
|
377
|
+
* @returns 是否存在
|
|
378
|
+
*/
|
|
379
|
+
checkLayerIsExist(id: any, map?: Map): boolean;
|
|
380
|
+
/**
|
|
381
|
+
* 删除所有图层
|
|
382
|
+
* @param map 地图实例
|
|
383
|
+
*/
|
|
384
|
+
removeAllLayer(map?: Map): void;
|
|
385
|
+
}
|
|
386
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Map from "ol/Map";
|
|
2
|
+
/**
|
|
3
|
+
* @description 测量工具类
|
|
4
|
+
* 提供测量线、测量面、清除结果等功能
|
|
5
|
+
*/
|
|
6
|
+
export default class MeasureHandler {
|
|
7
|
+
private map;
|
|
8
|
+
private measurementManager;
|
|
9
|
+
constructor(map: Map);
|
|
10
|
+
measureLength(map?: Map, clearLast?: boolean): void;
|
|
11
|
+
measureArea(map?: Map, clearLast?: boolean): void;
|
|
12
|
+
clearResult(map?: Map): void;
|
|
13
|
+
endDraw(map?: Map): void;
|
|
14
|
+
}
|
|
15
|
+
export declare function setMap(map: Map, cmap: Map): void;
|
|
16
|
+
/**
|
|
17
|
+
* 测量线
|
|
18
|
+
* @param map 地图实例
|
|
19
|
+
* @param clearLast 是否立即清除结果
|
|
20
|
+
*/
|
|
21
|
+
export declare function measureLength(map?: Map, clearLast?: boolean): void;
|
|
22
|
+
/**
|
|
23
|
+
* 测量面
|
|
24
|
+
* @param map 地图实例
|
|
25
|
+
* @param clearLast 是否立即清除结果
|
|
26
|
+
*/
|
|
27
|
+
export declare function measureArea(map?: Map, clearLast?: boolean): void;
|
|
28
|
+
/**
|
|
29
|
+
* 清除结果
|
|
30
|
+
* @param map 地图实例
|
|
31
|
+
*/
|
|
32
|
+
export declare function clearResult(map?: Map): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 等比例抽稀函数(均匀间隔抽稀)
|
|
3
|
+
* @param {Array} points - 原始点集(对象数组格式)
|
|
4
|
+
* @param {number} keepRatio - 保留比例,0-1之间,如0.3表示保留30%的点
|
|
5
|
+
* @returns {Array} 等比例抽稀后的点集
|
|
6
|
+
*/
|
|
7
|
+
export declare function proportionalSimplify(points: any, keepRatio: any): any;
|
|
8
|
+
/**
|
|
9
|
+
* 固定间隔抽稀函数(每N个点保留1个)
|
|
10
|
+
* @param {Array} points - 原始点集(对象数组格式)
|
|
11
|
+
* @param {number} interval - 间隔,如3表示每3个点保留1个
|
|
12
|
+
* @returns {Array} 固定间隔抽稀后的点集
|
|
13
|
+
*/
|
|
14
|
+
export declare function intervalSimplify(points: any, interval: any): any;
|
|
15
|
+
/**
|
|
16
|
+
* 基于网格的抽稀函数(每个网格保留一个点)
|
|
17
|
+
* @param {Array} points - 原始点集(对象数组格式)
|
|
18
|
+
* @param {number} gridSize - 网格大小
|
|
19
|
+
* @param {Object} options - 配置选项
|
|
20
|
+
* @returns {Array} 网格抽稀后的点集
|
|
21
|
+
*/
|
|
22
|
+
export declare function gridSimplify(points: any, gridSize: any, options?: {
|
|
23
|
+
longitudeKey: string;
|
|
24
|
+
latitudeKey: string;
|
|
25
|
+
method: string;
|
|
26
|
+
}): any;
|