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.
Files changed (44) hide show
  1. package/package/v-map/global.d.ts +208 -0
  2. package/package/v-map/ol/config.d.ts +5 -0
  3. package/package/v-map/ol/lib/business/OlHandler.d.ts +49 -0
  4. package/package/v-map/ol/lib/config/mapConfig-4326.d.ts +36 -0
  5. package/package/v-map/ol/lib/core/VMap.d.ts +556 -0
  6. package/package/v-map/ol/lib/core/plugins/DrawConditions.d.ts +64 -0
  7. package/package/v-map/ol/lib/core/plugins/DrawHandler.d.ts +306 -0
  8. package/package/v-map/ol/lib/core/plugins/FeatureHandler.d.ts +117 -0
  9. package/package/v-map/ol/lib/core/plugins/GeojsonHandler.d.ts +76 -0
  10. package/package/v-map/ol/lib/core/plugins/GeometryHandler.d.ts +117 -0
  11. package/package/v-map/ol/lib/core/plugins/InteractionHandler.d.ts +230 -0
  12. package/package/v-map/ol/lib/core/plugins/KrigingHandler.d.ts +18 -0
  13. package/package/v-map/ol/lib/core/plugins/LayerHandler.d.ts +386 -0
  14. package/package/v-map/ol/lib/core/plugins/MeasureHandler.d.ts +32 -0
  15. package/package/v-map/ol/lib/core/plugins/Simplify.d.ts +26 -0
  16. package/package/v-map/ol/lib/core/plugins/StyleHandler.d.ts +72 -0
  17. package/package/v-map/ol/lib/core/plugins/TransformHandler.d.ts +35 -0
  18. package/package/v-map/ol/lib/core/plugins/WMTSExplorer.d.ts +108 -0
  19. package/package/v-map/ol/lib/core/plugins/WfsHandler.d.ts +66 -0
  20. package/package/v-map/ol/lib/core/plugins/WktHandler.d.ts +62 -0
  21. package/package/v-map/ol/lib/core/plugins/WmsHandler.d.ts +32 -0
  22. package/package/v-map/ol/lib/core/plugins/baidu/BaiduMap.d.ts +3 -0
  23. package/package/v-map/ol/lib/core/plugins/baidu/bd09.d.ts +2 -0
  24. package/package/v-map/ol/lib/core/plugins/mapbox-streets-v6-style.d.ts +1 -0
  25. package/package/v-map/ol/types/types.d.ts +84 -0
  26. package/package/v-map/public/utils/advanced/GradientColor.d.ts +27 -0
  27. package/package/v-map/public/utils/base/color.d.ts +17 -0
  28. package/package/v-map/public/utils/base/common.d.ts +126 -0
  29. package/package/v-map/public/utils/base/date.d.ts +52 -0
  30. package/package/v-map/public/utils/base/index.d.ts +340 -0
  31. package/package/v-map/public/utils/base/number.d.ts +21 -0
  32. package/package/v-map/public/utils/base/string.d.ts +16 -0
  33. package/package/v-map/public/utils/base/transform.d.ts +12 -0
  34. package/package/v-map/public/utils/base/type.d.ts +88 -0
  35. package/package/v-map/public/utils/base/utils.d.ts +155 -0
  36. package/package/v-map/public/utils/base/validate.d.ts +54 -0
  37. package/package/v-map/public/utils/map/index.d.ts +15 -0
  38. package/package/v-map/public/utils/map/ol.d.ts +7 -0
  39. package/package/v-map/public/utils/map/transform.d.ts +1 -0
  40. package/package/v-map/public/utils/map/turf.d.ts +1 -0
  41. package/package/v-openlayers.css +1 -1
  42. package/package/v-openlayers.d.ts +35 -9578
  43. package/package/v-openlayers.mjs +31034 -82215
  44. package/package.json +3 -2
