map-ol-utils 0.1.30 → 0.2.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/README.md +223 -45
- package/dist/index.cjs +1907 -1120
- package/dist/index.d.cts +475 -134
- package/dist/index.d.mts +661 -0
- package/dist/index.mjs +1830 -0
- package/dist/tdt-vts/decoder.worker.cjs +46 -0
- package/dist/tdt-vts/decoder.worker.d.cts +1 -0
- package/dist/tdt-vts/decoder.worker.d.mts +1 -0
- package/dist/tdt-vts/decoder.worker.mjs +47 -0
- package/dist/tile-loader-CtZwCurI.mjs +630 -0
- package/dist/tile-loader-D4cn6nMU.cjs +683 -0
- package/package.json +20 -12
- package/dist/index.d.ts +0 -320
- package/dist/index.js +0 -1096
package/dist/index.d.cts
CHANGED
|
@@ -1,131 +1,390 @@
|
|
|
1
|
-
import { Layer, Tile } from
|
|
2
|
-
import { Style } from
|
|
3
|
-
import { Map as Map$1, Overlay
|
|
4
|
-
import { CRSTypes } from
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import { Emitter, EventType } from
|
|
10
|
-
import TileLayer from
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
|
|
1
|
+
import { Layer, Tile } from "ol/layer.js";
|
|
2
|
+
import { Style, Text } from "ol/style.js";
|
|
3
|
+
import { Feature, Map as Map$1, Overlay } from "ol";
|
|
4
|
+
import { CRSTypes } from "gcoord";
|
|
5
|
+
import { Source, WMTS, XYZ } from "ol/source.js";
|
|
6
|
+
import { Coordinate } from "ol/coordinate.js";
|
|
7
|
+
import Feature$1, { FeatureLike } from "ol/Feature.js";
|
|
8
|
+
import VectorTileSource from "ol/source/VectorTile.js";
|
|
9
|
+
import { Emitter, EventType } from "mitt";
|
|
10
|
+
import TileLayer from "ol/layer/Tile.js";
|
|
11
|
+
import Layer$1 from "ol/layer/Layer.js";
|
|
12
|
+
import VectorImageLayer from "ol/layer/Image.js";
|
|
13
|
+
import RasterSource from "ol/source/Raster.js";
|
|
14
|
+
import { Options } from "ol/Overlay.js";
|
|
15
|
+
import VectorLayer from "ol/layer/Vector.js";
|
|
16
|
+
import { Point, SimpleGeometry } from "ol/geom.js";
|
|
17
|
+
import { AnimationOptions, FitOptions } from "ol/View.js";
|
|
18
|
+
import { Select } from "ol/interaction.js";
|
|
19
|
+
import Geometry, { Type } from "ol/geom/Geometry.js";
|
|
20
|
+
import Draw from "ol/interaction/Draw.js";
|
|
21
|
+
import VectorSource from "ol/source/Vector.js";
|
|
22
|
+
import { FlatStyleLike } from "ol/style/flat.js";
|
|
23
|
+
import { StyleLike } from "ol/style/Style.js";
|
|
24
|
+
import Collection from "ol/Collection.js";
|
|
25
|
+
import Point$1 from "ol/geom/Point.js";
|
|
26
|
+
import Cluster from "ol/source/Cluster.js";
|
|
27
|
+
//#region src/core/types.d.ts
|
|
22
28
|
interface CustomMap extends Map$1 {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
activeBaseLayer?: string;
|
|
30
|
+
changeBaseLayer?: () => void;
|
|
31
|
+
removeLayerByName?: (name: string) => void;
|
|
32
|
+
getLayerByName?: (name: string) => Layer<Source> | undefined;
|
|
33
|
+
changeLayersByNames?: (activeNames: Array<string>, allLayerNames: Array<string>) => void;
|
|
28
34
|
}
|
|
29
35
|
type GetImgUrl = (name: string, ext?: string) => string;
|
|
30
36
|
type GetImgUrlFn = (baseUrl: string) => GetImgUrl;
|
|
31
37
|
type VectorConfig = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
key: string;
|
|
39
|
+
zIndex?: number;
|
|
40
|
+
isRaw?: boolean;
|
|
41
|
+
isLine: boolean;
|
|
42
|
+
colorKey?: string;
|
|
43
|
+
layerName?: string;
|
|
44
|
+
openClick?: boolean;
|
|
45
|
+
fillColor?: string;
|
|
46
|
+
isAutoFit?: boolean;
|
|
47
|
+
crsForm?: CRSTypes;
|
|
48
|
+
fillOpacity?: number;
|
|
49
|
+
strokeColor?: string;
|
|
50
|
+
strokeStyle?: string;
|
|
51
|
+
strokeWeight?: number;
|
|
52
|
+
needTransform?: boolean;
|
|
53
|
+
activeFillColor?: string;
|
|
54
|
+
activeStrokeColor?: string;
|
|
55
|
+
activeFillOpacity?: number;
|
|
56
|
+
activeStrokeWeight?: number;
|
|
57
|
+
colorMap?: Map<string, string>;
|
|
52
58
|
};
|
|
53
59
|
type ClusterData = {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
_uuid: string;
|
|
61
|
+
name: string;
|
|
62
|
+
style: number;
|
|
63
|
+
lnglat: Array<number>;
|
|
64
|
+
rawData: {
|
|
65
|
+
[key: string]: any;
|
|
66
|
+
};
|
|
61
67
|
};
|
|
62
68
|
type ClusterConfig = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
distance: number;
|
|
70
|
+
layerName?: string;
|
|
71
|
+
openClick?: boolean;
|
|
72
|
+
minDistance: number;
|
|
73
|
+
singleStyles: Style[];
|
|
74
|
+
computedRadius?: (size: number) => number;
|
|
75
|
+
buildStyle?: (feature: FeatureLike) => Style;
|
|
70
76
|
};
|
|
71
77
|
type IconConfig = {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
baseUrl: string;
|
|
79
|
+
hasLine?: boolean;
|
|
80
|
+
layerName?: string;
|
|
81
|
+
hasFace?: boolean;
|
|
82
|
+
statusNum?: number;
|
|
83
|
+
isDynamic?: boolean;
|
|
84
|
+
markerIcon: string;
|
|
85
|
+
activeScale?: number;
|
|
86
|
+
isAutoFit?: boolean;
|
|
87
|
+
marksStyles?: Style[];
|
|
88
|
+
offset?: [number, number];
|
|
89
|
+
vectorConfig?: VectorConfig;
|
|
90
|
+
markerSize: [number, number];
|
|
85
91
|
};
|
|
86
92
|
type MassData = {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
_uuid?: string;
|
|
94
|
+
id: string;
|
|
95
|
+
style: number;
|
|
96
|
+
name: string;
|
|
97
|
+
status: string;
|
|
98
|
+
width?: number;
|
|
99
|
+
height?: number;
|
|
100
|
+
crsForm?: CRSTypes;
|
|
101
|
+
rawData: {
|
|
102
|
+
[key: string]: any;
|
|
103
|
+
};
|
|
104
|
+
lnglat: [string, string] | [number, number];
|
|
99
105
|
};
|
|
100
106
|
type WmtsSourceOptions = {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
107
|
+
style?: string;
|
|
108
|
+
format?: string;
|
|
109
|
+
version?: string;
|
|
110
|
+
layerName: string;
|
|
111
|
+
matrixSet?: string;
|
|
106
112
|
};
|
|
107
113
|
declare enum GeometryType {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
LineString = "LineString",
|
|
115
|
+
MultiLineString = "MultiLineString",
|
|
116
|
+
Polygon = "Polygon",
|
|
117
|
+
MultiPolygon = "MultiPolygon",
|
|
118
|
+
Invalid = "Invalid"
|
|
113
119
|
}
|
|
114
120
|
type GeometryCoordinates = Coordinate[] | Coordinate[][] | Coordinate[][][];
|
|
115
121
|
type HzsyType = 'hzsyraster' | 'hzsyvector' | 'hzsyvector_dark';
|
|
116
122
|
type ZheJiangType = 'emap' | 'emap_lab' | 'imgmap' | 'imgmap_lab';
|
|
117
123
|
type WorldLayerType = 'vec_c' | 'cva_c' | 'img_c' | 'cia_c' | 'ter_c' | 'cta_c' | 'ibo_c';
|
|
118
|
-
|
|
124
|
+
/** 通用图层配置。 */
|
|
125
|
+
type LayerConfig = {
|
|
126
|
+
zIndex?: number;
|
|
127
|
+
visible?: boolean;
|
|
128
|
+
minZoom?: number;
|
|
129
|
+
maxZoom?: number;
|
|
130
|
+
layerName: string;
|
|
131
|
+
};
|
|
132
|
+
/** Marker 数据结构。 */
|
|
133
|
+
type DataItemConfig = {
|
|
134
|
+
lng: string | number;
|
|
135
|
+
lat: string | number;
|
|
136
|
+
img: string | undefined;
|
|
137
|
+
activeImg?: string | undefined;
|
|
138
|
+
text?: string;
|
|
139
|
+
offsetX?: number;
|
|
140
|
+
offsetY?: number;
|
|
141
|
+
scale?: number;
|
|
142
|
+
showText?: boolean;
|
|
143
|
+
anchor?: Array<number>;
|
|
144
|
+
rawData?: any;
|
|
145
|
+
rotation?: number;
|
|
146
|
+
};
|
|
147
|
+
interface ElasticDataItemConfig extends DataItemConfig {
|
|
148
|
+
smallImg: string;
|
|
149
|
+
largeImg: string;
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/tdt-vts/pk.d.ts
|
|
153
|
+
interface TileCoordinate {
|
|
154
|
+
z: number;
|
|
155
|
+
x: number;
|
|
156
|
+
y: number;
|
|
157
|
+
}
|
|
158
|
+
interface TdtVtsUrlOptions {
|
|
159
|
+
token: string;
|
|
160
|
+
type?: string;
|
|
161
|
+
version?: string;
|
|
162
|
+
maxZoom?: number;
|
|
163
|
+
hosts?: readonly string[];
|
|
164
|
+
wrapX?: boolean;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* 将 XYZ 瓦片坐标编码为天地图 VTS 使用的 pk 参数。
|
|
168
|
+
*
|
|
169
|
+
* 算法按 main.0f98e6f9.js 中的实现还原:
|
|
170
|
+
* 1. 从 bit=z 到 bit=0 交织 x/y 位;
|
|
171
|
+
* 2. 反转;
|
|
172
|
+
* 3. 将 0-based 位置 9、8、7、6 加一;
|
|
173
|
+
* 4. 0/1/2/3/4 映射为 a/d/g/j/m;
|
|
174
|
+
* 5. 连续字符使用“额外重复次数”压缩。
|
|
175
|
+
*/
|
|
176
|
+
declare const encodeTdtPk: (x: number, y: number, z: number) => string;
|
|
177
|
+
/** 反解 pk;用于调试、单元测试和核对网络请求。 */
|
|
178
|
+
declare const decodeTdtPk: (pk: string) => TileCoordinate;
|
|
179
|
+
/**
|
|
180
|
+
* 根据 OpenLayers 的 [z, x, y] 生成最终 VTS 地址,不依赖字符串替换。
|
|
181
|
+
*/
|
|
182
|
+
declare const createTdtVtsUrl: (tileCoord: readonly [number, number, number], options: TdtVtsUrlOptions) => string | undefined;
|
|
183
|
+
declare const redactTdtToken: (url: string) => string;
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/tdt-vts/private-mvt.d.ts
|
|
186
|
+
declare const TDT_XOR_BYTE_INDEXES: readonly [1, 2, 3, 4, 99];
|
|
187
|
+
type MvtLayout = 'private' | 'standard';
|
|
188
|
+
type RestoreMode = 'auto' | 'header' | 'always' | 'never';
|
|
189
|
+
type MvtGeometryType = 0 | 1 | 2 | 3 | 4;
|
|
190
|
+
type MvtValue = {
|
|
191
|
+
kind: 'string';
|
|
192
|
+
value: string;
|
|
193
|
+
} | {
|
|
194
|
+
kind: 'float';
|
|
195
|
+
value: number;
|
|
196
|
+
} | {
|
|
197
|
+
kind: 'double';
|
|
198
|
+
value: number;
|
|
199
|
+
} | {
|
|
200
|
+
kind: 'int64';
|
|
201
|
+
value: bigint;
|
|
202
|
+
} | {
|
|
203
|
+
kind: 'uint64';
|
|
204
|
+
value: bigint;
|
|
205
|
+
} | {
|
|
206
|
+
kind: 'sint64';
|
|
207
|
+
value: bigint;
|
|
208
|
+
} | {
|
|
209
|
+
kind: 'boolean';
|
|
210
|
+
value: boolean;
|
|
211
|
+
} | {
|
|
212
|
+
kind: 'null';
|
|
213
|
+
value: null;
|
|
214
|
+
};
|
|
215
|
+
interface MvtFeature {
|
|
216
|
+
id?: bigint;
|
|
217
|
+
tags: number[];
|
|
218
|
+
type: MvtGeometryType;
|
|
219
|
+
geometry: number[];
|
|
220
|
+
}
|
|
221
|
+
interface MvtLayer {
|
|
222
|
+
version: number;
|
|
223
|
+
name: string;
|
|
224
|
+
extent: number;
|
|
225
|
+
features: MvtFeature[];
|
|
226
|
+
keys: string[];
|
|
227
|
+
values: MvtValue[];
|
|
228
|
+
}
|
|
229
|
+
interface MvtTile {
|
|
230
|
+
layers: MvtLayer[];
|
|
231
|
+
}
|
|
232
|
+
interface LayerStats {
|
|
233
|
+
name: string;
|
|
234
|
+
featureCount: number;
|
|
235
|
+
pointCount: number;
|
|
236
|
+
lineCount: number;
|
|
237
|
+
polygonCount: number;
|
|
238
|
+
extent: number;
|
|
239
|
+
version: number;
|
|
240
|
+
}
|
|
241
|
+
interface NormalizeStats {
|
|
242
|
+
restored: boolean;
|
|
243
|
+
pragma: string | null;
|
|
244
|
+
inputBytes: number;
|
|
245
|
+
outputBytes: number;
|
|
246
|
+
layerCount: number;
|
|
247
|
+
featureCount: number;
|
|
248
|
+
layers: LayerStats[];
|
|
249
|
+
}
|
|
250
|
+
interface NormalizeOptions {
|
|
251
|
+
pragma?: string | null;
|
|
252
|
+
restoreMode?: RestoreMode;
|
|
253
|
+
}
|
|
254
|
+
interface NormalizeResult {
|
|
255
|
+
data: Uint8Array;
|
|
256
|
+
stats: NormalizeStats;
|
|
257
|
+
}
|
|
258
|
+
declare const restoreTdtBytes: (input: ArrayBuffer | ArrayBufferView | Uint8Array) => Uint8Array;
|
|
259
|
+
declare const decodeMvt: (input: ArrayBuffer | ArrayBufferView | Uint8Array, layout: MvtLayout) => MvtTile;
|
|
260
|
+
declare const privateTypeToStandard: (type: MvtGeometryType) => MvtGeometryType;
|
|
261
|
+
declare const normalizePrivateGeometry: (geometry: readonly number[]) => number[];
|
|
262
|
+
declare const encodeStandardMvt: (privateTile: MvtTile) => Uint8Array;
|
|
263
|
+
declare const normalizePrivateMvt: (input: ArrayBuffer | ArrayBufferView | Uint8Array, options?: NormalizeOptions) => NormalizeResult;
|
|
264
|
+
declare const resolveFeatureProperties: (layer: MvtLayer, feature: MvtFeature) => Record<string, string | number | boolean | bigint | null>;
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/tdt-vts/style-loader.d.ts
|
|
267
|
+
declare const TDT_VECTOR_SOURCE_ID = "base-tdt-vector-tile";
|
|
268
|
+
interface JsonStyleLayer {
|
|
269
|
+
id: string;
|
|
270
|
+
type: string;
|
|
271
|
+
source?: string;
|
|
272
|
+
'source-layer'?: string;
|
|
273
|
+
beforeLayerId?: string;
|
|
274
|
+
minzoom?: number;
|
|
275
|
+
maxzoom?: number;
|
|
276
|
+
layout?: Record<string, unknown>;
|
|
277
|
+
paint?: Record<string, unknown>;
|
|
278
|
+
filter?: unknown;
|
|
279
|
+
metadata?: Record<string, unknown>;
|
|
280
|
+
[key: string]: unknown;
|
|
281
|
+
}
|
|
282
|
+
interface JsonStyleDocument {
|
|
283
|
+
version: 8;
|
|
284
|
+
name?: string;
|
|
285
|
+
metadata?: Record<string, unknown>;
|
|
286
|
+
sources: Record<string, Record<string, unknown>>;
|
|
287
|
+
sprite?: unknown;
|
|
288
|
+
glyphs?: string;
|
|
289
|
+
layers: JsonStyleLayer[];
|
|
290
|
+
[key: string]: unknown;
|
|
291
|
+
}
|
|
292
|
+
interface TdtStyleBundle {
|
|
293
|
+
style: JsonStyleDocument;
|
|
294
|
+
style0LayerCount: number;
|
|
295
|
+
style1LayerCount: number;
|
|
296
|
+
skippedLayerIds: string[];
|
|
297
|
+
}
|
|
298
|
+
interface LoadStyleOptions {
|
|
299
|
+
style0Url: string;
|
|
300
|
+
style1Url: string;
|
|
301
|
+
sourceId?: string;
|
|
302
|
+
signal?: AbortSignal;
|
|
303
|
+
}
|
|
304
|
+
/** 按原 bundle 的 beforeLayerId 语义逐层插入。 */
|
|
305
|
+
declare const mergeTdtStyleLayers: (baseLayers: readonly JsonStyleLayer[], extraLayers: readonly JsonStyleLayer[]) => JsonStyleLayer[];
|
|
306
|
+
declare const loadTdtStyleBundle: (options: LoadStyleOptions) => Promise<TdtStyleBundle>;
|
|
307
|
+
declare const getConstantBackgroundColor: (style: JsonStyleDocument) => string | undefined;
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region src/tdt-vts/tile-loader.d.ts
|
|
310
|
+
interface TdtTileResponseStats extends NormalizeStats {
|
|
311
|
+
contentType: string | null;
|
|
312
|
+
cacheControl: string | null;
|
|
313
|
+
}
|
|
314
|
+
interface LoadedTdtTile {
|
|
315
|
+
buffer: ArrayBuffer;
|
|
316
|
+
stats: TdtTileResponseStats;
|
|
317
|
+
}
|
|
318
|
+
interface LoadTdtVtsOptions {
|
|
319
|
+
restoreMode?: RestoreMode;
|
|
320
|
+
signal?: AbortSignal;
|
|
321
|
+
fetch?: typeof globalThis.fetch;
|
|
322
|
+
}
|
|
323
|
+
/** Fetch a private Tianditu VTS tile and return a standard MVT buffer. */
|
|
324
|
+
declare const loadAndNormalizeTdtVts: (url: string, options?: LoadTdtVtsOptions) => Promise<LoadedTdtTile>;
|
|
325
|
+
//#endregion
|
|
326
|
+
//#region src/tdt-vts/worker-client.d.ts
|
|
327
|
+
type DecodedTile = LoadedTdtTile;
|
|
328
|
+
interface DecodeTileOptions {
|
|
329
|
+
signal?: AbortSignal;
|
|
330
|
+
}
|
|
331
|
+
interface TdtDecoderWorkerClientOptions {
|
|
332
|
+
requestTimeoutMs?: number;
|
|
333
|
+
workerFactory?: () => Worker;
|
|
334
|
+
}
|
|
335
|
+
declare class TdtDecoderWorkerClient {
|
|
336
|
+
private readonly restoreMode;
|
|
337
|
+
private readonly worker;
|
|
338
|
+
private readonly pending;
|
|
339
|
+
private nextId;
|
|
340
|
+
private disposed;
|
|
341
|
+
private readonly requestTimeoutMs;
|
|
342
|
+
constructor(restoreMode: RestoreMode, options?: TdtDecoderWorkerClientOptions);
|
|
343
|
+
decode(url: string, options?: DecodeTileOptions): Promise<DecodedTile>;
|
|
344
|
+
dispose(): void;
|
|
345
|
+
private takePending;
|
|
346
|
+
private cancelRequest;
|
|
347
|
+
private fail;
|
|
348
|
+
private readonly handleMessage;
|
|
349
|
+
private readonly handleWorkerError;
|
|
350
|
+
}
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/tdt-vts/source.d.ts
|
|
353
|
+
interface SourceDiagnostics {
|
|
354
|
+
onDecoded?: (stats: NormalizeStats & {
|
|
355
|
+
contentType: string | null;
|
|
356
|
+
cacheControl: string | null;
|
|
357
|
+
}, redactedUrl: string) => void;
|
|
358
|
+
onError?: (error: Error, redactedUrl: string) => void;
|
|
359
|
+
}
|
|
360
|
+
interface CreateTdtSourceOptions {
|
|
361
|
+
token: string;
|
|
362
|
+
restoreMode: RestoreMode;
|
|
363
|
+
minZoom?: number;
|
|
364
|
+
maxZoom?: number;
|
|
365
|
+
diagnostics?: SourceDiagnostics;
|
|
366
|
+
decoderOptions?: TdtDecoderWorkerClientOptions;
|
|
367
|
+
}
|
|
368
|
+
interface TdtSourceBundle {
|
|
369
|
+
source: VectorTileSource<FeatureLike>;
|
|
370
|
+
decoder: TdtDecoderWorkerClient;
|
|
371
|
+
}
|
|
372
|
+
declare const createTdtVectorSource: (options: CreateTdtSourceOptions) => TdtSourceBundle;
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/core/emitter.d.ts
|
|
119
375
|
declare const emitter: Emitter<Record<EventType, any>>;
|
|
120
|
-
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region src/core/helper.d.ts
|
|
121
378
|
declare const getLayersDataList: () => any[];
|
|
122
|
-
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region src/layer/ogc-utils.d.ts
|
|
123
381
|
/**
|
|
124
382
|
* 创建WMTS图层
|
|
125
383
|
* @param serverUrl
|
|
126
384
|
*/
|
|
127
385
|
declare const createWmtsLayer: (serverUrl: string) => (config: WmtsSourceOptions) => Promise<TileLayer>;
|
|
128
|
-
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/layer/base-layer.d.ts
|
|
129
388
|
/**
|
|
130
389
|
* 创建杭州规自地图
|
|
131
390
|
* @param layerName - 'hzsyraster' | 'hzsyvector' | 'hzsyvector_dark'
|
|
@@ -137,6 +396,16 @@ declare const createBaseLayer: (layerName?: HzsyType) => Tile<XYZ>;
|
|
|
137
396
|
* @param tk - 天地图TK
|
|
138
397
|
*/
|
|
139
398
|
declare const createMapWorldLayer: (layerName: WorldLayerType, tk?: string) => Tile<WMTS>;
|
|
399
|
+
/**
|
|
400
|
+
* 创建天地图矢量/影像底图组合。
|
|
401
|
+
* @param tk - 天地图访问令牌
|
|
402
|
+
*/
|
|
403
|
+
declare const baseLayers: (tk: string) => {
|
|
404
|
+
baseImgLayer: Tile<XYZ>;
|
|
405
|
+
baseCiaLayer: Tile<XYZ>;
|
|
406
|
+
baseVecLayer: Tile<XYZ>;
|
|
407
|
+
baseCvaLayer: Tile<XYZ>;
|
|
408
|
+
};
|
|
140
409
|
/**
|
|
141
410
|
* 浙江省天地图
|
|
142
411
|
* @param layerName - 图层名称
|
|
@@ -147,26 +416,42 @@ declare const createZheJiangLayer: (layerName?: ZheJiangType, tk?: string) => Ti
|
|
|
147
416
|
* 根据图层名称获取图层
|
|
148
417
|
* @param name
|
|
149
418
|
*/
|
|
150
|
-
declare const getLayerByName: (name: string) => Layer<
|
|
151
|
-
|
|
419
|
+
declare const getLayerByName: (name: string) => Layer<import("node_modules/ol/source").Source, import("node_modules/ol/renderer/Layer").default<any>, {
|
|
420
|
+
[x: string]: any;
|
|
152
421
|
}> | undefined;
|
|
153
422
|
/**
|
|
154
423
|
* 根据图层名称删除图层
|
|
155
424
|
* @param name
|
|
156
425
|
*/
|
|
157
426
|
declare const removeLayerByName: (name: string) => void;
|
|
158
|
-
|
|
427
|
+
//#endregion
|
|
428
|
+
//#region src/layer/raster-layer.d.ts
|
|
429
|
+
interface RasterTransformOptions {
|
|
430
|
+
threads?: number;
|
|
431
|
+
}
|
|
432
|
+
/** 使用 RGB 比例和目标颜色转换栅格图层。 */
|
|
433
|
+
declare const changeSource: (layer: Layer$1, rgbColorArray: number[], ratioArray: number[], options?: RasterTransformOptions) => RasterSource;
|
|
434
|
+
/** 使用 changeSource 创建可显示的 VectorImageLayer。 */
|
|
435
|
+
declare const changeLayer: (layer: Layer$1, rgbColorArray: number[], ratioArray: number[], options?: RasterTransformOptions) => VectorImageLayer<RasterSource>;
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/core/map-context.d.ts
|
|
438
|
+
/** 当前 OpenLayers 单例。集中存放以避免业务模块之间互相引用。 */
|
|
159
439
|
declare let instance: CustomMap;
|
|
440
|
+
//#endregion
|
|
441
|
+
//#region src/map/create-map.d.ts
|
|
160
442
|
declare const createMapInstance: (config?: {}) => CustomMap;
|
|
161
443
|
declare const createMap: (config?: {}) => CustomMap;
|
|
162
444
|
declare const disposeMap: () => void;
|
|
445
|
+
/** 兼容别名;复用 map-ol-utils 现有的完整销毁语义。 */
|
|
446
|
+
declare const disposeInstance: () => void;
|
|
163
447
|
declare const getMapInstance: () => CustomMap;
|
|
164
448
|
declare const resetZoomAndCenter: (center?: [number, number]) => void;
|
|
165
449
|
declare const resetMap: (config?: {
|
|
166
|
-
|
|
167
|
-
|
|
450
|
+
center: [number, number];
|
|
451
|
+
isClearAll: boolean;
|
|
168
452
|
}) => void;
|
|
169
|
-
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region src/overlay/overlay.d.ts
|
|
170
455
|
/**
|
|
171
456
|
* 移除带指定属性键的 Overlay(默认按 'position')
|
|
172
457
|
* @param key
|
|
@@ -183,7 +468,8 @@ declare const createAnimationMarker: (imgUrl: string, data: MassData) => void;
|
|
|
183
468
|
* @param config
|
|
184
469
|
*/
|
|
185
470
|
declare const createOverlay: (config?: Options) => Overlay;
|
|
186
|
-
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/map/view-fit.d.ts
|
|
187
473
|
/**
|
|
188
474
|
* 根据 Array<Coordinate> Fit
|
|
189
475
|
* @param coords
|
|
@@ -205,13 +491,65 @@ declare const setFitViewByGeom: (geom: SimpleGeometry, mapInstance?: CustomMap,
|
|
|
205
491
|
* @param fitOptions
|
|
206
492
|
*/
|
|
207
493
|
declare const setFitViewByLayer: (layer: VectorLayer, mapInstance?: CustomMap, fitOptions?: FitOptions) => void;
|
|
208
|
-
|
|
494
|
+
/** 使用两段缩放动画飞到目标位置。 */
|
|
495
|
+
declare const flyToAnimate: (center: Array<any>[number], zoom?: number) => void;
|
|
496
|
+
//#endregion
|
|
497
|
+
//#region src/interaction/select.d.ts
|
|
209
498
|
/**
|
|
210
499
|
* 创建点击交互
|
|
211
500
|
* @param vectorLayer
|
|
212
501
|
*/
|
|
213
502
|
declare const createSelectByLayer: (vectorLayer: VectorLayer) => Select;
|
|
214
|
-
|
|
503
|
+
/** 按多个 className 创建选择交互。 */
|
|
504
|
+
declare const createLayerSelectByNames: (layerNames: Array<string>, selectedHandler?: (feature: Feature) => void, unSelectHandler?: (feature: Feature) => void) => Select;
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/interaction/draw.d.ts
|
|
507
|
+
/** 为绘制中的线和面追加长度/面积标签。 */
|
|
508
|
+
declare const getDrawStyle: (feature: FeatureLike, drawStyle?: Style | undefined) => Style[];
|
|
509
|
+
/** 创建绘制交互。 */
|
|
510
|
+
declare const createDrawInteraction: (type: Type | undefined, vectorLayer: VectorLayer, openTip?: boolean) => Draw;
|
|
511
|
+
//#endregion
|
|
512
|
+
//#region src/layer/geojson-layer.d.ts
|
|
513
|
+
/** 直接从 GeoJSON 创建矢量图层。 */
|
|
514
|
+
declare const createGeoJsonLayer: (geoJson: any, style: StyleLike | FlatStyleLike | null | undefined, config?: LayerConfig) => VectorLayer<VectorSource<import("node_modules/ol").Feature<import("node_modules/ol/geom").Geometry, {
|
|
515
|
+
[x: string]: any;
|
|
516
|
+
}>>, import("node_modules/ol").Feature<import("node_modules/ol/geom").Geometry, {
|
|
517
|
+
[x: string]: any;
|
|
518
|
+
}>>;
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region src/layer/marker-layer.d.ts
|
|
521
|
+
/** 创建 Marker 文本标注。 */
|
|
522
|
+
declare const createText: (item: DataItemConfig) => Text;
|
|
523
|
+
/** 创建 Marker 默认态或激活态样式。 */
|
|
524
|
+
declare const createIconStyle: (item: DataItemConfig, active?: boolean) => Style;
|
|
525
|
+
/** 创建带 data 属性约定的 Marker Feature。 */
|
|
526
|
+
declare const createMarker: (item: DataItemConfig, config: LayerConfig) => Feature$1<Point$1, {
|
|
527
|
+
[x: string]: any;
|
|
528
|
+
}>;
|
|
529
|
+
/** 批量创建 Marker 矢量图层。 */
|
|
530
|
+
declare const createMarkersLayer: (dataList: Array<DataItemConfig>, config: LayerConfig) => VectorLayer<VectorSource<Feature$1<Geometry, {
|
|
531
|
+
[x: string]: any;
|
|
532
|
+
}>>, Feature$1<Geometry, {
|
|
533
|
+
[x: string]: any;
|
|
534
|
+
}>>;
|
|
535
|
+
/** 清空外部选择集合并恢复 Marker 未选中样式。 */
|
|
536
|
+
declare const changeUnselectStyle: (featureList: Collection<Feature$1>) => void;
|
|
537
|
+
/** 创建随缩放级别切换小图/大图的 Marker 图层。 */
|
|
538
|
+
declare const createElasticMarkerLayer: (dataList: Array<ElasticDataItemConfig>, config: LayerConfig) => VectorLayer<VectorSource<Feature$1<Geometry, {
|
|
539
|
+
[x: string]: any;
|
|
540
|
+
}>>, Feature$1<Geometry, {
|
|
541
|
+
[x: string]: any;
|
|
542
|
+
}>>;
|
|
543
|
+
/** 创建单 Marker 图层并直接加入当前地图实例。 */
|
|
544
|
+
declare const createMoveMarkerLayer: (dataItem: DataItemConfig, config: LayerConfig) => {
|
|
545
|
+
vectorLayer: VectorLayer<VectorSource<Feature$1<Point$1, {
|
|
546
|
+
[x: string]: any;
|
|
547
|
+
}>>, Feature$1<Point$1, {
|
|
548
|
+
[x: string]: any;
|
|
549
|
+
}>>;
|
|
550
|
+
};
|
|
551
|
+
//#endregion
|
|
552
|
+
//#region src/layer/layer-manager.d.ts
|
|
215
553
|
/**
|
|
216
554
|
* 重置激活的矢量数据(清空 overlay 与各图层选择交互的要素集合)
|
|
217
555
|
*/
|
|
@@ -229,16 +567,17 @@ declare const resetActiveFeature: () => void;
|
|
|
229
567
|
* @param uid
|
|
230
568
|
*/
|
|
231
569
|
declare const activeFeatureByUid: (uid: string) => void;
|
|
232
|
-
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region src/layer/vector-layer.d.ts
|
|
233
572
|
/**
|
|
234
573
|
* 创建业务矢量图层(自动推断线/面,生成默认/激活样式)
|
|
235
574
|
* @param dataList
|
|
236
575
|
* @param config
|
|
237
576
|
*/
|
|
238
|
-
declare const createBusinessLayer: (dataList: MassData[], config: VectorConfig) => VectorLayer<VectorSource<Feature<
|
|
239
|
-
|
|
240
|
-
}>>, Feature<
|
|
241
|
-
|
|
577
|
+
declare const createBusinessLayer: (dataList: MassData[], config: VectorConfig) => VectorLayer<VectorSource<Feature<import("node_modules/ol/geom").Geometry, {
|
|
578
|
+
[x: string]: any;
|
|
579
|
+
}>>, Feature<import("node_modules/ol/geom").Geometry, {
|
|
580
|
+
[x: string]: any;
|
|
242
581
|
}>>;
|
|
243
582
|
/**
|
|
244
583
|
* 追加 Features
|
|
@@ -252,22 +591,23 @@ declare const appendFeaturesByLayer: (targetLayer: VectorLayer, dataList: MassDa
|
|
|
252
591
|
* @param dataList
|
|
253
592
|
* @param config
|
|
254
593
|
*/
|
|
255
|
-
declare const createVectorFaceLayer: (dataList: MassData[] | undefined, config: VectorConfig) => VectorLayer<VectorSource<Feature<
|
|
256
|
-
|
|
257
|
-
}>>, Feature<
|
|
258
|
-
|
|
594
|
+
declare const createVectorFaceLayer: (dataList: MassData[] | undefined, config: VectorConfig) => VectorLayer<VectorSource<Feature<import("node_modules/ol/geom").Geometry, {
|
|
595
|
+
[x: string]: any;
|
|
596
|
+
}>>, Feature<import("node_modules/ol/geom").Geometry, {
|
|
597
|
+
[x: string]: any;
|
|
259
598
|
}>>;
|
|
260
599
|
/**
|
|
261
600
|
* 创建矢量线图层
|
|
262
601
|
* @param dataList
|
|
263
602
|
* @param config
|
|
264
603
|
*/
|
|
265
|
-
declare const createVectorLineLayer: (dataList: MassData[] | undefined, config: VectorConfig) => VectorLayer<VectorSource<Feature<
|
|
266
|
-
|
|
267
|
-
}>>, Feature<
|
|
268
|
-
|
|
604
|
+
declare const createVectorLineLayer: (dataList: MassData[] | undefined, config: VectorConfig) => VectorLayer<VectorSource<Feature<import("node_modules/ol/geom").Geometry, {
|
|
605
|
+
[x: string]: any;
|
|
606
|
+
}>>, Feature<import("node_modules/ol/geom").Geometry, {
|
|
607
|
+
[x: string]: any;
|
|
269
608
|
}>>;
|
|
270
|
-
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region src/layer/mass-marks.d.ts
|
|
271
611
|
/**
|
|
272
612
|
* 构建 MassMarks 样式数组(默认段 + 激活段,长度 statusNum * 2)
|
|
273
613
|
*/
|
|
@@ -278,8 +618,8 @@ declare const buildMassMarksStyles: (getImgUrlFn: GetImgUrlFn) => (iconConfig: I
|
|
|
278
618
|
* @param dataList
|
|
279
619
|
* @param config
|
|
280
620
|
*/
|
|
281
|
-
declare const addFeaturesByLayer: (targetLayer: VectorLayer, dataList: MassData[], config
|
|
282
|
-
|
|
621
|
+
declare const addFeaturesByLayer: (targetLayer: VectorLayer, dataList: MassData[], config?: {
|
|
622
|
+
clear?: boolean;
|
|
283
623
|
}) => void;
|
|
284
624
|
/**
|
|
285
625
|
* 创建 massMarksLayer
|
|
@@ -287,34 +627,35 @@ declare const addFeaturesByLayer: (targetLayer: VectorLayer, dataList: MassData[
|
|
|
287
627
|
* @param styleList
|
|
288
628
|
*/
|
|
289
629
|
declare const createMassMarksLayer: (dataList: MassData[], styleList?: StyleLike[]) => VectorLayer<VectorSource<Feature<Point, {
|
|
290
|
-
|
|
630
|
+
[x: string]: any;
|
|
291
631
|
}>>, Feature<Point, {
|
|
292
|
-
|
|
632
|
+
[x: string]: any;
|
|
293
633
|
}>>;
|
|
294
634
|
/**
|
|
295
635
|
* 添加 massMarksLayer(按需附带线/面图层)
|
|
296
636
|
* @param getImgUrlFn
|
|
297
637
|
*/
|
|
298
638
|
declare const addMassMarksLayer: (getImgUrlFn: GetImgUrlFn) => (dataList: never[] | undefined, iconConfig: IconConfig, openClick?: boolean) => VectorLayer<VectorSource<Feature<Point, {
|
|
299
|
-
|
|
639
|
+
[x: string]: any;
|
|
300
640
|
}>>, Feature<Point, {
|
|
301
|
-
|
|
641
|
+
[x: string]: any;
|
|
302
642
|
}>>;
|
|
303
643
|
/**
|
|
304
644
|
* 按选中状态列表更新海量点显隐
|
|
305
645
|
* @param checkedStatusList
|
|
306
646
|
*/
|
|
307
647
|
declare const updateMarksLayersByStatus: (checkedStatusList?: string[]) => MassData[];
|
|
308
|
-
|
|
648
|
+
//#endregion
|
|
649
|
+
//#region src/layer/cluster-layer.d.ts
|
|
309
650
|
/**
|
|
310
651
|
* 创建聚合图层(半径/颜色随聚合数量动态计算)
|
|
311
652
|
* @param dataList
|
|
312
653
|
* @param config
|
|
313
654
|
*/
|
|
314
655
|
declare const createClusterLayer: (dataList: ClusterData[], config: ClusterConfig) => VectorLayer<Cluster<Feature<Point, {
|
|
315
|
-
|
|
316
|
-
}>>, Feature<
|
|
317
|
-
|
|
656
|
+
[x: string]: any;
|
|
657
|
+
}>>, Feature<import("node_modules/ol/geom").Geometry, {
|
|
658
|
+
[x: string]: any;
|
|
318
659
|
}>>;
|
|
319
|
-
|
|
320
|
-
export {
|
|
660
|
+
//#endregion
|
|
661
|
+
export { ClusterConfig, ClusterData, type CreateTdtSourceOptions, CustomMap, DataItemConfig, type DecodedTile, ElasticDataItemConfig, GeometryCoordinates, GeometryType, GetImgUrl, GetImgUrlFn, HzsyType, IconConfig, type JsonStyleDocument, type JsonStyleLayer, LayerConfig, type LayerStats, type LoadStyleOptions, type LoadTdtVtsOptions, type LoadedTdtTile, MassData, type MvtFeature, type MvtGeometryType, type MvtLayer, type MvtLayout, type MvtTile, type MvtValue, type NormalizeOptions, type NormalizeResult, type NormalizeStats, type RestoreMode, type SourceDiagnostics, TDT_VECTOR_SOURCE_ID, TDT_XOR_BYTE_INDEXES, TdtDecoderWorkerClient, type TdtSourceBundle, type TdtStyleBundle, type TdtTileResponseStats, type TdtVtsUrlOptions, type TileCoordinate, VectorConfig, WmtsSourceOptions, WorldLayerType, ZheJiangType, activeFeatureByUid, addFeaturesByLayer, addMassMarksLayer, appendFeaturesByLayer, baseLayers, buildMassMarksStyles, changeLayer, changeSource, changeUnselectStyle, createAnimationMarker, createBaseLayer, createBusinessLayer, createClusterLayer, createDrawInteraction, createElasticMarkerLayer, createGeoJsonLayer, createIconStyle, createLayerSelectByNames, createMap, createMapInstance, createMapWorldLayer, createMarker, createMarkersLayer, createMassMarksLayer, createMoveMarkerLayer, createOverlay, createSelectByLayer, createTdtVectorSource, createTdtVtsUrl, createText, createVectorFaceLayer, createVectorLineLayer, createWmtsLayer, createZheJiangLayer, decodeMvt, decodeTdtPk, disposeInstance, disposeMap, emitter, encodeStandardMvt, encodeTdtPk, flyToAnimate, getConstantBackgroundColor, getDrawStyle, getLayerByName, getLayersDataList, getMapInstance, instance, loadAndNormalizeTdtVts, loadTdtStyleBundle, mergeTdtStyleLayers, normalizePrivateGeometry, normalizePrivateMvt, privateTypeToStandard, redactTdtToken, removeAllLayers, removeLayerByName, removeOverlays, resetActiveFeature, resetActiveVector, resetMap, resetZoomAndCenter, resolveFeatureProperties, restoreTdtBytes, setFitViewByCoords, setFitViewByGeom, setFitViewByLayer, updateMarksLayersByStatus };
|