@deck.gl/carto 9.0.0-beta.4 → 9.0.0-beta.6
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/common.d.ts +0 -1
- package/dist/api/common.d.ts.map +1 -1
- package/dist/api/common.js +0 -1
- package/dist/api/fetch-map.d.ts.map +1 -1
- package/dist/api/fetch-map.js +4 -0
- package/dist/api/parse-map.js +4 -4
- package/dist/cartoRasterTile-worker.js +1 -1
- package/dist/cartoSpatialTile-worker.js +1 -1
- package/dist/cartoVectorTile-worker.js +1 -1
- package/dist/dist.dev.js +661 -675
- package/dist/index.cjs +59 -88
- package/dist/index.cjs.map +3 -3
- package/dist/layers/raster-layer-vertex.glsl.js +41 -71
- package/dist/layers/raster-layer.d.ts.map +1 -1
- package/dist/layers/raster-layer.js +2 -5
- 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-vector-tile-loader.js +1 -1
- package/dist/sources/base-source.d.ts.map +1 -1
- package/dist/sources/base-source.js +4 -3
- package/dist/sources/types.d.ts +1 -1
- package/dist/sources/types.d.ts.map +1 -1
- package/dist.min.js +50 -80
- package/package.json +4 -4
- package/src/api/common.ts +0 -1
- package/src/api/fetch-map.ts +4 -0
- package/src/layers/raster-layer.ts +2 -5
- package/src/sources/base-source.ts +4 -3
- package/src/sources/types.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -243,7 +243,7 @@ function scaleIdentity() {
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
// dist/layers/schema/carto-raster-tile-loader.js
|
|
246
|
-
var VERSION = true ? "9.0.0-beta.
|
|
246
|
+
var VERSION = true ? "9.0.0-beta.5" : "latest";
|
|
247
247
|
var id = "cartoRasterTile";
|
|
248
248
|
var DEFAULT_OPTIONS = {
|
|
249
249
|
cartoRasterTile: {
|
|
@@ -515,7 +515,7 @@ function binaryToSpatialjson(binary) {
|
|
|
515
515
|
}
|
|
516
516
|
|
|
517
517
|
// dist/layers/schema/carto-spatial-tile-loader.js
|
|
518
|
-
var VERSION2 = true ? "9.0.0-beta.
|
|
518
|
+
var VERSION2 = true ? "9.0.0-beta.5" : "latest";
|
|
519
519
|
var id2 = "cartoSpatialTile";
|
|
520
520
|
var DEFAULT_OPTIONS2 = {
|
|
521
521
|
cartoSpatialTile: {
|
|
@@ -1005,24 +1005,18 @@ var QuadbinTileLayer = _QuadbinTileLayer;
|
|
|
1005
1005
|
var import_core9 = require("@deck.gl/core");
|
|
1006
1006
|
|
|
1007
1007
|
// dist/layers/raster-layer.js
|
|
1008
|
-
var import_constants = require("@luma.gl/constants");
|
|
1009
1008
|
var import_core8 = require("@deck.gl/core");
|
|
1010
1009
|
var import_layers2 = require("@deck.gl/layers");
|
|
1011
1010
|
|
|
1012
1011
|
// dist/layers/raster-layer-vertex.glsl.js
|
|
1013
1012
|
var raster_layer_vertex_glsl_default = `#version 300 es
|
|
1014
1013
|
#define SHADER_NAME raster-layer-vertex-shader
|
|
1015
|
-
|
|
1016
1014
|
in vec3 positions;
|
|
1017
1015
|
in vec3 normals;
|
|
1018
|
-
|
|
1019
1016
|
in float instanceElevations;
|
|
1020
1017
|
in vec4 instanceFillColors;
|
|
1021
1018
|
in vec4 instanceLineColors;
|
|
1022
|
-
|
|
1023
1019
|
in vec3 instancePickingColors;
|
|
1024
|
-
|
|
1025
|
-
// Custom uniforms
|
|
1026
1020
|
uniform float opacity;
|
|
1027
1021
|
uniform bool extruded;
|
|
1028
1022
|
uniform bool stroked;
|
|
@@ -1031,80 +1025,55 @@ uniform float coverage;
|
|
|
1031
1025
|
uniform float elevationScale;
|
|
1032
1026
|
uniform float widthScale;
|
|
1033
1027
|
uniform vec3 offset;
|
|
1034
|
-
|
|
1035
|
-
// Result
|
|
1036
1028
|
out vec4 vColor;
|
|
1037
1029
|
#ifdef FLAT_SHADING
|
|
1038
1030
|
out vec4 position_commonspace;
|
|
1039
1031
|
#endif
|
|
1040
|
-
|
|
1041
1032
|
void main(void) {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
strokeOffsetRatio -= sign(positions.z) * halfOffset;
|
|
1076
|
-
} else {
|
|
1077
|
-
strokeOffsetRatio -= halfOffset;
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
geometry.pickingColor = instancePickingColors;
|
|
1082
|
-
|
|
1083
|
-
// project center of column
|
|
1084
|
-
vec2 offset = (vec2(0.5) + positions.xy * strokeOffsetRatio) * cellWidth * shouldRender;
|
|
1085
|
-
vec3 pos = vec3(offset, project_size(elevation));
|
|
1086
|
-
DECKGL_FILTER_SIZE(pos, geometry);
|
|
1087
|
-
|
|
1088
|
-
geometry.position.xyz += pos;
|
|
1089
|
-
gl_Position = project_common_position_to_clipspace(geometry.position);
|
|
1090
|
-
|
|
1091
|
-
geometry.normal = project_normal(normals);
|
|
1092
|
-
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
1093
|
-
|
|
1094
|
-
// Light calculations
|
|
1095
|
-
if (extruded && !isStroke) {
|
|
1033
|
+
vec2 common_position = offset.xy;
|
|
1034
|
+
float scale = offset.z;
|
|
1035
|
+
int yIndex = - (gl_InstanceID / BLOCK_WIDTH);
|
|
1036
|
+
int xIndex = gl_InstanceID + (yIndex * BLOCK_WIDTH);
|
|
1037
|
+
common_position += scale * vec2(float(xIndex), float(yIndex));
|
|
1038
|
+
vec4 color = isStroke ? instanceLineColors : instanceFillColors;
|
|
1039
|
+
float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);
|
|
1040
|
+
float cellWidth = coverage * scale;
|
|
1041
|
+
geometry.position = vec4(common_position, 0.0, 1.0);
|
|
1042
|
+
if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {
|
|
1043
|
+
geometry.position.xyz -= project_uCommonOrigin;
|
|
1044
|
+
}
|
|
1045
|
+
float elevation = 0.0;
|
|
1046
|
+
float strokeOffsetRatio = 1.0;
|
|
1047
|
+
if (extruded) {
|
|
1048
|
+
elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;
|
|
1049
|
+
} else if (stroked) {
|
|
1050
|
+
float halfOffset = project_pixel_size(widthScale) / cellWidth;
|
|
1051
|
+
if (isStroke) {
|
|
1052
|
+
strokeOffsetRatio -= sign(positions.z) * halfOffset;
|
|
1053
|
+
} else {
|
|
1054
|
+
strokeOffsetRatio -= halfOffset;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
geometry.pickingColor = instancePickingColors;
|
|
1058
|
+
vec2 offset = (vec2(0.5) + positions.xy * strokeOffsetRatio) * cellWidth * shouldRender;
|
|
1059
|
+
vec3 pos = vec3(offset, project_size(elevation));
|
|
1060
|
+
DECKGL_FILTER_SIZE(pos, geometry);
|
|
1061
|
+
geometry.position.xyz += pos;
|
|
1062
|
+
gl_Position = project_common_position_to_clipspace(geometry.position);
|
|
1063
|
+
geometry.normal = project_normal(normals);
|
|
1064
|
+
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
1065
|
+
if (extruded && !isStroke) {
|
|
1096
1066
|
#ifdef FLAT_SHADING
|
|
1097
|
-
|
|
1098
|
-
|
|
1067
|
+
position_commonspace = geometry.position;
|
|
1068
|
+
vColor = vec4(color.rgb, color.a * opacity);
|
|
1099
1069
|
#else
|
|
1100
|
-
|
|
1101
|
-
|
|
1070
|
+
vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);
|
|
1071
|
+
vColor = vec4(lightColor, color.a * opacity);
|
|
1102
1072
|
#endif
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
DECKGL_FILTER_COLOR(vColor, geometry);
|
|
1073
|
+
} else {
|
|
1074
|
+
vColor = vec4(color.rgb, color.a * opacity);
|
|
1075
|
+
}
|
|
1076
|
+
DECKGL_FILTER_COLOR(vColor, geometry);
|
|
1108
1077
|
}
|
|
1109
1078
|
`;
|
|
1110
1079
|
|
|
@@ -1137,16 +1106,14 @@ var _RasterColumnLayer = class extends import_layers2.ColumnLayer {
|
|
|
1137
1106
|
},
|
|
1138
1107
|
instanceFillColors: {
|
|
1139
1108
|
size: this.props.colorFormat.length,
|
|
1140
|
-
type:
|
|
1141
|
-
normalized: true,
|
|
1109
|
+
type: "unorm8",
|
|
1142
1110
|
transition: true,
|
|
1143
1111
|
accessor: "getFillColor",
|
|
1144
1112
|
defaultValue: [0, 0, 0, 255]
|
|
1145
1113
|
},
|
|
1146
1114
|
instanceLineColors: {
|
|
1147
1115
|
size: this.props.colorFormat.length,
|
|
1148
|
-
type:
|
|
1149
|
-
normalized: true,
|
|
1116
|
+
type: "unorm8",
|
|
1150
1117
|
transition: true,
|
|
1151
1118
|
accessor: "getLineColor",
|
|
1152
1119
|
defaultValue: [255, 255, 255, 255]
|
|
@@ -1288,7 +1255,7 @@ var carto_properties_tile_loader_default = CartoPropertiesTileLoader;
|
|
|
1288
1255
|
|
|
1289
1256
|
// dist/layers/schema/carto-vector-tile-loader.js
|
|
1290
1257
|
var import_earcut = __toESM(require("earcut"), 1);
|
|
1291
|
-
var VERSION3 = true ? "9.0.0-beta.
|
|
1258
|
+
var VERSION3 = true ? "9.0.0-beta.5" : "latest";
|
|
1292
1259
|
var id3 = "cartoVectorTile";
|
|
1293
1260
|
var DEFAULT_OPTIONS3 = {
|
|
1294
1261
|
cartoVectorTile: {
|
|
@@ -1609,7 +1576,6 @@ var DEFAULT_CLIENT = "deck-gl-carto";
|
|
|
1609
1576
|
var V3_MINOR_VERSION = "3.3";
|
|
1610
1577
|
var MAX_GET_LENGTH = 8192;
|
|
1611
1578
|
var DEFAULT_PARAMETERS = {
|
|
1612
|
-
client: DEFAULT_CLIENT,
|
|
1613
1579
|
v: V3_MINOR_VERSION
|
|
1614
1580
|
};
|
|
1615
1581
|
var DEFAULT_HEADERS = {
|
|
@@ -1702,17 +1668,18 @@ async function baseSource(endpoint, options, urlParameters) {
|
|
|
1702
1668
|
}
|
|
1703
1669
|
}
|
|
1704
1670
|
const baseUrl2 = buildSourceUrl(mergedOptions);
|
|
1705
|
-
const { format } = mergedOptions;
|
|
1671
|
+
const { clientId, format } = mergedOptions;
|
|
1706
1672
|
const headers = { Authorization: `Bearer ${options.accessToken}`, ...options.headers };
|
|
1673
|
+
const parameters = { client: clientId, ...urlParameters };
|
|
1707
1674
|
const errorContext = {
|
|
1708
1675
|
requestType: "Map instantiation",
|
|
1709
1676
|
connection: options.connectionName,
|
|
1710
1677
|
type: endpoint,
|
|
1711
|
-
source: JSON.stringify(
|
|
1678
|
+
source: JSON.stringify(parameters, void 0, 2)
|
|
1712
1679
|
};
|
|
1713
1680
|
const mapInstantiation = await requestWithParameters({
|
|
1714
1681
|
baseUrl: baseUrl2,
|
|
1715
|
-
parameters
|
|
1682
|
+
parameters,
|
|
1716
1683
|
headers,
|
|
1717
1684
|
errorContext
|
|
1718
1685
|
});
|
|
@@ -1903,7 +1870,7 @@ var vectorTilesetSource = async function(options) {
|
|
|
1903
1870
|
};
|
|
1904
1871
|
|
|
1905
1872
|
// dist/api/parse-map.js
|
|
1906
|
-
var
|
|
1873
|
+
var import_constants = require("@luma.gl/constants");
|
|
1907
1874
|
var import_core11 = require("@deck.gl/core");
|
|
1908
1875
|
|
|
1909
1876
|
// dist/api/layer-map.js
|
|
@@ -2303,11 +2270,11 @@ function parseMap(json) {
|
|
|
2303
2270
|
}
|
|
2304
2271
|
function createParametersProp(layerBlending, parameters) {
|
|
2305
2272
|
if (layerBlending === "additive") {
|
|
2306
|
-
parameters.blendFunc = [
|
|
2307
|
-
parameters.blendEquation =
|
|
2273
|
+
parameters.blendFunc = [770, 772];
|
|
2274
|
+
parameters.blendEquation = 32774;
|
|
2308
2275
|
} else if (layerBlending === "subtractive") {
|
|
2309
|
-
parameters.blendFunc = [
|
|
2310
|
-
parameters.blendEquation = [
|
|
2276
|
+
parameters.blendFunc = [1, 775, 770, 772];
|
|
2277
|
+
parameters.blendEquation = [32778, 32774];
|
|
2311
2278
|
}
|
|
2312
2279
|
return Object.keys(parameters).length ? { parameters } : {};
|
|
2313
2280
|
}
|
|
@@ -2562,8 +2529,12 @@ async function _fetchTilestats(attribute, dataset, accessToken, apiBaseUrl) {
|
|
|
2562
2529
|
throw new CartoAPIError(new Error(`Invalid dataset for tilestats: ${id4}`), errorContext);
|
|
2563
2530
|
}
|
|
2564
2531
|
const baseUrl2 = buildStatsUrl({ attribute, apiBaseUrl, ...dataset });
|
|
2532
|
+
const client = new URLSearchParams(data.tiles[0]).get("client");
|
|
2565
2533
|
const headers = { Authorization: `Bearer ${accessToken}` };
|
|
2566
2534
|
const parameters = {};
|
|
2535
|
+
if (client) {
|
|
2536
|
+
parameters.client = client;
|
|
2537
|
+
}
|
|
2567
2538
|
if (type === "query") {
|
|
2568
2539
|
parameters.q = source;
|
|
2569
2540
|
if (queryParameters) {
|