map-ol-utils 0.1.28 → 0.1.29
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/README.md +534 -70
- package/dist/index.cjs +846 -828
- package/dist/index.d.cts +64 -44
- package/dist/index.d.ts +64 -44
- package/dist/index.js +850 -832
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Layer, Tile } from 'ol/layer';
|
|
2
2
|
import { Style } from 'ol/style';
|
|
3
|
-
import { Map as Map$1,
|
|
3
|
+
import { Map as Map$1, Overlay, Feature } from 'ol';
|
|
4
4
|
import { CRSTypes } from 'gcoord';
|
|
5
5
|
import * as ol_source from 'ol/source';
|
|
6
6
|
import { Source, XYZ, WMTS } from 'ol/source';
|
|
@@ -9,15 +9,15 @@ import { FeatureLike } from 'ol/Feature';
|
|
|
9
9
|
import { Emitter, EventType } from 'mitt';
|
|
10
10
|
import TileLayer from 'ol/layer/Tile';
|
|
11
11
|
import * as ol_renderer_Layer from 'ol/renderer/Layer';
|
|
12
|
-
import * as ol_geom from 'ol/geom';
|
|
13
|
-
import { Point, SimpleGeometry } from 'ol/geom';
|
|
14
12
|
import { Options } from 'ol/Overlay';
|
|
15
|
-
import Cluster from 'ol/source/Cluster';
|
|
16
|
-
import { Select } from 'ol/interaction';
|
|
17
13
|
import VectorLayer from 'ol/layer/Vector';
|
|
18
|
-
import
|
|
19
|
-
import
|
|
14
|
+
import * as ol_geom from 'ol/geom';
|
|
15
|
+
import { SimpleGeometry, Point } from 'ol/geom';
|
|
20
16
|
import { FitOptions, AnimationOptions } from 'ol/View';
|
|
17
|
+
import { Select } from 'ol/interaction';
|
|
18
|
+
import VectorSource from 'ol/source/Vector';
|
|
19
|
+
import { StyleLike } from 'ol/style/Style';
|
|
20
|
+
import Cluster from 'ol/source/Cluster';
|
|
21
21
|
|
|
22
22
|
interface CustomMap extends Map$1 {
|
|
23
23
|
activeBaseLayer?: string;
|
|
@@ -167,47 +167,88 @@ declare const resetMap: (config?: {
|
|
|
167
167
|
isClearAll: boolean;
|
|
168
168
|
}) => void;
|
|
169
169
|
|
|
170
|
+
/**
|
|
171
|
+
* 移除带指定属性键的 Overlay(默认按 'position')
|
|
172
|
+
* @param key
|
|
173
|
+
*/
|
|
170
174
|
declare const removeOverlays: (key?: string) => void;
|
|
175
|
+
/**
|
|
176
|
+
* 创建动画标注 Overlay
|
|
177
|
+
* @param imgUrl
|
|
178
|
+
* @param data
|
|
179
|
+
*/
|
|
171
180
|
declare const createAnimationMarker: (imgUrl: string, data: MassData) => void;
|
|
172
181
|
/**
|
|
173
|
-
*
|
|
182
|
+
* 创建 Overlay
|
|
183
|
+
* @param config
|
|
174
184
|
*/
|
|
175
|
-
declare const
|
|
185
|
+
declare const createOverlay: (config?: Options) => Overlay;
|
|
186
|
+
|
|
176
187
|
/**
|
|
177
|
-
* 根据Array<Coordinate> Fit
|
|
188
|
+
* 根据 Array<Coordinate> Fit
|
|
178
189
|
* @param coords
|
|
179
190
|
* @param mapInstance
|
|
180
191
|
* @param fitOptions
|
|
181
192
|
*/
|
|
182
193
|
declare const setFitViewByCoords: (coords: Array<Coordinate>, mapInstance?: CustomMap, fitOptions?: FitOptions | AnimationOptions) => void;
|
|
183
194
|
/**
|
|
184
|
-
* 根据SimpleGeometry Fit
|
|
195
|
+
* 根据 SimpleGeometry Fit
|
|
185
196
|
* @param geom
|
|
186
197
|
* @param mapInstance
|
|
187
198
|
* @param fitOptions
|
|
188
199
|
*/
|
|
189
200
|
declare const setFitViewByGeom: (geom: SimpleGeometry, mapInstance?: CustomMap, fitOptions?: FitOptions) => void;
|
|
190
201
|
/**
|
|
191
|
-
* 根据VectorLayer要素的四至信息Fit
|
|
202
|
+
* 根据 VectorLayer 要素的四至信息 Fit
|
|
192
203
|
* @param layer
|
|
193
204
|
* @param mapInstance
|
|
194
205
|
* @param fitOptions
|
|
195
206
|
*/
|
|
196
207
|
declare const setFitViewByLayer: (layer: VectorLayer, mapInstance?: CustomMap, fitOptions?: FitOptions) => void;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* 创建点击交互
|
|
211
|
+
* @param vectorLayer
|
|
212
|
+
*/
|
|
213
|
+
declare const createSelectByLayer: (vectorLayer: VectorLayer) => Select;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* 重置激活的矢量数据(清空 overlay 与各图层选择交互的要素集合)
|
|
217
|
+
*/
|
|
218
|
+
declare const resetActiveVector: () => void;
|
|
219
|
+
/**
|
|
220
|
+
* 移除覆盖物以及所有非底图自定义图层
|
|
221
|
+
*/
|
|
222
|
+
declare const removeAllLayers: () => void;
|
|
223
|
+
/**
|
|
224
|
+
* 重置激活 Feature
|
|
225
|
+
*/
|
|
226
|
+
declare const resetActiveFeature: () => void;
|
|
227
|
+
/**
|
|
228
|
+
* 按 _uuid 激活要素
|
|
229
|
+
* @param uid
|
|
230
|
+
*/
|
|
231
|
+
declare const activeFeatureByUid: (uid: string) => void;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* 创建业务矢量图层(自动推断线/面,生成默认/激活样式)
|
|
235
|
+
* @param dataList
|
|
236
|
+
* @param config
|
|
237
|
+
*/
|
|
197
238
|
declare const createBusinessLayer: (dataList: MassData[], config: VectorConfig) => VectorLayer<VectorSource<Feature<ol_geom.Geometry, {
|
|
198
239
|
[x: string]: any;
|
|
199
240
|
}>>, Feature<ol_geom.Geometry, {
|
|
200
241
|
[x: string]: any;
|
|
201
242
|
}>>;
|
|
202
243
|
/**
|
|
203
|
-
* 追加Features
|
|
244
|
+
* 追加 Features
|
|
204
245
|
* @param targetLayer
|
|
205
246
|
* @param dataList
|
|
206
247
|
* @param crsForm
|
|
207
248
|
*/
|
|
208
249
|
declare const appendFeaturesByLayer: (targetLayer: VectorLayer, dataList: MassData[], crsForm?: CRSTypes) => void;
|
|
209
250
|
/**
|
|
210
|
-
*
|
|
251
|
+
* 创建面状图层
|
|
211
252
|
* @param dataList
|
|
212
253
|
* @param config
|
|
213
254
|
*/
|
|
@@ -226,39 +267,22 @@ declare const createVectorLineLayer: (dataList: MassData[] | undefined, config:
|
|
|
226
267
|
}>>, Feature<ol_geom.Geometry, {
|
|
227
268
|
[x: string]: any;
|
|
228
269
|
}>>;
|
|
270
|
+
|
|
229
271
|
/**
|
|
230
|
-
*
|
|
231
|
-
*/
|
|
232
|
-
declare const removeAllLayers: () => void;
|
|
233
|
-
/**
|
|
234
|
-
* 重置激活Feature
|
|
235
|
-
*/
|
|
236
|
-
declare const resetActiveFeature: () => void;
|
|
237
|
-
/**
|
|
238
|
-
* 激活要素
|
|
239
|
-
* @param uid
|
|
240
|
-
*/
|
|
241
|
-
declare const activeFeatureByUid: (uid: string) => void;
|
|
242
|
-
/**
|
|
243
|
-
* 构建MassMarks样式数组
|
|
272
|
+
* 构建 MassMarks 样式数组(默认段 + 激活段,长度 statusNum * 2)
|
|
244
273
|
*/
|
|
245
274
|
declare const buildMassMarksStyles: (getImgUrlFn: GetImgUrlFn) => (iconConfig: IconConfig) => any[];
|
|
246
275
|
/**
|
|
247
|
-
*
|
|
248
|
-
* @param vectorLayer
|
|
249
|
-
*/
|
|
250
|
-
declare const createSelectByLayer: (vectorLayer: VectorLayer) => Select;
|
|
251
|
-
/**
|
|
252
|
-
* 添加Features
|
|
276
|
+
* 向海量点图层增量添加 Features
|
|
253
277
|
* @param targetLayer
|
|
254
278
|
* @param dataList
|
|
255
279
|
* @param config
|
|
256
280
|
*/
|
|
257
281
|
declare const addFeaturesByLayer: (targetLayer: VectorLayer, dataList: MassData[], config: {
|
|
258
|
-
clear
|
|
282
|
+
clear?: boolean;
|
|
259
283
|
}) => void;
|
|
260
284
|
/**
|
|
261
|
-
* 创建massMarksLayer
|
|
285
|
+
* 创建 massMarksLayer
|
|
262
286
|
* @param dataList
|
|
263
287
|
* @param styleList
|
|
264
288
|
*/
|
|
@@ -268,7 +292,7 @@ declare const createMassMarksLayer: (dataList: MassData[], styleList?: StyleLike
|
|
|
268
292
|
[x: string]: any;
|
|
269
293
|
}>>;
|
|
270
294
|
/**
|
|
271
|
-
* 添加massMarksLayer
|
|
295
|
+
* 添加 massMarksLayer(按需附带线/面图层)
|
|
272
296
|
* @param getImgUrlFn
|
|
273
297
|
*/
|
|
274
298
|
declare const addMassMarksLayer: (getImgUrlFn: GetImgUrlFn) => (dataList: never[] | undefined, iconConfig: IconConfig, openClick?: boolean) => VectorLayer<VectorSource<Feature<Point, {
|
|
@@ -277,17 +301,13 @@ declare const addMassMarksLayer: (getImgUrlFn: GetImgUrlFn) => (dataList: never[
|
|
|
277
301
|
[x: string]: any;
|
|
278
302
|
}>>;
|
|
279
303
|
/**
|
|
280
|
-
*
|
|
304
|
+
* 按选中状态列表更新海量点显隐
|
|
281
305
|
* @param checkedStatusList
|
|
282
306
|
*/
|
|
283
307
|
declare const updateMarksLayersByStatus: (checkedStatusList?: string[]) => MassData[];
|
|
308
|
+
|
|
284
309
|
/**
|
|
285
|
-
*
|
|
286
|
-
* @param config
|
|
287
|
-
*/
|
|
288
|
-
declare const createOverlay: (config?: Options) => Overlay;
|
|
289
|
-
/**
|
|
290
|
-
* 创建聚合图层
|
|
310
|
+
* 创建聚合图层(半径/颜色随聚合数量动态计算)
|
|
291
311
|
* @param dataList
|
|
292
312
|
* @param config
|
|
293
313
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Layer, Tile } from 'ol/layer';
|
|
2
2
|
import { Style } from 'ol/style';
|
|
3
|
-
import { Map as Map$1,
|
|
3
|
+
import { Map as Map$1, Overlay, Feature } from 'ol';
|
|
4
4
|
import { CRSTypes } from 'gcoord';
|
|
5
5
|
import * as ol_source from 'ol/source';
|
|
6
6
|
import { Source, XYZ, WMTS } from 'ol/source';
|
|
@@ -9,15 +9,15 @@ import { FeatureLike } from 'ol/Feature';
|
|
|
9
9
|
import { Emitter, EventType } from 'mitt';
|
|
10
10
|
import TileLayer from 'ol/layer/Tile';
|
|
11
11
|
import * as ol_renderer_Layer from 'ol/renderer/Layer';
|
|
12
|
-
import * as ol_geom from 'ol/geom';
|
|
13
|
-
import { Point, SimpleGeometry } from 'ol/geom';
|
|
14
12
|
import { Options } from 'ol/Overlay';
|
|
15
|
-
import Cluster from 'ol/source/Cluster';
|
|
16
|
-
import { Select } from 'ol/interaction';
|
|
17
13
|
import VectorLayer from 'ol/layer/Vector';
|
|
18
|
-
import
|
|
19
|
-
import
|
|
14
|
+
import * as ol_geom from 'ol/geom';
|
|
15
|
+
import { SimpleGeometry, Point } from 'ol/geom';
|
|
20
16
|
import { FitOptions, AnimationOptions } from 'ol/View';
|
|
17
|
+
import { Select } from 'ol/interaction';
|
|
18
|
+
import VectorSource from 'ol/source/Vector';
|
|
19
|
+
import { StyleLike } from 'ol/style/Style';
|
|
20
|
+
import Cluster from 'ol/source/Cluster';
|
|
21
21
|
|
|
22
22
|
interface CustomMap extends Map$1 {
|
|
23
23
|
activeBaseLayer?: string;
|
|
@@ -167,47 +167,88 @@ declare const resetMap: (config?: {
|
|
|
167
167
|
isClearAll: boolean;
|
|
168
168
|
}) => void;
|
|
169
169
|
|
|
170
|
+
/**
|
|
171
|
+
* 移除带指定属性键的 Overlay(默认按 'position')
|
|
172
|
+
* @param key
|
|
173
|
+
*/
|
|
170
174
|
declare const removeOverlays: (key?: string) => void;
|
|
175
|
+
/**
|
|
176
|
+
* 创建动画标注 Overlay
|
|
177
|
+
* @param imgUrl
|
|
178
|
+
* @param data
|
|
179
|
+
*/
|
|
171
180
|
declare const createAnimationMarker: (imgUrl: string, data: MassData) => void;
|
|
172
181
|
/**
|
|
173
|
-
*
|
|
182
|
+
* 创建 Overlay
|
|
183
|
+
* @param config
|
|
174
184
|
*/
|
|
175
|
-
declare const
|
|
185
|
+
declare const createOverlay: (config?: Options) => Overlay;
|
|
186
|
+
|
|
176
187
|
/**
|
|
177
|
-
* 根据Array<Coordinate> Fit
|
|
188
|
+
* 根据 Array<Coordinate> Fit
|
|
178
189
|
* @param coords
|
|
179
190
|
* @param mapInstance
|
|
180
191
|
* @param fitOptions
|
|
181
192
|
*/
|
|
182
193
|
declare const setFitViewByCoords: (coords: Array<Coordinate>, mapInstance?: CustomMap, fitOptions?: FitOptions | AnimationOptions) => void;
|
|
183
194
|
/**
|
|
184
|
-
* 根据SimpleGeometry Fit
|
|
195
|
+
* 根据 SimpleGeometry Fit
|
|
185
196
|
* @param geom
|
|
186
197
|
* @param mapInstance
|
|
187
198
|
* @param fitOptions
|
|
188
199
|
*/
|
|
189
200
|
declare const setFitViewByGeom: (geom: SimpleGeometry, mapInstance?: CustomMap, fitOptions?: FitOptions) => void;
|
|
190
201
|
/**
|
|
191
|
-
* 根据VectorLayer要素的四至信息Fit
|
|
202
|
+
* 根据 VectorLayer 要素的四至信息 Fit
|
|
192
203
|
* @param layer
|
|
193
204
|
* @param mapInstance
|
|
194
205
|
* @param fitOptions
|
|
195
206
|
*/
|
|
196
207
|
declare const setFitViewByLayer: (layer: VectorLayer, mapInstance?: CustomMap, fitOptions?: FitOptions) => void;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* 创建点击交互
|
|
211
|
+
* @param vectorLayer
|
|
212
|
+
*/
|
|
213
|
+
declare const createSelectByLayer: (vectorLayer: VectorLayer) => Select;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* 重置激活的矢量数据(清空 overlay 与各图层选择交互的要素集合)
|
|
217
|
+
*/
|
|
218
|
+
declare const resetActiveVector: () => void;
|
|
219
|
+
/**
|
|
220
|
+
* 移除覆盖物以及所有非底图自定义图层
|
|
221
|
+
*/
|
|
222
|
+
declare const removeAllLayers: () => void;
|
|
223
|
+
/**
|
|
224
|
+
* 重置激活 Feature
|
|
225
|
+
*/
|
|
226
|
+
declare const resetActiveFeature: () => void;
|
|
227
|
+
/**
|
|
228
|
+
* 按 _uuid 激活要素
|
|
229
|
+
* @param uid
|
|
230
|
+
*/
|
|
231
|
+
declare const activeFeatureByUid: (uid: string) => void;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* 创建业务矢量图层(自动推断线/面,生成默认/激活样式)
|
|
235
|
+
* @param dataList
|
|
236
|
+
* @param config
|
|
237
|
+
*/
|
|
197
238
|
declare const createBusinessLayer: (dataList: MassData[], config: VectorConfig) => VectorLayer<VectorSource<Feature<ol_geom.Geometry, {
|
|
198
239
|
[x: string]: any;
|
|
199
240
|
}>>, Feature<ol_geom.Geometry, {
|
|
200
241
|
[x: string]: any;
|
|
201
242
|
}>>;
|
|
202
243
|
/**
|
|
203
|
-
* 追加Features
|
|
244
|
+
* 追加 Features
|
|
204
245
|
* @param targetLayer
|
|
205
246
|
* @param dataList
|
|
206
247
|
* @param crsForm
|
|
207
248
|
*/
|
|
208
249
|
declare const appendFeaturesByLayer: (targetLayer: VectorLayer, dataList: MassData[], crsForm?: CRSTypes) => void;
|
|
209
250
|
/**
|
|
210
|
-
*
|
|
251
|
+
* 创建面状图层
|
|
211
252
|
* @param dataList
|
|
212
253
|
* @param config
|
|
213
254
|
*/
|
|
@@ -226,39 +267,22 @@ declare const createVectorLineLayer: (dataList: MassData[] | undefined, config:
|
|
|
226
267
|
}>>, Feature<ol_geom.Geometry, {
|
|
227
268
|
[x: string]: any;
|
|
228
269
|
}>>;
|
|
270
|
+
|
|
229
271
|
/**
|
|
230
|
-
*
|
|
231
|
-
*/
|
|
232
|
-
declare const removeAllLayers: () => void;
|
|
233
|
-
/**
|
|
234
|
-
* 重置激活Feature
|
|
235
|
-
*/
|
|
236
|
-
declare const resetActiveFeature: () => void;
|
|
237
|
-
/**
|
|
238
|
-
* 激活要素
|
|
239
|
-
* @param uid
|
|
240
|
-
*/
|
|
241
|
-
declare const activeFeatureByUid: (uid: string) => void;
|
|
242
|
-
/**
|
|
243
|
-
* 构建MassMarks样式数组
|
|
272
|
+
* 构建 MassMarks 样式数组(默认段 + 激活段,长度 statusNum * 2)
|
|
244
273
|
*/
|
|
245
274
|
declare const buildMassMarksStyles: (getImgUrlFn: GetImgUrlFn) => (iconConfig: IconConfig) => any[];
|
|
246
275
|
/**
|
|
247
|
-
*
|
|
248
|
-
* @param vectorLayer
|
|
249
|
-
*/
|
|
250
|
-
declare const createSelectByLayer: (vectorLayer: VectorLayer) => Select;
|
|
251
|
-
/**
|
|
252
|
-
* 添加Features
|
|
276
|
+
* 向海量点图层增量添加 Features
|
|
253
277
|
* @param targetLayer
|
|
254
278
|
* @param dataList
|
|
255
279
|
* @param config
|
|
256
280
|
*/
|
|
257
281
|
declare const addFeaturesByLayer: (targetLayer: VectorLayer, dataList: MassData[], config: {
|
|
258
|
-
clear
|
|
282
|
+
clear?: boolean;
|
|
259
283
|
}) => void;
|
|
260
284
|
/**
|
|
261
|
-
* 创建massMarksLayer
|
|
285
|
+
* 创建 massMarksLayer
|
|
262
286
|
* @param dataList
|
|
263
287
|
* @param styleList
|
|
264
288
|
*/
|
|
@@ -268,7 +292,7 @@ declare const createMassMarksLayer: (dataList: MassData[], styleList?: StyleLike
|
|
|
268
292
|
[x: string]: any;
|
|
269
293
|
}>>;
|
|
270
294
|
/**
|
|
271
|
-
* 添加massMarksLayer
|
|
295
|
+
* 添加 massMarksLayer(按需附带线/面图层)
|
|
272
296
|
* @param getImgUrlFn
|
|
273
297
|
*/
|
|
274
298
|
declare const addMassMarksLayer: (getImgUrlFn: GetImgUrlFn) => (dataList: never[] | undefined, iconConfig: IconConfig, openClick?: boolean) => VectorLayer<VectorSource<Feature<Point, {
|
|
@@ -277,17 +301,13 @@ declare const addMassMarksLayer: (getImgUrlFn: GetImgUrlFn) => (dataList: never[
|
|
|
277
301
|
[x: string]: any;
|
|
278
302
|
}>>;
|
|
279
303
|
/**
|
|
280
|
-
*
|
|
304
|
+
* 按选中状态列表更新海量点显隐
|
|
281
305
|
* @param checkedStatusList
|
|
282
306
|
*/
|
|
283
307
|
declare const updateMarksLayersByStatus: (checkedStatusList?: string[]) => MassData[];
|
|
308
|
+
|
|
284
309
|
/**
|
|
285
|
-
*
|
|
286
|
-
* @param config
|
|
287
|
-
*/
|
|
288
|
-
declare const createOverlay: (config?: Options) => Overlay;
|
|
289
|
-
/**
|
|
290
|
-
* 创建聚合图层
|
|
310
|
+
* 创建聚合图层(半径/颜色随聚合数量动态计算)
|
|
291
311
|
* @param dataList
|
|
292
312
|
* @param config
|
|
293
313
|
*/
|