@loaders.gl/loader-utils 4.3.0-alpha.2 → 4.3.0-alpha.3
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/dist/index.cjs +112 -3
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/json-loader.js +1 -1
- package/dist/lib/file-provider/data-view-file.d.ts +2 -2
- package/dist/lib/file-provider/data-view-file.d.ts.map +1 -1
- package/dist/lib/file-provider/file-handle-file.d.ts +2 -2
- package/dist/lib/file-provider/file-handle-file.d.ts.map +1 -1
- package/dist/lib/file-provider/file-provider-interface.d.ts +45 -0
- package/dist/lib/file-provider/file-provider-interface.d.ts.map +1 -0
- package/dist/lib/file-provider/file-provider-interface.js +9 -0
- package/dist/lib/file-provider/file-provider.d.ts +28 -17
- package/dist/lib/file-provider/file-provider.d.ts.map +1 -1
- package/dist/lib/file-provider/file-provider.js +104 -7
- package/dist/lib/log-utils/log.js +1 -1
- package/dist/lib/sources/data-source.d.ts +1 -0
- package/dist/lib/sources/data-source.d.ts.map +1 -1
- package/dist/lib/sources/image-source.d.ts +11 -13
- package/dist/lib/sources/image-source.d.ts.map +1 -1
- package/dist/lib/sources/image-source.js +1 -3
- package/dist/lib/sources/image-tile-source.d.ts +4 -2
- package/dist/lib/sources/image-tile-source.d.ts.map +1 -1
- package/dist/lib/sources/tile-source-adapter.d.ts.map +1 -1
- package/dist/lib/sources/tile-source-adapter.js +1 -0
- package/dist/lib/sources/tile-source.d.ts +18 -14
- package/dist/lib/sources/tile-source.d.ts.map +1 -1
- package/dist/lib/sources/utils/utils.d.ts +1 -1
- package/dist/lib/sources/utils/utils.d.ts.map +1 -1
- package/dist/lib/sources/utils/utils.js +1 -1
- package/dist/lib/sources/vector-source.d.ts +61 -0
- package/dist/lib/sources/vector-source.d.ts.map +1 -0
- package/dist/lib/sources/vector-source.js +13 -0
- package/dist/lib/sources/vector-tile-source.d.ts +1 -1
- package/dist/lib/sources/vector-tile-source.d.ts.map +1 -1
- package/dist/source-types.d.ts +39 -0
- package/dist/source-types.d.ts.map +1 -0
- package/package.json +5 -4
- package/src/index.ts +8 -3
- package/src/lib/file-provider/data-view-file.ts +2 -2
- package/src/lib/file-provider/file-handle-file.ts +2 -2
- package/src/lib/file-provider/file-provider-interface.ts +56 -0
- package/src/lib/file-provider/file-provider.ts +95 -25
- package/src/lib/sources/data-source.ts +1 -0
- package/src/lib/sources/image-source.ts +19 -18
- package/src/lib/sources/image-tile-source.ts +8 -3
- package/src/lib/sources/tile-source-adapter.ts +1 -0
- package/src/lib/sources/tile-source.ts +26 -19
- package/src/lib/sources/utils/utils.ts +1 -1
- package/src/lib/sources/vector-source.ts +74 -0
- package/src/lib/sources/vector-tile-source.ts +4 -2
- package/src/source-types.ts +49 -0
- package/dist/service-types.d.ts +0 -10
- package/dist/service-types.d.ts.map +0 -1
- package/src/service-types.ts +0 -14
- /package/dist/{service-types.js → source-types.js} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for providing file data
|
|
3
|
+
*/
|
|
4
|
+
export interface FileProviderInterface {
|
|
5
|
+
/**
|
|
6
|
+
* Cleanup class data
|
|
7
|
+
*/
|
|
8
|
+
destroy(): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Gets an unsigned 8-bit integer at the specified byte offset from the start of the file.
|
|
11
|
+
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
12
|
+
*/
|
|
13
|
+
getUint8(offset: bigint): Promise<number>;
|
|
14
|
+
/**
|
|
15
|
+
* Gets an unsigned 16-bit integer at the specified byte offset from the start of the file.
|
|
16
|
+
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
17
|
+
*/
|
|
18
|
+
getUint16(offset: bigint): Promise<number>;
|
|
19
|
+
/**
|
|
20
|
+
* Gets an unsigned 32-bit integer at the specified byte offset from the start of the file.
|
|
21
|
+
* @param offset The offset, in bytes, from the file of the view where to read the data.
|
|
22
|
+
*/
|
|
23
|
+
getUint32(offset: bigint): Promise<number>;
|
|
24
|
+
/**
|
|
25
|
+
* Gets an unsigned 32-bit integer at the specified byte offset from the start of the file.
|
|
26
|
+
* @param offset The offset, in byte, from the file of the view where to read the data.
|
|
27
|
+
*/
|
|
28
|
+
getBigUint64(offset: bigint): Promise<bigint>;
|
|
29
|
+
/**
|
|
30
|
+
* returns an ArrayBuffer whose contents are a copy of this file bytes from startOffset, inclusive, up to endOffset, exclusive.
|
|
31
|
+
* @param startOffset The offset, in bytes, from the start of the file where to start reading the data.
|
|
32
|
+
* @param endOffset The offset, in bytes, from the start of the file where to end reading the data.
|
|
33
|
+
*/
|
|
34
|
+
slice(startOffset: bigint, endOffset: bigint): Promise<ArrayBuffer>;
|
|
35
|
+
/**
|
|
36
|
+
* the length (in bytes) of the data.
|
|
37
|
+
*/
|
|
38
|
+
length: bigint;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Check is the object has FileProvider members
|
|
42
|
+
* @param fileProvider - tested object
|
|
43
|
+
*/
|
|
44
|
+
export declare const isFileProvider: (fileProvider: unknown) => bigint;
|
|
45
|
+
//# sourceMappingURL=file-provider-interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-provider-interface.d.ts","sourceRoot":"","sources":["../../../src/lib/file-provider/file-provider-interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3C;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3C;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9C;;;;OAIG;IACH,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEpE;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,iBAAkB,OAAO,WAMnD,CAAC"}
|
|
@@ -1,46 +1,57 @@
|
|
|
1
|
+
import { ReadableFile } from "../files/file.js";
|
|
2
|
+
import { FileProviderInterface } from "./file-provider-interface.js";
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
4
|
+
* Provides file data using range requests to the server
|
|
3
5
|
* @deprecated - will be replaced with ReadableFile
|
|
4
6
|
*/
|
|
5
|
-
export
|
|
7
|
+
export declare class FileProvider implements FileProviderInterface {
|
|
8
|
+
/** The File object from which data is provided */
|
|
9
|
+
private file;
|
|
10
|
+
private size;
|
|
11
|
+
/** Create a new BrowserFile */
|
|
12
|
+
private constructor();
|
|
13
|
+
static create(file: ReadableFile): Promise<FileProvider>;
|
|
6
14
|
/**
|
|
7
|
-
*
|
|
15
|
+
* Truncates the file descriptor.
|
|
16
|
+
* @param length desired file lenght
|
|
8
17
|
*/
|
|
18
|
+
truncate(length: number): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Append data to a file.
|
|
21
|
+
* @param buffer data to append
|
|
22
|
+
*/
|
|
23
|
+
append(buffer: Uint8Array): Promise<void>;
|
|
24
|
+
/** Close file */
|
|
9
25
|
destroy(): Promise<void>;
|
|
10
26
|
/**
|
|
11
27
|
* Gets an unsigned 8-bit integer at the specified byte offset from the start of the file.
|
|
12
28
|
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
13
29
|
*/
|
|
14
|
-
getUint8(offset: bigint): Promise<number>;
|
|
30
|
+
getUint8(offset: number | bigint): Promise<number>;
|
|
15
31
|
/**
|
|
16
32
|
* Gets an unsigned 16-bit integer at the specified byte offset from the start of the file.
|
|
17
33
|
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
18
34
|
*/
|
|
19
|
-
getUint16(offset: bigint): Promise<number>;
|
|
35
|
+
getUint16(offset: number | bigint): Promise<number>;
|
|
20
36
|
/**
|
|
21
37
|
* Gets an unsigned 32-bit integer at the specified byte offset from the start of the file.
|
|
22
|
-
* @param offset The offset, in bytes, from the
|
|
38
|
+
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
23
39
|
*/
|
|
24
|
-
getUint32(offset: bigint): Promise<number>;
|
|
40
|
+
getUint32(offset: number | bigint): Promise<number>;
|
|
25
41
|
/**
|
|
26
42
|
* Gets an unsigned 32-bit integer at the specified byte offset from the start of the file.
|
|
27
|
-
* @param offset The offset, in
|
|
43
|
+
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
28
44
|
*/
|
|
29
|
-
getBigUint64(offset: bigint): Promise<bigint>;
|
|
45
|
+
getBigUint64(offset: number | bigint): Promise<bigint>;
|
|
30
46
|
/**
|
|
31
47
|
* returns an ArrayBuffer whose contents are a copy of this file bytes from startOffset, inclusive, up to endOffset, exclusive.
|
|
32
|
-
* @param startOffset The offset, in
|
|
48
|
+
* @param startOffset The offset, in byte, from the start of the file where to start reading the data.
|
|
33
49
|
* @param endOffset The offset, in bytes, from the start of the file where to end reading the data.
|
|
34
50
|
*/
|
|
35
|
-
slice(startOffset: bigint, endOffset: bigint): Promise<ArrayBuffer>;
|
|
51
|
+
slice(startOffset: bigint | number, endOffset: bigint | number): Promise<ArrayBuffer>;
|
|
36
52
|
/**
|
|
37
53
|
* the length (in bytes) of the data.
|
|
38
54
|
*/
|
|
39
|
-
length: bigint;
|
|
55
|
+
get length(): bigint;
|
|
40
56
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Check is the object has FileProvider members
|
|
43
|
-
* @param fileProvider - tested object
|
|
44
|
-
*/
|
|
45
|
-
export declare const isFileProvider: (fileProvider: unknown) => bigint;
|
|
46
57
|
//# sourceMappingURL=file-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-provider.d.ts","sourceRoot":"","sources":["../../../src/lib/file-provider/file-provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-provider.d.ts","sourceRoot":"","sources":["../../../src/lib/file-provider/file-provider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,YAAY,EAAC,yBAAsB;AAC3C,OAAO,EAAC,qBAAqB,EAAC,qCAAkC;AAEhE;;;GAGG;AACH,qBAAa,YAAa,YAAW,qBAAqB;IACxD,kDAAkD;IAClD,OAAO,CAAC,IAAI,CAAe;IAC3B,OAAO,CAAC,IAAI,CAAS;IAErB,+BAA+B;IAC/B,OAAO;WAKM,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAW9D;;;OAGG;IACG,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C;;;OAGG;IACG,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C,iBAAiB;IACX,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;;OAGG;IACG,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASxD;;;OAGG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASzD;;;OAGG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASzD;;;OAGG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAS5D;;;;OAIG;IACG,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAU3F;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;CACF"}
|
|
@@ -1,9 +1,106 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @
|
|
2
|
+
* Provides file data using range requests to the server
|
|
3
|
+
* @deprecated - will be replaced with ReadableFile
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export class FileProvider {
|
|
6
|
+
/** The File object from which data is provided */
|
|
7
|
+
file;
|
|
8
|
+
size;
|
|
9
|
+
/** Create a new BrowserFile */
|
|
10
|
+
constructor(file, size) {
|
|
11
|
+
this.file = file;
|
|
12
|
+
this.size = BigInt(size);
|
|
13
|
+
}
|
|
14
|
+
static async create(file) {
|
|
15
|
+
return new FileProvider(file, file.bigsize > 0n
|
|
16
|
+
? file.bigsize
|
|
17
|
+
: file.size > 0n
|
|
18
|
+
? file.size
|
|
19
|
+
: (await file.stat?.())?.bigsize ?? 0n);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Truncates the file descriptor.
|
|
23
|
+
* @param length desired file lenght
|
|
24
|
+
*/
|
|
25
|
+
async truncate(length) {
|
|
26
|
+
throw new Error('file loaded via range requests cannot be changed');
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Append data to a file.
|
|
30
|
+
* @param buffer data to append
|
|
31
|
+
*/
|
|
32
|
+
async append(buffer) {
|
|
33
|
+
throw new Error('file loaded via range requests cannot be changed');
|
|
34
|
+
}
|
|
35
|
+
/** Close file */
|
|
36
|
+
async destroy() {
|
|
37
|
+
throw new Error('file loaded via range requests cannot be changed');
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Gets an unsigned 8-bit integer at the specified byte offset from the start of the file.
|
|
41
|
+
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
42
|
+
*/
|
|
43
|
+
async getUint8(offset) {
|
|
44
|
+
const arrayBuffer = await this.file.read(offset, 1);
|
|
45
|
+
const val = new Uint8Array(arrayBuffer).at(0);
|
|
46
|
+
if (val === undefined) {
|
|
47
|
+
throw new Error('something went wrong');
|
|
48
|
+
}
|
|
49
|
+
return val;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Gets an unsigned 16-bit integer at the specified byte offset from the start of the file.
|
|
53
|
+
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
54
|
+
*/
|
|
55
|
+
async getUint16(offset) {
|
|
56
|
+
const arrayBuffer = await this.file.read(offset, 2);
|
|
57
|
+
const val = new Uint16Array(arrayBuffer).at(0);
|
|
58
|
+
if (val === undefined) {
|
|
59
|
+
throw new Error('something went wrong');
|
|
60
|
+
}
|
|
61
|
+
return val;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Gets an unsigned 32-bit integer at the specified byte offset from the start of the file.
|
|
65
|
+
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
66
|
+
*/
|
|
67
|
+
async getUint32(offset) {
|
|
68
|
+
const arrayBuffer = await this.file.read(offset, 4);
|
|
69
|
+
const val = new Uint32Array(arrayBuffer).at(0);
|
|
70
|
+
if (val === undefined) {
|
|
71
|
+
throw new Error('something went wrong');
|
|
72
|
+
}
|
|
73
|
+
return val;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Gets an unsigned 32-bit integer at the specified byte offset from the start of the file.
|
|
77
|
+
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
78
|
+
*/
|
|
79
|
+
async getBigUint64(offset) {
|
|
80
|
+
const arrayBuffer = await this.file.read(offset, 8);
|
|
81
|
+
const val = new BigInt64Array(arrayBuffer).at(0);
|
|
82
|
+
if (val === undefined) {
|
|
83
|
+
throw new Error('something went wrong');
|
|
84
|
+
}
|
|
85
|
+
return val;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* returns an ArrayBuffer whose contents are a copy of this file bytes from startOffset, inclusive, up to endOffset, exclusive.
|
|
89
|
+
* @param startOffset The offset, in byte, from the start of the file where to start reading the data.
|
|
90
|
+
* @param endOffset The offset, in bytes, from the start of the file where to end reading the data.
|
|
91
|
+
*/
|
|
92
|
+
async slice(startOffset, endOffset) {
|
|
93
|
+
const bigLength = BigInt(endOffset) - BigInt(startOffset);
|
|
94
|
+
if (bigLength > Number.MAX_SAFE_INTEGER) {
|
|
95
|
+
throw new Error('too big slice');
|
|
96
|
+
}
|
|
97
|
+
const length = Number(bigLength);
|
|
98
|
+
return await this.file.read(startOffset, length);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* the length (in bytes) of the data.
|
|
102
|
+
*/
|
|
103
|
+
get length() {
|
|
104
|
+
return this.size;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -5,7 +5,7 @@ import { Log } from '@probe.gl/log';
|
|
|
5
5
|
// Version constant cannot be imported, it needs to correspond to the build version of **this** module.
|
|
6
6
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
7
7
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
8
|
-
export const VERSION = typeof "4.3.0-alpha.
|
|
8
|
+
export const VERSION = typeof "4.3.0-alpha.2" !== 'undefined' ? "4.3.0-alpha.2" : 'latest';
|
|
9
9
|
const version = VERSION[0] >= '0' && VERSION[0] <= '9' ? `v${VERSION}` : '';
|
|
10
10
|
// Make sure we set the global variable
|
|
11
11
|
function createLog() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
2
|
/** Common properties for all data sources */
|
|
3
3
|
export type DataSourceProps = {
|
|
4
|
+
url?: string | Blob;
|
|
4
5
|
/** LoaderOptions provide an option to override `fetch`. Will also be passed to any sub loaders */
|
|
5
6
|
loadOptions?: LoaderOptions;
|
|
6
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/data-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D,6CAA6C;AAC7C,MAAM,MAAM,eAAe,GAAG;IAC5B,kGAAkG;IAClG,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B,CAAC;AAEF,qCAAqC;AACrC,8BAAsB,UAAU,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe;IAC/E,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,gEAAgE;IAChE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjE,8DAA8D;IAC9D,WAAW,EAAE,aAAa,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAQ;IAE9B,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,MAAM;IAMzB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAMtB,0DAA0D;IAC1D,eAAe,IAAI,IAAI;IAIvB;;;OAGG;IACH,eAAe,CAAC,KAAK,GAAE,OAAc;CAOtC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,aAAa,SAKvC,MAAM,iBAAiB,WAAW,uBAWlD"}
|
|
1
|
+
{"version":3,"file":"data-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/data-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D,6CAA6C;AAC7C,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,kGAAkG;IAClG,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B,CAAC;AAEF,qCAAqC;AACrC,8BAAsB,UAAU,CAAC,MAAM,SAAS,eAAe,GAAG,eAAe;IAC/E,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,gEAAgE;IAChE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjE,8DAA8D;IAC9D,WAAW,EAAE,aAAa,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAQ;IAE9B,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,MAAM;IAMzB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAMtB,0DAA0D;IAC1D,eAAe,IAAI,IAAI;IAIvB;;;OAGG;IACH,eAAe,CAAC,KAAK,GAAE,OAAc;CAOtC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,aAAa,SAKvC,MAAM,iBAAiB,WAAW,uBAWlD"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import type { DataSourceProps } from "./data-source.js";
|
|
2
2
|
import { DataSource } from "./data-source.js";
|
|
3
3
|
import { ImageType } from "./utils/image-type.js";
|
|
4
|
+
export type ImageSourceProps = DataSourceProps;
|
|
5
|
+
/**
|
|
6
|
+
* ImageSource - data sources that allow images to be queried by (geospatial) extents
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class ImageSource<PropsT extends ImageSourceProps = ImageSourceProps> extends DataSource<PropsT> {
|
|
9
|
+
static type: string;
|
|
10
|
+
static testURL: (url: string) => boolean;
|
|
11
|
+
abstract getMetadata(): Promise<ImageSourceMetadata>;
|
|
12
|
+
abstract getImage(parameters: GetImageParameters): Promise<ImageType>;
|
|
13
|
+
}
|
|
4
14
|
/**
|
|
5
15
|
* Normalized capabilities of an Image service
|
|
6
16
|
* @example
|
|
7
|
-
* The
|
|
17
|
+
* The WMSSourceLoader will normalize the response to the WMS `GetCapabilities`
|
|
8
18
|
* data structure extracted from WMS XML response into an ImageSourceMetadata.
|
|
9
19
|
*/
|
|
10
20
|
export type ImageSourceMetadata = {
|
|
@@ -46,16 +56,4 @@ export type GetImageParameters = {
|
|
|
46
56
|
/** requested format for the return image */
|
|
47
57
|
format?: 'image/png';
|
|
48
58
|
};
|
|
49
|
-
export type ImageSourceProps = DataSourceProps;
|
|
50
|
-
/**
|
|
51
|
-
* MapImageSource - data sources that allow data to be queried by (geospatial) extents
|
|
52
|
-
* @note
|
|
53
|
-
* - If geospatial, bounding box is expected to be in web mercator coordinates
|
|
54
|
-
*/
|
|
55
|
-
export declare abstract class ImageSource<PropsT extends ImageSourceProps = ImageSourceProps> extends DataSource<PropsT> {
|
|
56
|
-
static type: string;
|
|
57
|
-
static testURL: (url: string) => boolean;
|
|
58
|
-
abstract getMetadata(): Promise<ImageSourceMetadata>;
|
|
59
|
-
abstract getImage(parameters: GetImageParameters): Promise<ImageType>;
|
|
60
|
-
}
|
|
61
59
|
//# sourceMappingURL=image-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/image-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,yBAAsB;AACnD,OAAO,EAAC,UAAU,EAAC,yBAAsB;
|
|
1
|
+
{"version":3,"file":"image-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/image-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,yBAAsB;AACnD,OAAO,EAAC,UAAU,EAAC,yBAAsB;AAEzC,OAAO,EAAC,SAAS,EAAC,8BAA2B;AAE7C,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAE/C;;GAEG;AACH,8BAAsB,WAAW,CAC/B,MAAM,SAAS,gBAAgB,GAAG,gBAAgB,CAClD,SAAQ,UAAU,CAAC,MAAM,CAAC;IAC1B,MAAM,CAAC,IAAI,EAAE,MAAM,CAAc;IACjC,MAAM,CAAC,OAAO,QAAS,MAAM,KA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kC;IAClC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa;IACb,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC"}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { DataSource } from "./data-source.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @note
|
|
8
|
-
* - If geospatial, bounding box is expected to be in web mercator coordinates
|
|
6
|
+
* ImageSource - data sources that allow images to be queried by (geospatial) extents
|
|
9
7
|
*/
|
|
10
8
|
export class ImageSource extends DataSource {
|
|
11
9
|
static type = 'template';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ImageType } from "./utils/image-type.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { TileSourceProps, TileSourceMetadata, GetTileParameters } from "./tile-source.js";
|
|
3
|
+
import type { TileSource } from "./tile-source.js";
|
|
4
|
+
export type ImageTileSourceProps = TileSourceProps;
|
|
3
5
|
/**
|
|
4
6
|
* MapTileSource - data sources that allow data to be queried by (geospatial) tile
|
|
5
7
|
* @note If geospatial, bounding box is expected to be in web mercator coordinates
|
|
6
8
|
*/
|
|
7
|
-
export interface ImageTileSource<MetadataT extends TileSourceMetadata = TileSourceMetadata> extends TileSource<MetadataT> {
|
|
9
|
+
export interface ImageTileSource<PropsT extends TileSourceProps = TileSourceProps, MetadataT extends TileSourceMetadata = TileSourceMetadata> extends TileSource<PropsT, MetadataT> {
|
|
8
10
|
getImageTile(parameters: GetTileParameters): Promise<ImageType | null>;
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=image-tile-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-tile-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/image-tile-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,SAAS,EAAC,8BAA2B;AAClD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"image-tile-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/image-tile-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,SAAS,EAAC,8BAA2B;AAClD,OAAO,KAAK,EAAC,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAC,yBAAsB;AAC1F,OAAO,KAAK,EAAC,UAAU,EAAC,yBAAsB;AAE9C,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,eAAe,CAC9B,MAAM,SAAS,eAAe,GAAG,eAAe,EAChD,SAAS,SAAS,kBAAkB,GAAG,kBAAkB,CACzD,SAAQ,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC;IACrC,YAAY,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;CACxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile-source-adapter.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/tile-source-adapter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAE,iBAAiB,EAAE,qBAAqB,EAAC,yBAAsB;AACnF,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAC,0BAAuB;AAEhE;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"tile-source-adapter.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/tile-source-adapter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,UAAU,EAAE,iBAAiB,EAAE,qBAAqB,EAAC,yBAAsB;AACnF,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAC,0BAAuB;AAEhE;;;;GAIG;AAEH,qBAAa,iBAAkB,YAAW,UAAU,CAAC,mBAAmB,CAAC;IACvE,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC;gBACzB,MAAM,EAAE,WAAW;IAGzB,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAIjD,sBAAsB;IACtB,OAAO,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAOxD,+BAA+B;IAC/B,WAAW,CAAC,UAAU,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAIvE,gEAAgE;IAChE,SAAS,CAAC,kBAAkB,CAC1B,UAAU,EAAE,iBAAiB,GAC5B,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAc7D,sBAAsB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAO7E"}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
import type { DataSourceProps } from "./data-source.js";
|
|
2
|
+
import { DataSource } from "./data-source.js";
|
|
3
|
+
/**
|
|
4
|
+
* Props for a TileSource
|
|
5
|
+
*/
|
|
6
|
+
export type TileSourceProps = DataSourceProps;
|
|
7
|
+
/**
|
|
8
|
+
* MapTileSource - data sources that allow data to be queried by (geospatial) extents
|
|
9
|
+
* @note
|
|
10
|
+
* - If geospatial, bounding box is expected to be in web mercator coordinates
|
|
11
|
+
*/
|
|
12
|
+
export interface TileSource<PropsT extends TileSourceProps = TileSourceProps, MetadataT extends TileSourceMetadata = TileSourceMetadata> extends DataSource<PropsT> {
|
|
13
|
+
getMetadata(): Promise<MetadataT>;
|
|
14
|
+
/** Flat parameters */
|
|
15
|
+
getTile(parameters: GetTileParameters): Promise<unknown | null>;
|
|
16
|
+
/** deck.gl compatibility: TileLayer and MTVLayer */
|
|
17
|
+
getTileData(parameters: GetTileDataParameters): Promise<unknown | null>;
|
|
18
|
+
}
|
|
1
19
|
/**
|
|
2
20
|
* Normalized capabilities of an tile service
|
|
3
21
|
* Sources are expected to normalize the response to capabilities
|
|
@@ -89,18 +107,4 @@ export type NonGeoBoundingBox = {
|
|
|
89
107
|
right: number;
|
|
90
108
|
bottom: number;
|
|
91
109
|
};
|
|
92
|
-
/** Props for a TileSource */
|
|
93
|
-
export type TileSourceProps = {};
|
|
94
|
-
/**
|
|
95
|
-
* MapTileSource - data sources that allow data to be queried by (geospatial) extents
|
|
96
|
-
* @note
|
|
97
|
-
* - If geospatial, bounding box is expected to be in web mercator coordinates
|
|
98
|
-
*/
|
|
99
|
-
export interface TileSource<MetadataT extends TileSourceMetadata> {
|
|
100
|
-
getMetadata(): Promise<MetadataT>;
|
|
101
|
-
/** Flat parameters */
|
|
102
|
-
getTile(parameters: GetTileParameters): Promise<unknown | null>;
|
|
103
|
-
/** deck.gl compatibility: TileLayer and MTVLayer */
|
|
104
|
-
getTileData(parameters: GetTileDataParameters): Promise<unknown | null>;
|
|
105
|
-
}
|
|
106
110
|
//# sourceMappingURL=tile-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/tile-source.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tile-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/tile-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,yBAAsB;AACnD,OAAO,EAAC,UAAU,EAAC,yBAAsB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,UAAU,CACzB,MAAM,SAAS,eAAe,GAAG,eAAe,EAChD,SAAS,SAAS,kBAAkB,GAAG,kBAAkB,C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AC1C,MAAM,MAAM,cAAc,GAAG;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC;AACxF,0CAA0C;AAC1C,MAAM,MAAM,iBAAiB,GAAG;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAAC"}
|
|
@@ -7,7 +7,7 @@ import type { LoaderOptions } from '@loaders.gl/loader-utils';
|
|
|
7
7
|
* @param context
|
|
8
8
|
*/
|
|
9
9
|
export declare function getFetchFunction(options?: LoaderOptions): (url: string, fetchOptions?: RequestInit) => Promise<Response>;
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function mergeImageSourceLoaderProps<Props extends {
|
|
11
11
|
loadOptions?: any;
|
|
12
12
|
}>(props: Props): Required<Props>;
|
|
13
13
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/sources/utils/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,aAAa,SAKvC,MAAM,iBAAiB,WAAW,uBAWlD;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/sources/utils/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,aAAa,SAKvC,MAAM,iBAAiB,WAAW,uBAWlD;AAED,wBAAgB,2BAA2B,CAAC,KAAK,SAAS;IAAC,WAAW,CAAC,EAAE,GAAG,CAAA;CAAC,EAC3E,KAAK,EAAE,KAAK,GACX,QAAQ,CAAC,KAAK,CAAC,CAUjB"}
|
|
@@ -22,7 +22,7 @@ export function getFetchFunction(options) {
|
|
|
22
22
|
// else return the global fetch function
|
|
23
23
|
return (url) => fetch(url);
|
|
24
24
|
}
|
|
25
|
-
export function
|
|
25
|
+
export function mergeImageSourceLoaderProps(props) {
|
|
26
26
|
// @ts-expect-error
|
|
27
27
|
return {
|
|
28
28
|
// Default fetch
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Schema, GeoJSONTable, BinaryFeatureCollection } from '@loaders.gl/schema';
|
|
2
|
+
import type { DataSourceProps } from "./data-source.js";
|
|
3
|
+
import { DataSource } from "./data-source.js";
|
|
4
|
+
export type VectorSourceProps = DataSourceProps;
|
|
5
|
+
/**
|
|
6
|
+
* VectorSource - data sources that allow features to be queried by (geospatial) extents
|
|
7
|
+
* @note
|
|
8
|
+
* - If geospatial, bounding box is expected to be in web mercator coordinates
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class VectorSource<PropsT extends VectorSourceProps = VectorSourceProps> extends DataSource<PropsT> {
|
|
11
|
+
static type: string;
|
|
12
|
+
static testURL: (url: string) => boolean;
|
|
13
|
+
abstract getSchema(): Promise<Schema>;
|
|
14
|
+
abstract getMetadata(options: {
|
|
15
|
+
formatSpecificMetadata?: boolean;
|
|
16
|
+
}): Promise<VectorSourceMetadata>;
|
|
17
|
+
abstract getFeatures(parameters: GetFeaturesParameters): Promise<GeoJSONTable | BinaryFeatureCollection>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Normalized capabilities of an Image service
|
|
21
|
+
* @example
|
|
22
|
+
* The WMSSourceLoader will normalize the response to the WMS `GetCapabilities`
|
|
23
|
+
* data structure extracted from WMS XML response into an VectorSourceMetadata.
|
|
24
|
+
*/
|
|
25
|
+
export type VectorSourceMetadata = {
|
|
26
|
+
name: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
abstract?: string;
|
|
29
|
+
keywords: string[];
|
|
30
|
+
layers: VectorSourceLayer[];
|
|
31
|
+
/**
|
|
32
|
+
* Attempts to preserve the original format specific metadata from the underlying source,
|
|
33
|
+
* May be an approximate representation
|
|
34
|
+
*/
|
|
35
|
+
formatSpecificMetadata?: Record<string, any>;
|
|
36
|
+
};
|
|
37
|
+
/** Description of one data layer in the image source */
|
|
38
|
+
export type VectorSourceLayer = {
|
|
39
|
+
/** Name of this layer */
|
|
40
|
+
name?: string;
|
|
41
|
+
/** Human readable title of this layer */
|
|
42
|
+
title?: string;
|
|
43
|
+
/** Coordinate systems supported by this layer */
|
|
44
|
+
crs?: string[];
|
|
45
|
+
/** layer limits in unspecified CRS:84-like lng/lat, for quick access w/o CRS calculations. */
|
|
46
|
+
boundingBox?: [min: [x: number, y: number], max: [x: number, y: number]];
|
|
47
|
+
/** Sub layers of this layer */
|
|
48
|
+
layers?: VectorSourceLayer[];
|
|
49
|
+
};
|
|
50
|
+
/** Generic parameters for requesting an image from an image source */
|
|
51
|
+
export type GetFeaturesParameters = {
|
|
52
|
+
/** Layers to render */
|
|
53
|
+
layers: string | string[];
|
|
54
|
+
/** bounding box on the map (only return features within this bbox) */
|
|
55
|
+
boundingBox: [min: [x: number, y: number], max: [x: number, y: number]];
|
|
56
|
+
/** crs for the returned features (not the bounding box) */
|
|
57
|
+
crs?: string;
|
|
58
|
+
/** @deprecated requested format for the return image */
|
|
59
|
+
format?: 'geojson' | 'binary';
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=vector-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/vector-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAE,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AACtF,OAAO,KAAK,EAAC,eA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,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACzE,+BAA+B;IAC/B,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC9B,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,qBAAqB,GAAG;IAClC,uBAAuB;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,sEAAsE;IACtE,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACxE,2DAA2D;IAC3D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC/B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { DataSource } from "./data-source.js";
|
|
5
|
+
/**
|
|
6
|
+
* VectorSource - data sources that allow features to be queried by (geospatial) extents
|
|
7
|
+
* @note
|
|
8
|
+
* - If geospatial, bounding box is expected to be in web mercator coordinates
|
|
9
|
+
*/
|
|
10
|
+
export class VectorSource extends DataSource {
|
|
11
|
+
static type = 'template';
|
|
12
|
+
static testURL = (url) => false;
|
|
13
|
+
}
|
|
@@ -7,7 +7,7 @@ export type VectorTileSourceProps = TileSourceProps;
|
|
|
7
7
|
* VectorTileSource - data sources that allow data to be queried by (geospatial) tile
|
|
8
8
|
* @note If geospatial, bounding box is expected to be in web mercator coordinates
|
|
9
9
|
*/
|
|
10
|
-
export interface VectorTileSource<MetadataT extends TileSourceMetadata = TileSourceMetadata> extends TileSource<MetadataT> {
|
|
10
|
+
export interface VectorTileSource<PropsT extends VectorTileSourceProps = VectorTileSourceProps, MetadataT extends TileSourceMetadata = TileSourceMetadata> extends TileSource<PropsT, MetadataT> {
|
|
11
11
|
getSchema(): Promise<Schema>;
|
|
12
12
|
getVectorTile(parameters: GetTileParameters): Promise<VectorTile | null>;
|
|
13
13
|
getTileData(parameters: GetTileDataParameters): Promise<Feature[] | BinaryFeatureCollection | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-tile-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/vector-tile-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAC,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAC,yBAAsB;AACjG,OAAO,KAAK,EAAC,qBAAqB,EAAC,yBAAsB;AAEzD,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC;AAEjC,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,gBAAgB,
|
|
1
|
+
{"version":3,"file":"vector-tile-source.d.ts","sourceRoot":"","sources":["../../../src/lib/sources/vector-tile-source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAC,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAC,yBAAsB;AACjG,OAAO,KAAK,EAAC,qBAAqB,EAAC,yBAAsB;AAEzD,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC;AAEjC,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,gBAAgB,CAC/B,MAAM,SAAS,qBAAqB,GAAG,qBAAqB,EAC5D,SAAS,SAAS,kBAAkB,GAAG,kBAAkB,CACzD,SAAQ,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC;IACrC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,aAAa,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACzE,WAAW,CACT,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,OAAO,EAAE,GAAG,uBAAuB,GAAG,IAAI,CAAC,CAAC;CACxD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { DataSource, DataSourceProps } from "./lib/sources/data-source.js";
|
|
2
|
+
/**
|
|
3
|
+
* A `Source` contains metadata and a factory method for creating instances of a specific `DataSource`.
|
|
4
|
+
* It allows a list of `Source` objects to be passed to methods
|
|
5
|
+
* @example
|
|
6
|
+
* `createDataSource(... , [MVTSource, PMTilesSource, ...])
|
|
7
|
+
*/
|
|
8
|
+
export interface Source<DataSourceT extends DataSource = DataSource, DataSourcePropsT extends DataSourceProps = any> {
|
|
9
|
+
/** Type of source created by this service */
|
|
10
|
+
source?: DataSourceT;
|
|
11
|
+
/** Type of props used when creating sources */
|
|
12
|
+
props?: DataSourcePropsT;
|
|
13
|
+
/** Name of the service */
|
|
14
|
+
name: string;
|
|
15
|
+
id: string;
|
|
16
|
+
/** Module containing the service */
|
|
17
|
+
module: string;
|
|
18
|
+
/** Version of the loaders.gl package containing this service. */
|
|
19
|
+
version: string;
|
|
20
|
+
/** URL extensions that this service uses */
|
|
21
|
+
extensions: string[];
|
|
22
|
+
/** MIME extensions that this service uses */
|
|
23
|
+
mimeTypes: string[];
|
|
24
|
+
/** Default options */
|
|
25
|
+
options: DataSourcePropsT;
|
|
26
|
+
/** Type string identifying this service, e.g. 'wms' */
|
|
27
|
+
type: string;
|
|
28
|
+
/** Can source be created from a URL */
|
|
29
|
+
fromUrl: boolean;
|
|
30
|
+
/** Can source be created from a Blob or File */
|
|
31
|
+
fromBlob: boolean;
|
|
32
|
+
/** Check if a URL can support this service */
|
|
33
|
+
testURL: (url: string) => boolean;
|
|
34
|
+
/** Test data */
|
|
35
|
+
testData?: (data: Blob) => boolean;
|
|
36
|
+
/** Create a source */
|
|
37
|
+
createDataSource(data: string | Blob, props: DataSourcePropsT): DataSourceT;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=source-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-types.d.ts","sourceRoot":"","sources":["../src/source-types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAE,eAAe,EAAC,qCAAkC;AAE3E;;;;;GAKG;AACH,MAAM,WAAW,MAAM,CACrB,WAAW,SAAS,UAAU,GAAG,UAAU,EAC3C,gBAAgB,SAAS,eAAe,GAAG,GAAG;IAE9C,6CAA6C;IAC7C,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,gBAAgB,CAAC;IAEzB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sBAAsB;IACtB,OAAO,EAAE,gBAAgB,CAAC;IAE1B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,QAAQ,EAAE,OAAO,CAAC;IAElB,8CAA8C;IAC9C,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAClC,gBAAgB;IAChB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IACnC,uBAAuB;IACvB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,gBAAgB,GAAG,WAAW,CAAC;CAC7E"}
|