@@ -0,0 +1,556 @@
1
+ import 'ol/ol.css';
2
+ import Map from 'ol/Map';
3
+ import VectorLayer from 'ol/layer/Vector.js';
4
+ import Feature from 'ol/Feature';
5
+ import { Geometry, LineString, Polygon } from 'ol/geom';
6
+ import { Style } from 'ol/style';
7
+ import { GeoJSON } from 'ol/format.js';
8
+ import { Extent } from 'ol/extent';
9
+ import LayerHandler from './plugins/LayerHandler';
10
+ import DrawHandler from './plugins/DrawHandler';
11
+ import DrawConditions from './plugins/DrawConditions';
12
+ import WktHandler from './plugins/WktHandler';
13
+ import GeojsonHandler from './plugins/GeojsonHandler';
14
+ import MeasureHandler from './plugins/MeasureHandler';
15
+ import WfsHandler from './plugins/WfsHandler';
16
+ import InteractionHandler from './plugins/InteractionHandler';
17
+ import WmsHandler from './plugins/WmsHandler';
18
+ import GeometryHandler from './plugins/GeometryHandler';
19
+ import * as TransHandler from './plugins/TransformHandler';
20
+ import * as StyleHandler from './plugins/StyleHandler';
21
+ import { StyleOptions } from './plugins/StyleHandler';
22
+ import { StyleLike } from 'ol/style/Style.js';
23
+ import { IMapConfig } from '../../types/types';
24
+ interface MapOptions {
25
+ controls?: {
26
+ scaleLine?: boolean;
27
+ [key: string]: any;
28
+ };
29
+ showBasemap?: boolean;
30
+ dragging?: boolean;
31
+ interactions?: any;
32
+ }
33
+ interface ZoomOptions {
34
+ duration?: number;
35
+ minResolution?: number;
36
+ maxZoom?: number;
37
+ }
38
+ interface IOverlayOptions {
39
+ popupId?: string;
40
+ center?: [number, number];
41
+ html?: string;
42
+ offset?: [number, number];
43
+ collection?: boolean;
44
+ options?: any;
45
+ }
46
+ declare class VMap {
47
+ /**
48
+ * @description: 地图实例
49
+ */
50
+ map: Map | null;
51
+ /**
52
+ * @description: 地图容器ID
53
+ */
54
+ target: string;
55
+ /**
56
+ * @description: 默认样式
57
+ */
58
+ defaultStyle: Style;
59
+ /**
60
+ * @description: 投影坐标系
61
+ */
62
+ prj: string;
63
+ /**
64
+ * @description: 地图配置
65
+ */
66
+ mapConfig: IMapConfig | null;
67
+ /**
68
+ * @description: 地图初始化范围
69
+ */
70
+ mapInitExtent: any;
71
+ /**
72
+ * @description: 地图事件处理器
73
+ */
74
+ mouseMoveHandle: ((e: any) => void) | null;
75
+ mouseClickHandle: ((e: any) => void) | null;
76
+ mouseDbClickHandle: ((e: any) => void) | null;
77
+ mouseMoveEndHandle: ((e: any) => void) | null;
78
+ /**
79
+ * @description: 鼠标状态键
80
+ */
81
+ mouseStatusKey: string;
82
+ /**
83
+ * @description: 覆盖物
84
+ */
85
+ overlay: any;
86
+ /**
87
+ * @description: 弹窗覆盖物集合
88
+ */
89
+ popupOverlayCollection: any[];
90
+ /**
91
+ * @description: 底图集合
92
+ */
93
+ baseLayerCollection: {
94
+ [key: string]: any;
95
+ };
96
+ /**
97
+ * @description: Cesium同步状态
98
+ */
99
+ isSyncing: import("vue").Ref<boolean, boolean>;
100
+ cesiumViewer: any;
101
+ /**
102
+ * @description: 高亮图层
103
+ */
104
+ highlightLayer: any;
105
+ /**
106
+ * @description: 图层索引计数器
107
+ */
108
+ layerIndex: number;
109
+ /**
110
+ * @description: 拖拽缩放交互实例
111
+ */
112
+ dragZoomIns: any;
113
+ drawHandler: DrawHandler | null;
114
+ drawConditions: DrawConditions | null;
115
+ measureHandler: MeasureHandler | null;
116
+ wktHandler: WktHandler | null;
117
+ geojsonHandler: GeojsonHandler | null;
118
+ wfsHandler: WfsHandler | null;
119
+ wmsHandler: WmsHandler | null;
120
+ interactionHandler: InteractionHandler | null;
121
+ layerHandler: LayerHandler | null;
122
+ geometryHandler: GeometryHandler | null;
123
+ TransHandler: typeof TransHandler;
124
+ StyleHandler: typeof StyleHandler;
125
+ kriging: {
126
+ train(t: any, x: any, y: any, model: any, sigma2: any, alpha: any): {
127
+ t: any;
128
+ x: any;
129
+ y: any;
130
+ nugget: number;
131
+ range: number;
132
+ sill: number;
133
+ A: number;
134
+ n: number;
135
+ };
136
+ predict(x: any, y: any, variogram: any): any;
137
+ variance(x: any, y: any, variogram: any): any;
138
+ grid(polygons: any, variogram: any, width: any): any[];
139
+ contour(value: any, polygons: any, variogram: any): void;
140
+ plot(canvas: any, grid: any, xlim: any, ylim: any, colors: any): void;
141
+ };
142
+ constructor(target?: string);
143
+ /**
144
+ * @description: 获取类标识
145
+ * 静态方法 类名.function
146
+ */
147
+ static whoami(): string;
148
+ /**
149
+ * @description: 设置cesium viewer
150
+ */
151
+ setCesiumViewer(viewer: any): void;
152
+ /**
153
+ * @description: 注册投影坐标系
154
+ */
155
+ registerProj(): void;
156
+ /**
157
+ * @description: 安装插件
158
+ */
159
+ installPlugin(plugin: any): void;
160
+ /**
161
+ * 初始化OSM地图
162
+ */
163
+ initMapOSM(): void;
164
+ /**
165
+ * @description: 初始化地图
166
+ * @param {*} mapConfig 地图配置
167
+ * @param {*} options 地图选项
168
+ * @return {*} Promise 地图实例
169
+ */
170
+ initMap(mapConfig: IMapConfig, options?: MapOptions): Promise<unknown>;
171
+ /**
172
+ * @description: 自定义创建地图
173
+ * @param {*} options 地图选项
174
+ * @param {*} options.target 地图容器id
175
+ * @param {*} options.view 地图视图
176
+ * @param {*} options.baseLayers 底图集合
177
+ * @param {*} options.controls 地图控件
178
+ * @param {*} options.callback 地图初始化回调
179
+ * @return {*} Promise 地图实例
180
+ */
181
+ initCustomMap({ target, view, baseLayers, controls, callback, }: {
182
+ target?: string;
183
+ view?: {
184
+ projection: string;
185
+ center: number[];
186
+ zoom: number;
187
+ minZoom: number;
188
+ maxZoom: number;
189
+ };
190
+ baseLayers?: any[];
191
+ controls?: {};
192
+ callback: any;
193
+ }): void;
194
+ /**
195
+ * 初始化事件
196
+ */
197
+ initEvent(): void;
198
+ registerMouseClick(callback: any): void;
199
+ releaseMouseClick(): void;
200
+ registerMouseDbClick(callback: any): void;
201
+ releaseMouseDbClick(): void;
202
+ registerMouseMove(callback: any): void;
203
+ relaeseMouseMove(): void;
204
+ registerMouseMoveEnd(callback: any): void;
205
+ relaeseMouseMoveEnd(): void;
206
+ /**
207
+ * 自定义add overlay
208
+ * @param {*} container 容器id
209
+ * @param {*} options 可选参数
210
+ * @returns overlay
211
+ */
212
+ addOverlay(container: any, options: any): import("ol").Overlay;
213
+ /**
214
+ * 自定义创建overlay
215
+ * @param {*} param0
216
+ * @returns overlay
217
+ */
218
+ createOverlay(_options: IOverlayOptions): import("ol").Overlay;
219
+ /**
220
+ * 删除所有overlay
221
+ */
222
+ removeAllOverlay(): void;
223
+ /**
224
+ * 加载图层
225
+ * @param {*} options 图层信息 {id,visible,type = V_MAP_PROVIDER}
226
+ * @param {*} prj 坐标系
227
+ */
228
+ addLayerByType(options: any, prj?: string): any;
229
+ getBaseLayer(group: any): any[];
230
+ resetBaseLayer(): void;
231
+ checkLayer(): boolean;
232
+ /**
233
+ * 根据服务类型加加载图层
234
+ * @param options 图层信息 {id,visible,type = V_MAP_PROVIDER}
235
+ * @param options.type 图层类型
236
+ * @param options.styleUrl 图层样式
237
+ * @param options.id 图层id
238
+ * @param options.visible 图层可见性
239
+ * @param options.opacity 图层透明度
240
+ * @param options.zIndex 图层z索引
241
+ * @param options.minZoom 图层最小缩放级别
242
+ * @param options.maxZoom 图层最大缩放级别
243
+ * @param prj 坐标系
244
+ * @returns 图层
245
+ */
246
+ getLayerByType(options: any, prj?: string): any;
247
+ parseLayer(): void;
248
+ testURL(url: any): Promise<boolean>;
249
+ parseLayerOptions(o: any): void;
250
+ addSuperMapLayer(options: any): void;
251
+ addSuperMapXYZ(options: any): void;
252
+ addTdtLayer(options: any): void;
253
+ /**
254
+ * 加载geoserver wmts
255
+ * @param {*} options {id,type,visible}
256
+ */
257
+ addGeoserverWmts(options: any): void;
258
+ addWmsLayer(options: any): void;
259
+ addWmsImageLayer(options: any): void;
260
+ addArcgisTileLayer(options: any): void;
261
+ addArcgisImageLayer(options: any): void;
262
+ addArcgisWmtsLayer(options: any): void;
263
+ addHeatMapLayer(geojson: any, options: any): void;
264
+ addClusterLayer(geojson: any, options: any): void;
265
+ /**
266
+ * XYZ类型切片服务
267
+ * @param {*} layerOption
268
+ */
269
+ addXYZLayer(options: any): void;
270
+ /**
271
+ * geojson layer
272
+ * @param {*} options
273
+ */
274
+ addGeojsonLayer(options: any): void;
275
+ /**
276
+ * 检查图层是否存在
277
+ * @param {*} id 图层id
278
+ * @returns 是否存在
279
+ */
280
+ checkLayerIsExist(id: any): boolean;
281
+ /**
282
+ * 通过id获取图层
283
+ * @param {*} id id
284
+ * @returns
285
+ */
286
+ getLayerById(id: any): import("ol/layer/Base").default | VectorLayer<Feature<Geometry>> | import("ol/layer").Layer<import("ol/source").Source, import("ol/renderer/Layer").default<any>>;
287
+ /**
288
+ * 通过id删除图层
289
+ * @param {*} id 图层id
290
+ * @param {*} strict 是否严格匹配,默认true
291
+ */
292
+ removeLayerById(id: any, strict?: boolean): void;
293
+ /**
294
+ * 删除所有图层
295
+ */
296
+ removeAllLayer(): void;
297
+ /**
298
+ * 设置图层显隐
299
+ * @param {*} id 图层id
300
+ * @param {*} visible 是否可见
301
+ */
302
+ setLayerVisibleById(id: any, visible: any): void;
303
+ /**
304
+ * 设置图层透明度
305
+ * @param {*} id 图层id
306
+ * @param {*} opacity 透明度
307
+ */
308
+ setLayerOpacityById(id: any, opacity: any): void;
309
+ /***
310
+ * 图层操作模块.end *** */
311
+ /**
312
+ * 拉框缩放
313
+ * @param {Boolean} out 是否放大
314
+ */
315
+ dragZoom(out: any): void;
316
+ /**
317
+ * 结束缩放
318
+ */
319
+ endDragZoom(): void;
320
+ /**
321
+ * 获取变换工具
322
+ * @returns TransformHandler
323
+ */
324
+ getTransformHandler(): typeof TransHandler;
325
+ /**
326
+ * 获取几何工具
327
+ * @returns GeometryHandler
328
+ */
329
+ getGeometryHandler(): GeometryHandler;
330
+ /**
331
+ * 获取样式工具
332
+ * @returns StyleHandler
333
+ */
334
+ getStyleHandler(): typeof StyleHandler;
335
+ /**
336
+ * 获取图层工具实例
337
+ * @returns layerHandler
338
+ */
339
+ getLayerHandler(map?: Map): LayerHandler;
340
+ /**
341
+ * 获取测量工具实例
342
+ * @returns measureHandler
343
+ */
344
+ getMeasureHandler(map?: Map): MeasureHandler;
345
+ /**
346
+ * 获取绘制工具实例
347
+ * @param {*} map 地图对象
348
+ * @returns drawHandler
349
+ */
350
+ getDrawHandler(map?: Map): DrawHandler;
351
+ /**
352
+ * 销毁绘制工具实例
353
+ */
354
+ destoryDrawHandler(): void;
355
+ /**
356
+ * 创建绘制条件实例
357
+ * @returns drawConditions
358
+ */
359
+ newDrawConditions(): DrawConditions;
360
+ /**
361
+ * 绘制条件
362
+ * @returns
363
+ */
364
+ getDrawCondtions(): DrawConditions;
365
+ /**
366
+ * 创建wfs handler
367
+ * @param {*} map 地图对象
368
+ * @returns wfs handler
369
+ */
370
+ newWfsHandler(): WfsHandler;
371
+ /**
372
+ * 获取wfs handler
373
+ * @param {*} map 地图对象
374
+ * @returns wfs handler
375
+ */
376
+ getWfsHandler(): WfsHandler;
377
+ /**
378
+ * 获取wms handler
379
+ * @param {*} map 地图对象
380
+ * @returns wms handler
381
+ */
382
+ getWmsHandler(map?: Map): WmsHandler;
383
+ /**
384
+ * 创建交互模块
385
+ * @param {*} options 交互参数 {layers:[],...}
386
+ * @param {*} map 地图对象
387
+ * @returns interaction handler
388
+ */
389
+ newInteractionHandler(options: any, map?: Map): InteractionHandler;
390
+ /**
391
+ * 获取交互模块
392
+ * @param {*} options 交互参数
393
+ * @param {*} map 地图对象
394
+ * @returns interaction handler
395
+ */
396
+ getInteractionHandler(map?: Map): InteractionHandler;
397
+ destoryInteraction(): void;
398
+ /**
399
+ * 获取wkt handler
400
+ * @returns wkt handler
401
+ */
402
+ getWktHandler(): WktHandler;
403
+ /**
404
+ * 获取geojson handler
405
+ * @returns geojson handler
406
+ */
407
+ getGeojsonHandler(): GeojsonHandler;
408
+ /**
409
+ * 获取当前范围、中心点
410
+ * @param {*} options 可选参数 地图对象
411
+ * @returns {center: Array, extent: Array} 中心坐标、范围 [minX,minY,maxX,maxY]
412
+ */
413
+ getExtent(map?: Map): {
414
+ center: number[];
415
+ extent: number[];
416
+ };
417
+ /**
418
+ * 视图范围初始化
419
+ */
420
+ fullExtent(options?: {}): void;
421
+ /**
422
+ * 缩放到指定范围
423
+ * @param {*} extent 范围 [minX,minY,maxX,maxY]
424
+ * @param {*} options 可选参数 {duration: 1000, minResolution: 0, maxZoom: 18}
425
+ */
426
+ zoomToExtent(extent: number[], options?: ZoomOptions): void;
427
+ /**
428
+ * 缩放到点
429
+ * @param {*} coordinate Array 点坐标 [x,y]
430
+ * @param {*} options 可选参数 {duration: 1000, minResolution: 0, maxZoom: 18}
431
+ */
432
+ zoomToPoint(coordinate: any, options?: ZoomOptions): void;
433
+ /**
434
+ * 缩放到几何对象
435
+ * @param {*} geometry 几何对象
436
+ * @param {*} options 可选参数 {duration: 1000, minResolution: 0, maxZoom: 18}
437
+ */
438
+ zoomToGeometry(geometry: any, options?: ZoomOptions): void;
439
+ /**
440
+ * 缩放到集合对象
441
+ * @param {*} obj geometry | WKT | GeoJSON
442
+ */
443
+ zoomToObject(obj: any, options?: ZoomOptions): void;
444
+ /**
445
+ * 缩放到图层
446
+ * @param {*} id 图层id
447
+ * @param {*} options 可选参数 {duration: 1000, minResolution: 0, maxZoom: 18}
448
+ */
449
+ zoomToLayerById(id: any, options?: ZoomOptions): void;
450
+ /**
451
+ * 缩放到图层
452
+ * @param {*} layer 图层
453
+ * @param {*} options 可选参数 {maxZoom: 18, duration: 1000 ,minResolution: 0}
454
+ */
455
+ zoomToLayer(layer: any, options?: ZoomOptions): void;
456
+ /**
457
+ * 缩放到多个图层
458
+ * @param {*} layers 图层数组
459
+ * @param {*} options 可选参数 {maxZoom: 18, duration: 1000 ,minResolution: 0}
460
+ */
461
+ zoomToLayers(layers: any, options?: ZoomOptions): void;
462
+ /**
463
+ * 获取多个图层的范围
464
+ * @param {*} layers 图层数组
465
+ * @returns 范围 [minX,minY,maxX,maxY]
466
+ */
467
+ getLayersExtent(layers?: any[]): Extent;
468
+ /**
469
+ * 高亮几何对象
470
+ * @param {*} geometry 几何对象 WKT|GeoJSON
471
+ * @param {*} options
472
+ * @param {*} options.style 可选参数 style
473
+ * @returns 高亮图层
474
+ */
475
+ /**
476
+ * 高亮几何对象(弃用)
477
+ * @param {*} geom 几何对象 WKT|GeoJSON
478
+ * @param {*} style 可选参数 style
479
+ * @returns 高亮图层
480
+ */
481
+ highlight(geom: string | object, style?: StyleOptions): VectorLayer<Feature> | null;
482
+ /**
483
+ * 记录原始样式
484
+ */
485
+ originStyles: Record<string, {
486
+ features: Feature[];
487
+ originStyles: (StyleLike | undefined)[];
488
+ }>;
489
+ /**
490
+ * 高亮几何对象
491
+ * @param {*} features 几何对象数组
492
+ * @param {*} style 可选参数 style
493
+ */
494
+ highlightFeatures(features: Feature[], style?: StyleOptions): void;
495
+ /**
496
+ * 取消高亮几何对象
497
+ */
498
+ unhighlightFeatures(): void;
499
+ /**
500
+ * 飞行到图层
501
+ * @param {*} layer 图层
502
+ * @param {*} options 可选参数 {duration: 1000, minResolution: 0.005274727, maxZoom: 18}
503
+ */
504
+ fly2layer(layer: any, options?: ZoomOptions): void;
505
+ /**
506
+ * 飞行到范围
507
+ * @param {*} extent 范围
508
+ * @param {*} options 可选参数 {duration: 1000, minResolution: 0.005274727, maxZoom: 18}
509
+ */
510
+ fly2extent(extent: any, options?: ZoomOptions): void;
511
+ /**
512
+ * 获取面中心点坐标
513
+ * @param {*} polygon 面几何对象 Polygon|WKT|GeoJSON
514
+ * @returns 中心点坐标 [x,y]
515
+ */
516
+ getCenterByPolygon(polygon: Polygon | string | GeoJSON): import("ol/coordinate").Coordinate;
517
+ /**
518
+ * 获取线中心点
519
+ * @param {*} linestring 几何对象 LineString|WKT|GeoJSON
520
+ * @returns 线几何对象中心点坐标 [x,y]
521
+ */
522
+ getCenterByLinestring(linestring: LineString | string | GeoJSON): number[];
523
+ /**
524
+ * 计算长度
525
+ * @param {*} layer 线图层
526
+ * @param {*} projection 投影坐标系
527
+ * @returns 线图层长度
528
+ */
529
+ getLengthByLayer(layer: any, projection?: string): number;
530
+ /**
531
+ * 计算面积
532
+ * @param {*} layer 面图层
533
+ * @param {*} projection 投影坐标系 默认EPSG:4326
534
+ * @returns 面图层面积(单位:平方公里)
535
+ */
536
+ getAreaByLayer(layer: any, projection?: string): number;
537
+ /**
538
+ * 计算面积
539
+ * @param {*} polygon 面几何对象 Polygon|WKT|GeoJSON
540
+ * @param {*} projection 投影坐标系 默认EPSG:4326
541
+ * @returns 面积(单位:平方公里)
542
+ */
543
+ getAreaByPolygon(polygon: Polygon | string | GeoJSON, projection?: string): number;
544
+ /**
545
+ * 计算长度
546
+ * @param {*} linestring 线几何对象 LineString|WKT|GeoJSON
547
+ * @param {*} projection 投影坐标系 默认EPSG:4326
548
+ * @returns 长度(单位:米)
549
+ */
550
+ getLengthByLinestring(linestring: LineString | string | GeoJSON, projection?: string): number;
551
+ /**
552
+ * @description: 清理资源
553
+ */
554
+ destroy(): void;
555
+ }
556
+ export default VMap;
@@ -0,0 +1,64 @@
1
+ import { Map } from 'ol';
2
+ import { Draw } from 'ol/interaction';
3
+ import { Geometry } from 'ol/geom';
4
+ import { Coordinate } from 'ol/coordinate';
5
+ /**
6
+ * 绘图条件配置接口
7
+ */
8
+ interface DrawConditionsOptions {
9
+ showTip?: boolean;
10
+ maxStepDis?: number;
11
+ excludeGeometries?: Geometry[];
12
+ drawType?: string;
13
+ }
14
+ /**
15
+ * 绘图条件处理器类
16
+ */
17
+ export default class DrawConditions {
18
+ private listener;
19
+ private conditions;
20
+ projection: string;
21
+ private geometryChangeEvent;
22
+ private tooltipCollection;
23
+ private measureTooltip;
24
+ private drawHandler;
25
+ private map;
26
+ private draw;
27
+ drawType: string;
28
+ /**
29
+ * 构造函数
30
+ * @param options 绘图条件配置
31
+ */
32
+ constructor(options?: DrawConditionsOptions);
33
+ /**
34
+ * 初始化绘图条件处理器
35
+ * @param map 地图实例
36
+ * @param draw 绘图交互实例
37
+ * @param drawHandler 绘图处理器
38
+ */
39
+ initialize({ map, draw }: {
40
+ map: Map;
41
+ draw: Draw;
42
+ }, drawHandler: any): void;
43
+ /**
44
+ * 注册事件监听器
45
+ * @param eventName 事件名称
46
+ * @param callback 回调函数
47
+ */
48
+ registerEvent(eventName: string, callback: (sketch: any, geom: Geometry) => void): void;
49
+ /**
50
+ * 开始监听绘图事件
51
+ * @param sketch 绘图草图
52
+ * @param tooltipCoord 提示框坐标
53
+ */
54
+ drawListener({ sketch, tooltipCoord, }: {
55
+ sketch: any;
56
+ tooltipCoord: Coordinate;
57
+ }): void;
58
+ clear(): void;
59
+ /**
60
+ * 销毁绘图条件处理器
61
+ */
62
+ destroy(): void;
63
+ }
64
+ export {};