@deck.gl/carto 9.0.6 → 9.0.8
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 +1 -0
- package/dist/api/common.d.ts.map +1 -1
- package/dist/api/common.js +3 -1
- package/dist/cartoRasterTile-worker.js +15 -48
- package/dist/cartoSpatialTile-worker.js +15 -48
- package/dist/cartoVectorTile-worker.js +15 -48
- package/dist/dist.dev.js +62 -82
- package/dist/index.cjs +44 -25
- package/dist/index.cjs.map +3 -3
- package/dist/layers/h3-tileset-2d.d.ts.map +1 -1
- package/dist/layers/h3-tileset-2d.js +35 -18
- 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.min.js +8 -8
- package/package.json +8 -8
- package/src/api/common.ts +4 -1
- package/src/layers/h3-tileset-2d.ts +46 -23
package/dist/api/common.d.ts
CHANGED
package/dist/api/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/api/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/api/common.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,uCAAuC,CAAC;AACzE,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAC9C,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AACtC,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,eAAO,MAAM,kBAAkB;;;CAG9B,CAAC;AAEF,eAAO,MAAM,eAAe;;;CAG3B,CAAC"}
|
package/dist/api/common.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { VERSION } from '@deck.gl/core';
|
|
1
2
|
export const DEFAULT_API_BASE_URL = 'https://gcp-us-east1.api.carto.com';
|
|
2
3
|
export const DEFAULT_CLIENT = 'deck-gl-carto';
|
|
3
4
|
export const V3_MINOR_VERSION = '3.4';
|
|
4
5
|
export const MAX_GET_LENGTH = 8192;
|
|
5
6
|
export const DEFAULT_PARAMETERS = {
|
|
6
|
-
v: V3_MINOR_VERSION
|
|
7
|
+
v: V3_MINOR_VERSION,
|
|
8
|
+
deckglVersion: VERSION
|
|
7
9
|
};
|
|
8
10
|
export const DEFAULT_HEADERS = {
|
|
9
11
|
Accept: 'application/json',
|
|
@@ -762,9 +762,7 @@
|
|
|
762
762
|
var parentPort = null;
|
|
763
763
|
|
|
764
764
|
// ../../node_modules/@loaders.gl/worker-utils/dist/lib/worker-utils/get-transfer-list.js
|
|
765
|
-
function getTransferList(object) {
|
|
766
|
-
let recursive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
767
|
-
let transfers = arguments.length > 2 ? arguments[2] : void 0;
|
|
765
|
+
function getTransferList(object, recursive = true, transfers) {
|
|
768
766
|
const transfersSet = transfers || /* @__PURE__ */ new Set();
|
|
769
767
|
if (!object) {
|
|
770
768
|
} else if (isTransferable(object)) {
|
|
@@ -810,15 +808,14 @@
|
|
|
810
808
|
static set onmessage(onMessage) {
|
|
811
809
|
async function handleMessage(message) {
|
|
812
810
|
const parentPort2 = await getParentPort();
|
|
813
|
-
const {
|
|
814
|
-
type,
|
|
815
|
-
payload
|
|
816
|
-
} = parentPort2 ? message : message.data;
|
|
811
|
+
const { type, payload } = parentPort2 ? message : message.data;
|
|
817
812
|
onMessage(type, payload);
|
|
818
813
|
}
|
|
819
814
|
getParentPort().then((parentPort2) => {
|
|
820
815
|
if (parentPort2) {
|
|
821
|
-
parentPort2.on("message",
|
|
816
|
+
parentPort2.on("message", (message) => {
|
|
817
|
+
handleMessage(message);
|
|
818
|
+
});
|
|
822
819
|
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
823
820
|
} else {
|
|
824
821
|
globalThis.onmessage = handleMessage;
|
|
@@ -833,10 +830,7 @@
|
|
|
833
830
|
return;
|
|
834
831
|
}
|
|
835
832
|
const parentPort3 = await getParentPort();
|
|
836
|
-
const {
|
|
837
|
-
type,
|
|
838
|
-
payload
|
|
839
|
-
} = parentPort3 ? message : message.data;
|
|
833
|
+
const { type, payload } = parentPort3 ? message : message.data;
|
|
840
834
|
onMessage(type, payload);
|
|
841
835
|
};
|
|
842
836
|
}
|
|
@@ -858,11 +852,7 @@
|
|
|
858
852
|
}
|
|
859
853
|
}
|
|
860
854
|
static async postMessage(type, payload) {
|
|
861
|
-
const data = {
|
|
862
|
-
source: "loaders.gl",
|
|
863
|
-
type,
|
|
864
|
-
payload
|
|
865
|
-
};
|
|
855
|
+
const data = { source: "loaders.gl", type, payload };
|
|
866
856
|
const transferList = getTransferList(payload);
|
|
867
857
|
const parentPort2 = await getParentPort();
|
|
868
858
|
if (parentPort2) {
|
|
@@ -873,10 +863,7 @@
|
|
|
873
863
|
}
|
|
874
864
|
};
|
|
875
865
|
function isKnownMessage(message) {
|
|
876
|
-
const {
|
|
877
|
-
type,
|
|
878
|
-
data
|
|
879
|
-
} = message;
|
|
866
|
+
const { type, data } = message;
|
|
880
867
|
return type === "message" && data && typeof data.source === "string" && data.source.startsWith("loaders.gl");
|
|
881
868
|
}
|
|
882
869
|
|
|
@@ -890,11 +877,7 @@
|
|
|
890
877
|
switch (type) {
|
|
891
878
|
case "process":
|
|
892
879
|
try {
|
|
893
|
-
const {
|
|
894
|
-
input,
|
|
895
|
-
options = {},
|
|
896
|
-
context = {}
|
|
897
|
-
} = payload;
|
|
880
|
+
const { input, options = {}, context = {} } = payload;
|
|
898
881
|
const result = await parseData({
|
|
899
882
|
loader,
|
|
900
883
|
arrayBuffer: input,
|
|
@@ -904,14 +887,10 @@
|
|
|
904
887
|
_parse: parseOnMainThread
|
|
905
888
|
}
|
|
906
889
|
});
|
|
907
|
-
WorkerBody.postMessage("done", {
|
|
908
|
-
result
|
|
909
|
-
});
|
|
890
|
+
WorkerBody.postMessage("done", { result });
|
|
910
891
|
} catch (error) {
|
|
911
892
|
const message = error instanceof Error ? error.message : "";
|
|
912
|
-
WorkerBody.postMessage("error", {
|
|
913
|
-
error: message
|
|
914
|
-
});
|
|
893
|
+
WorkerBody.postMessage("error", { error: message });
|
|
915
894
|
}
|
|
916
895
|
break;
|
|
917
896
|
default:
|
|
@@ -938,21 +917,11 @@
|
|
|
938
917
|
}
|
|
939
918
|
};
|
|
940
919
|
WorkerBody.addEventListener(onMessage);
|
|
941
|
-
const payload = {
|
|
942
|
-
id: id2,
|
|
943
|
-
input: arrayBuffer,
|
|
944
|
-
options
|
|
945
|
-
};
|
|
920
|
+
const payload = { id: id2, input: arrayBuffer, options };
|
|
946
921
|
WorkerBody.postMessage("process", payload);
|
|
947
922
|
});
|
|
948
923
|
}
|
|
949
|
-
async function parseData(
|
|
950
|
-
let {
|
|
951
|
-
loader,
|
|
952
|
-
arrayBuffer,
|
|
953
|
-
options,
|
|
954
|
-
context
|
|
955
|
-
} = _ref;
|
|
924
|
+
async function parseData({ loader, arrayBuffer, options, context }) {
|
|
956
925
|
let data;
|
|
957
926
|
let parser;
|
|
958
927
|
if (loader.parseSync || loader.parse) {
|
|
@@ -970,9 +939,7 @@
|
|
|
970
939
|
modules: loader && loader.options && loader.options.modules || {},
|
|
971
940
|
worker: false
|
|
972
941
|
};
|
|
973
|
-
return await parser(data, {
|
|
974
|
-
...options
|
|
975
|
-
}, context, loader);
|
|
942
|
+
return await parser(data, { ...options }, context, loader);
|
|
976
943
|
}
|
|
977
944
|
|
|
978
945
|
// src/layers/schema/fast-pbf.ts
|
|
@@ -1041,7 +1008,7 @@
|
|
|
1041
1008
|
}
|
|
1042
1009
|
|
|
1043
1010
|
// src/layers/schema/carto-raster-tile-loader.ts
|
|
1044
|
-
var VERSION = true ? "9.0.
|
|
1011
|
+
var VERSION = true ? "9.0.8" : "latest";
|
|
1045
1012
|
var id = "cartoRasterTile";
|
|
1046
1013
|
var DEFAULT_OPTIONS = {
|
|
1047
1014
|
cartoRasterTile: {
|
|
@@ -1088,9 +1088,7 @@
|
|
|
1088
1088
|
var parentPort = null;
|
|
1089
1089
|
|
|
1090
1090
|
// ../../node_modules/@loaders.gl/worker-utils/dist/lib/worker-utils/get-transfer-list.js
|
|
1091
|
-
function getTransferList(object) {
|
|
1092
|
-
let recursive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
1093
|
-
let transfers = arguments.length > 2 ? arguments[2] : void 0;
|
|
1091
|
+
function getTransferList(object, recursive = true, transfers) {
|
|
1094
1092
|
const transfersSet = transfers || /* @__PURE__ */ new Set();
|
|
1095
1093
|
if (!object) {
|
|
1096
1094
|
} else if (isTransferable(object)) {
|
|
@@ -1136,15 +1134,14 @@
|
|
|
1136
1134
|
static set onmessage(onMessage) {
|
|
1137
1135
|
async function handleMessage(message) {
|
|
1138
1136
|
const parentPort2 = await getParentPort();
|
|
1139
|
-
const {
|
|
1140
|
-
type,
|
|
1141
|
-
payload
|
|
1142
|
-
} = parentPort2 ? message : message.data;
|
|
1137
|
+
const { type, payload } = parentPort2 ? message : message.data;
|
|
1143
1138
|
onMessage(type, payload);
|
|
1144
1139
|
}
|
|
1145
1140
|
getParentPort().then((parentPort2) => {
|
|
1146
1141
|
if (parentPort2) {
|
|
1147
|
-
parentPort2.on("message",
|
|
1142
|
+
parentPort2.on("message", (message) => {
|
|
1143
|
+
handleMessage(message);
|
|
1144
|
+
});
|
|
1148
1145
|
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
1149
1146
|
} else {
|
|
1150
1147
|
globalThis.onmessage = handleMessage;
|
|
@@ -1159,10 +1156,7 @@
|
|
|
1159
1156
|
return;
|
|
1160
1157
|
}
|
|
1161
1158
|
const parentPort3 = await getParentPort();
|
|
1162
|
-
const {
|
|
1163
|
-
type,
|
|
1164
|
-
payload
|
|
1165
|
-
} = parentPort3 ? message : message.data;
|
|
1159
|
+
const { type, payload } = parentPort3 ? message : message.data;
|
|
1166
1160
|
onMessage(type, payload);
|
|
1167
1161
|
};
|
|
1168
1162
|
}
|
|
@@ -1184,11 +1178,7 @@
|
|
|
1184
1178
|
}
|
|
1185
1179
|
}
|
|
1186
1180
|
static async postMessage(type, payload) {
|
|
1187
|
-
const data = {
|
|
1188
|
-
source: "loaders.gl",
|
|
1189
|
-
type,
|
|
1190
|
-
payload
|
|
1191
|
-
};
|
|
1181
|
+
const data = { source: "loaders.gl", type, payload };
|
|
1192
1182
|
const transferList = getTransferList(payload);
|
|
1193
1183
|
const parentPort2 = await getParentPort();
|
|
1194
1184
|
if (parentPort2) {
|
|
@@ -1199,10 +1189,7 @@
|
|
|
1199
1189
|
}
|
|
1200
1190
|
};
|
|
1201
1191
|
function isKnownMessage(message) {
|
|
1202
|
-
const {
|
|
1203
|
-
type,
|
|
1204
|
-
data
|
|
1205
|
-
} = message;
|
|
1192
|
+
const { type, data } = message;
|
|
1206
1193
|
return type === "message" && data && typeof data.source === "string" && data.source.startsWith("loaders.gl");
|
|
1207
1194
|
}
|
|
1208
1195
|
|
|
@@ -1216,11 +1203,7 @@
|
|
|
1216
1203
|
switch (type) {
|
|
1217
1204
|
case "process":
|
|
1218
1205
|
try {
|
|
1219
|
-
const {
|
|
1220
|
-
input,
|
|
1221
|
-
options = {},
|
|
1222
|
-
context = {}
|
|
1223
|
-
} = payload;
|
|
1206
|
+
const { input, options = {}, context = {} } = payload;
|
|
1224
1207
|
const result = await parseData({
|
|
1225
1208
|
loader,
|
|
1226
1209
|
arrayBuffer: input,
|
|
@@ -1230,14 +1213,10 @@
|
|
|
1230
1213
|
_parse: parseOnMainThread
|
|
1231
1214
|
}
|
|
1232
1215
|
});
|
|
1233
|
-
WorkerBody.postMessage("done", {
|
|
1234
|
-
result
|
|
1235
|
-
});
|
|
1216
|
+
WorkerBody.postMessage("done", { result });
|
|
1236
1217
|
} catch (error) {
|
|
1237
1218
|
const message = error instanceof Error ? error.message : "";
|
|
1238
|
-
WorkerBody.postMessage("error", {
|
|
1239
|
-
error: message
|
|
1240
|
-
});
|
|
1219
|
+
WorkerBody.postMessage("error", { error: message });
|
|
1241
1220
|
}
|
|
1242
1221
|
break;
|
|
1243
1222
|
default:
|
|
@@ -1264,21 +1243,11 @@
|
|
|
1264
1243
|
}
|
|
1265
1244
|
};
|
|
1266
1245
|
WorkerBody.addEventListener(onMessage);
|
|
1267
|
-
const payload = {
|
|
1268
|
-
id: id2,
|
|
1269
|
-
input: arrayBuffer,
|
|
1270
|
-
options
|
|
1271
|
-
};
|
|
1246
|
+
const payload = { id: id2, input: arrayBuffer, options };
|
|
1272
1247
|
WorkerBody.postMessage("process", payload);
|
|
1273
1248
|
});
|
|
1274
1249
|
}
|
|
1275
|
-
async function parseData(
|
|
1276
|
-
let {
|
|
1277
|
-
loader,
|
|
1278
|
-
arrayBuffer,
|
|
1279
|
-
options,
|
|
1280
|
-
context
|
|
1281
|
-
} = _ref;
|
|
1250
|
+
async function parseData({ loader, arrayBuffer, options, context }) {
|
|
1282
1251
|
let data;
|
|
1283
1252
|
let parser;
|
|
1284
1253
|
if (loader.parseSync || loader.parse) {
|
|
@@ -1296,9 +1265,7 @@
|
|
|
1296
1265
|
modules: loader && loader.options && loader.options.modules || {},
|
|
1297
1266
|
worker: false
|
|
1298
1267
|
};
|
|
1299
|
-
return await parser(data, {
|
|
1300
|
-
...options
|
|
1301
|
-
}, context, loader);
|
|
1268
|
+
return await parser(data, { ...options }, context, loader);
|
|
1302
1269
|
}
|
|
1303
1270
|
|
|
1304
1271
|
// src/layers/schema/fast-pbf.ts
|
|
@@ -1430,7 +1397,7 @@
|
|
|
1430
1397
|
}
|
|
1431
1398
|
|
|
1432
1399
|
// src/layers/schema/carto-spatial-tile-loader.ts
|
|
1433
|
-
var VERSION = true ? "9.0.
|
|
1400
|
+
var VERSION = true ? "9.0.8" : "latest";
|
|
1434
1401
|
var id = "cartoSpatialTile";
|
|
1435
1402
|
var DEFAULT_OPTIONS = {
|
|
1436
1403
|
cartoSpatialTile: {
|
|
@@ -1225,9 +1225,7 @@
|
|
|
1225
1225
|
var parentPort = null;
|
|
1226
1226
|
|
|
1227
1227
|
// ../../node_modules/@loaders.gl/worker-utils/dist/lib/worker-utils/get-transfer-list.js
|
|
1228
|
-
function getTransferList(object) {
|
|
1229
|
-
let recursive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
1230
|
-
let transfers = arguments.length > 2 ? arguments[2] : void 0;
|
|
1228
|
+
function getTransferList(object, recursive = true, transfers) {
|
|
1231
1229
|
const transfersSet = transfers || /* @__PURE__ */ new Set();
|
|
1232
1230
|
if (!object) {
|
|
1233
1231
|
} else if (isTransferable(object)) {
|
|
@@ -1273,15 +1271,14 @@
|
|
|
1273
1271
|
static set onmessage(onMessage) {
|
|
1274
1272
|
async function handleMessage(message) {
|
|
1275
1273
|
const parentPort2 = await getParentPort();
|
|
1276
|
-
const {
|
|
1277
|
-
type,
|
|
1278
|
-
payload
|
|
1279
|
-
} = parentPort2 ? message : message.data;
|
|
1274
|
+
const { type, payload } = parentPort2 ? message : message.data;
|
|
1280
1275
|
onMessage(type, payload);
|
|
1281
1276
|
}
|
|
1282
1277
|
getParentPort().then((parentPort2) => {
|
|
1283
1278
|
if (parentPort2) {
|
|
1284
|
-
parentPort2.on("message",
|
|
1279
|
+
parentPort2.on("message", (message) => {
|
|
1280
|
+
handleMessage(message);
|
|
1281
|
+
});
|
|
1285
1282
|
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
1286
1283
|
} else {
|
|
1287
1284
|
globalThis.onmessage = handleMessage;
|
|
@@ -1296,10 +1293,7 @@
|
|
|
1296
1293
|
return;
|
|
1297
1294
|
}
|
|
1298
1295
|
const parentPort3 = await getParentPort();
|
|
1299
|
-
const {
|
|
1300
|
-
type,
|
|
1301
|
-
payload
|
|
1302
|
-
} = parentPort3 ? message : message.data;
|
|
1296
|
+
const { type, payload } = parentPort3 ? message : message.data;
|
|
1303
1297
|
onMessage(type, payload);
|
|
1304
1298
|
};
|
|
1305
1299
|
}
|
|
@@ -1321,11 +1315,7 @@
|
|
|
1321
1315
|
}
|
|
1322
1316
|
}
|
|
1323
1317
|
static async postMessage(type, payload) {
|
|
1324
|
-
const data = {
|
|
1325
|
-
source: "loaders.gl",
|
|
1326
|
-
type,
|
|
1327
|
-
payload
|
|
1328
|
-
};
|
|
1318
|
+
const data = { source: "loaders.gl", type, payload };
|
|
1329
1319
|
const transferList = getTransferList(payload);
|
|
1330
1320
|
const parentPort2 = await getParentPort();
|
|
1331
1321
|
if (parentPort2) {
|
|
@@ -1336,10 +1326,7 @@
|
|
|
1336
1326
|
}
|
|
1337
1327
|
};
|
|
1338
1328
|
function isKnownMessage(message) {
|
|
1339
|
-
const {
|
|
1340
|
-
type,
|
|
1341
|
-
data
|
|
1342
|
-
} = message;
|
|
1329
|
+
const { type, data } = message;
|
|
1343
1330
|
return type === "message" && data && typeof data.source === "string" && data.source.startsWith("loaders.gl");
|
|
1344
1331
|
}
|
|
1345
1332
|
|
|
@@ -1353,11 +1340,7 @@
|
|
|
1353
1340
|
switch (type) {
|
|
1354
1341
|
case "process":
|
|
1355
1342
|
try {
|
|
1356
|
-
const {
|
|
1357
|
-
input,
|
|
1358
|
-
options = {},
|
|
1359
|
-
context = {}
|
|
1360
|
-
} = payload;
|
|
1343
|
+
const { input, options = {}, context = {} } = payload;
|
|
1361
1344
|
const result = await parseData({
|
|
1362
1345
|
loader,
|
|
1363
1346
|
arrayBuffer: input,
|
|
@@ -1367,14 +1350,10 @@
|
|
|
1367
1350
|
_parse: parseOnMainThread
|
|
1368
1351
|
}
|
|
1369
1352
|
});
|
|
1370
|
-
WorkerBody.postMessage("done", {
|
|
1371
|
-
result
|
|
1372
|
-
});
|
|
1353
|
+
WorkerBody.postMessage("done", { result });
|
|
1373
1354
|
} catch (error) {
|
|
1374
1355
|
const message = error instanceof Error ? error.message : "";
|
|
1375
|
-
WorkerBody.postMessage("error", {
|
|
1376
|
-
error: message
|
|
1377
|
-
});
|
|
1356
|
+
WorkerBody.postMessage("error", { error: message });
|
|
1378
1357
|
}
|
|
1379
1358
|
break;
|
|
1380
1359
|
default:
|
|
@@ -1401,21 +1380,11 @@
|
|
|
1401
1380
|
}
|
|
1402
1381
|
};
|
|
1403
1382
|
WorkerBody.addEventListener(onMessage);
|
|
1404
|
-
const payload = {
|
|
1405
|
-
id: id2,
|
|
1406
|
-
input: arrayBuffer,
|
|
1407
|
-
options
|
|
1408
|
-
};
|
|
1383
|
+
const payload = { id: id2, input: arrayBuffer, options };
|
|
1409
1384
|
WorkerBody.postMessage("process", payload);
|
|
1410
1385
|
});
|
|
1411
1386
|
}
|
|
1412
|
-
async function parseData(
|
|
1413
|
-
let {
|
|
1414
|
-
loader,
|
|
1415
|
-
arrayBuffer,
|
|
1416
|
-
options,
|
|
1417
|
-
context
|
|
1418
|
-
} = _ref;
|
|
1387
|
+
async function parseData({ loader, arrayBuffer, options, context }) {
|
|
1419
1388
|
let data;
|
|
1420
1389
|
let parser;
|
|
1421
1390
|
if (loader.parseSync || loader.parse) {
|
|
@@ -1433,9 +1402,7 @@
|
|
|
1433
1402
|
modules: loader && loader.options && loader.options.modules || {},
|
|
1434
1403
|
worker: false
|
|
1435
1404
|
};
|
|
1436
|
-
return await parser(data, {
|
|
1437
|
-
...options
|
|
1438
|
-
}, context, loader);
|
|
1405
|
+
return await parser(data, { ...options }, context, loader);
|
|
1439
1406
|
}
|
|
1440
1407
|
|
|
1441
1408
|
// src/layers/schema/carto-vector-tile-loader.ts
|
|
@@ -1658,7 +1625,7 @@
|
|
|
1658
1625
|
}
|
|
1659
1626
|
|
|
1660
1627
|
// src/layers/schema/carto-vector-tile-loader.ts
|
|
1661
|
-
var VERSION = true ? "9.0.
|
|
1628
|
+
var VERSION = true ? "9.0.8" : "latest";
|
|
1662
1629
|
var id = "cartoVectorTile";
|
|
1663
1630
|
var DEFAULT_OPTIONS = {
|
|
1664
1631
|
cartoVectorTile: {
|