@deck.gl/carto 9.0.19 → 9.0.21
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/api/parse-map.js +9 -5
- package/dist/cartoRasterTile-worker.js +1 -1
- package/dist/cartoSpatialTile-worker.js +1 -1
- package/dist/cartoVectorTile-worker.js +2 -2
- package/dist/dist.dev.js +12 -667
- package/dist/index.cjs +15 -13
- package/dist/index.cjs.map +3 -3
- package/dist/layers/schema/carto-raster-tile-loader.js +1 -1
- package/dist/layers/schema/carto-spatial-tile-loader.js +1 -1
- package/dist/layers/schema/carto-tile.d.ts +1 -1
- package/dist/layers/schema/carto-tile.js +1 -1
- package/dist/layers/schema/carto-vector-tile-loader.js +1 -1
- package/dist/sources/boundary-query-source.d.ts +0 -1
- package/dist/sources/boundary-query-source.d.ts.map +1 -1
- package/dist/sources/boundary-query-source.js +1 -2
- package/dist/sources/boundary-table-source.d.ts +0 -1
- package/dist/sources/boundary-table-source.d.ts.map +1 -1
- package/dist/sources/boundary-table-source.js +1 -2
- package/dist.min.js +3 -3
- package/package.json +4 -5
- package/src/api/parse-map.ts +11 -6
- package/src/layers/schema/carto-tile.ts +2 -2
- package/src/sources/boundary-query-source.ts +1 -11
- package/src/sources/boundary-table-source.ts +1 -4
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "9.0.
|
|
6
|
+
"version": "9.0.21",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -47,9 +47,8 @@
|
|
|
47
47
|
"@loaders.gl/mvt": "^4.2.0",
|
|
48
48
|
"@loaders.gl/schema": "^4.2.0",
|
|
49
49
|
"@loaders.gl/tiles": "^4.2.0",
|
|
50
|
-
"@luma.gl/
|
|
51
|
-
"@luma.gl/
|
|
52
|
-
"@luma.gl/shadertools": "^9.0.14",
|
|
50
|
+
"@luma.gl/core": "^9.0.15",
|
|
51
|
+
"@luma.gl/shadertools": "^9.0.15",
|
|
53
52
|
"@math.gl/web-mercator": "^4.0.0",
|
|
54
53
|
"@types/d3-array": "^3.0.2",
|
|
55
54
|
"@types/d3-color": "^1.4.2",
|
|
@@ -73,5 +72,5 @@
|
|
|
73
72
|
"@deck.gl/layers": "^9.0.0",
|
|
74
73
|
"@loaders.gl/core": "^4.2.0"
|
|
75
74
|
},
|
|
76
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "bb9a6c4887b58e210223d4c6f5472811bd096521"
|
|
77
76
|
}
|
package/src/api/parse-map.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ColorParameters} from '@luma.gl/core';
|
|
2
2
|
import {Layer, log} from '@deck.gl/core';
|
|
3
3
|
import {
|
|
4
4
|
AGGREGATION,
|
|
@@ -83,13 +83,18 @@ export function parseMap(json) {
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
function createParametersProp(layerBlending, parameters:
|
|
86
|
+
function createParametersProp(layerBlending: string, parameters: ColorParameters) {
|
|
87
87
|
if (layerBlending === 'additive') {
|
|
88
|
-
parameters.
|
|
89
|
-
parameters.
|
|
88
|
+
parameters.blendColorSrcFactor = parameters.blendAlphaSrcFactor = 'src-alpha';
|
|
89
|
+
parameters.blendColorDstFactor = parameters.blendAlphaDstFactor = 'dst-alpha';
|
|
90
|
+
parameters.blendColorOperation = parameters.blendAlphaOperation = 'add';
|
|
90
91
|
} else if (layerBlending === 'subtractive') {
|
|
91
|
-
parameters.
|
|
92
|
-
parameters.
|
|
92
|
+
parameters.blendColorSrcFactor = 'one';
|
|
93
|
+
parameters.blendColorDstFactor = 'one-minus-dst-color';
|
|
94
|
+
parameters.blendAlphaSrcFactor = 'src-alpha';
|
|
95
|
+
parameters.blendAlphaDstFactor = 'dst-alpha';
|
|
96
|
+
parameters.blendColorOperation = 'subtract';
|
|
97
|
+
parameters.blendAlphaOperation = 'add';
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
return Object.keys(parameters).length ? {parameters} : {};
|
|
@@ -33,14 +33,14 @@ export class PropertiesReader {
|
|
|
33
33
|
// Doubles ========================================
|
|
34
34
|
|
|
35
35
|
interface Doubles {
|
|
36
|
-
value:
|
|
36
|
+
value: Float64Array;
|
|
37
37
|
size: number;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
class DoublesReader {
|
|
41
41
|
static read(pbf, end?: number): Doubles {
|
|
42
42
|
const {value, size} = pbf.readFields(DoublesReader._readField, {value: [], size: 0}, end);
|
|
43
|
-
return {value
|
|
43
|
+
return {value, size};
|
|
44
44
|
}
|
|
45
45
|
static _readField(this: void, tag: number, obj, pbf) {
|
|
46
46
|
if (tag === 1) readPackedTypedArray(Float64Array, pbf, obj);
|
|
@@ -6,7 +6,6 @@ export type BoundaryQuerySourceOptions = SourceOptions &
|
|
|
6
6
|
FilterOptions & {
|
|
7
7
|
columns?: string[];
|
|
8
8
|
tilesetTableName: string;
|
|
9
|
-
matchingColumn?: string;
|
|
10
9
|
propertiesSqlQuery: string;
|
|
11
10
|
queryParameters?: QueryParameters;
|
|
12
11
|
};
|
|
@@ -14,7 +13,6 @@ type UrlParameters = {
|
|
|
14
13
|
columns?: string;
|
|
15
14
|
filters?: Record<string, unknown>;
|
|
16
15
|
tilesetTableName: string;
|
|
17
|
-
matchingColumn: string;
|
|
18
16
|
propertiesSqlQuery: string;
|
|
19
17
|
queryParameters?: Record<string, unknown> | unknown[];
|
|
20
18
|
};
|
|
@@ -22,17 +20,9 @@ type UrlParameters = {
|
|
|
22
20
|
export const boundaryQuerySource = async function (
|
|
23
21
|
options: BoundaryQuerySourceOptions
|
|
24
22
|
): Promise<TilejsonResult> {
|
|
25
|
-
const {
|
|
26
|
-
columns,
|
|
27
|
-
filters,
|
|
28
|
-
tilesetTableName,
|
|
29
|
-
matchingColumn = 'id',
|
|
30
|
-
propertiesSqlQuery,
|
|
31
|
-
queryParameters
|
|
32
|
-
} = options;
|
|
23
|
+
const {columns, filters, tilesetTableName, propertiesSqlQuery, queryParameters} = options;
|
|
33
24
|
const urlParameters: UrlParameters = {
|
|
34
25
|
tilesetTableName,
|
|
35
|
-
matchingColumn,
|
|
36
26
|
propertiesSqlQuery
|
|
37
27
|
};
|
|
38
28
|
|
|
@@ -5,24 +5,21 @@ export type BoundaryTableSourceOptions = SourceOptions &
|
|
|
5
5
|
FilterOptions & {
|
|
6
6
|
tilesetTableName: string;
|
|
7
7
|
columns?: string[];
|
|
8
|
-
matchingColumn?: string;
|
|
9
8
|
propertiesTableName: string;
|
|
10
9
|
};
|
|
11
10
|
type UrlParameters = {
|
|
12
11
|
filters?: Record<string, unknown>;
|
|
13
12
|
tilesetTableName: string;
|
|
14
13
|
columns?: string;
|
|
15
|
-
matchingColumn: string;
|
|
16
14
|
propertiesTableName: string;
|
|
17
15
|
};
|
|
18
16
|
|
|
19
17
|
export const boundaryTableSource = async function (
|
|
20
18
|
options: BoundaryTableSourceOptions
|
|
21
19
|
): Promise<TilejsonResult> {
|
|
22
|
-
const {filters, tilesetTableName, columns,
|
|
20
|
+
const {filters, tilesetTableName, columns, propertiesTableName} = options;
|
|
23
21
|
const urlParameters: UrlParameters = {
|
|
24
22
|
tilesetTableName,
|
|
25
|
-
matchingColumn,
|
|
26
23
|
propertiesTableName
|
|
27
24
|
};
|
|
28
25
|
|