@deck.gl/carto 9.0.0-beta.6 → 9.0.0-beta.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/cartoRasterTile-worker.js +12 -47
- package/dist/cartoSpatialTile-worker.js +12 -47
- package/dist/cartoVectorTile-worker.js +12 -47
- package/dist/dist.dev.js +17 -54
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- 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 +6 -6
- package/package.json +19 -21
|
@@ -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,10 +808,7 @@
|
|
|
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) => {
|
|
@@ -833,10 +828,7 @@
|
|
|
833
828
|
return;
|
|
834
829
|
}
|
|
835
830
|
const parentPort3 = await getParentPort();
|
|
836
|
-
const {
|
|
837
|
-
type,
|
|
838
|
-
payload
|
|
839
|
-
} = parentPort3 ? message : message.data;
|
|
831
|
+
const { type, payload } = parentPort3 ? message : message.data;
|
|
840
832
|
onMessage(type, payload);
|
|
841
833
|
};
|
|
842
834
|
}
|
|
@@ -858,11 +850,7 @@
|
|
|
858
850
|
}
|
|
859
851
|
}
|
|
860
852
|
static async postMessage(type, payload) {
|
|
861
|
-
const data = {
|
|
862
|
-
source: "loaders.gl",
|
|
863
|
-
type,
|
|
864
|
-
payload
|
|
865
|
-
};
|
|
853
|
+
const data = { source: "loaders.gl", type, payload };
|
|
866
854
|
const transferList = getTransferList(payload);
|
|
867
855
|
const parentPort2 = await getParentPort();
|
|
868
856
|
if (parentPort2) {
|
|
@@ -873,10 +861,7 @@
|
|
|
873
861
|
}
|
|
874
862
|
};
|
|
875
863
|
function isKnownMessage(message) {
|
|
876
|
-
const {
|
|
877
|
-
type,
|
|
878
|
-
data
|
|
879
|
-
} = message;
|
|
864
|
+
const { type, data } = message;
|
|
880
865
|
return type === "message" && data && typeof data.source === "string" && data.source.startsWith("loaders.gl");
|
|
881
866
|
}
|
|
882
867
|
|
|
@@ -890,11 +875,7 @@
|
|
|
890
875
|
switch (type) {
|
|
891
876
|
case "process":
|
|
892
877
|
try {
|
|
893
|
-
const {
|
|
894
|
-
input,
|
|
895
|
-
options = {},
|
|
896
|
-
context = {}
|
|
897
|
-
} = payload;
|
|
878
|
+
const { input, options = {}, context = {} } = payload;
|
|
898
879
|
const result = await parseData({
|
|
899
880
|
loader,
|
|
900
881
|
arrayBuffer: input,
|
|
@@ -904,14 +885,10 @@
|
|
|
904
885
|
_parse: parseOnMainThread
|
|
905
886
|
}
|
|
906
887
|
});
|
|
907
|
-
WorkerBody.postMessage("done", {
|
|
908
|
-
result
|
|
909
|
-
});
|
|
888
|
+
WorkerBody.postMessage("done", { result });
|
|
910
889
|
} catch (error) {
|
|
911
890
|
const message = error instanceof Error ? error.message : "";
|
|
912
|
-
WorkerBody.postMessage("error", {
|
|
913
|
-
error: message
|
|
914
|
-
});
|
|
891
|
+
WorkerBody.postMessage("error", { error: message });
|
|
915
892
|
}
|
|
916
893
|
break;
|
|
917
894
|
default:
|
|
@@ -938,21 +915,11 @@
|
|
|
938
915
|
}
|
|
939
916
|
};
|
|
940
917
|
WorkerBody.addEventListener(onMessage);
|
|
941
|
-
const payload = {
|
|
942
|
-
id: id2,
|
|
943
|
-
input: arrayBuffer,
|
|
944
|
-
options
|
|
945
|
-
};
|
|
918
|
+
const payload = { id: id2, input: arrayBuffer, options };
|
|
946
919
|
WorkerBody.postMessage("process", payload);
|
|
947
920
|
});
|
|
948
921
|
}
|
|
949
|
-
async function parseData(
|
|
950
|
-
let {
|
|
951
|
-
loader,
|
|
952
|
-
arrayBuffer,
|
|
953
|
-
options,
|
|
954
|
-
context
|
|
955
|
-
} = _ref;
|
|
922
|
+
async function parseData({ loader, arrayBuffer, options, context }) {
|
|
956
923
|
let data;
|
|
957
924
|
let parser;
|
|
958
925
|
if (loader.parseSync || loader.parse) {
|
|
@@ -970,9 +937,7 @@
|
|
|
970
937
|
modules: loader && loader.options && loader.options.modules || {},
|
|
971
938
|
worker: false
|
|
972
939
|
};
|
|
973
|
-
return await parser(data, {
|
|
974
|
-
...options
|
|
975
|
-
}, context, loader);
|
|
940
|
+
return await parser(data, { ...options }, context, loader);
|
|
976
941
|
}
|
|
977
942
|
|
|
978
943
|
// src/layers/schema/fast-pbf.ts
|
|
@@ -1043,7 +1008,7 @@
|
|
|
1043
1008
|
}
|
|
1044
1009
|
|
|
1045
1010
|
// src/layers/schema/carto-raster-tile-loader.ts
|
|
1046
|
-
var VERSION = true ? "9.0.0-beta.
|
|
1011
|
+
var VERSION = true ? "9.0.0-beta.8" : "latest";
|
|
1047
1012
|
var id = "cartoRasterTile";
|
|
1048
1013
|
var DEFAULT_OPTIONS = {
|
|
1049
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,10 +1134,7 @@
|
|
|
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) => {
|
|
@@ -1159,10 +1154,7 @@
|
|
|
1159
1154
|
return;
|
|
1160
1155
|
}
|
|
1161
1156
|
const parentPort3 = await getParentPort();
|
|
1162
|
-
const {
|
|
1163
|
-
type,
|
|
1164
|
-
payload
|
|
1165
|
-
} = parentPort3 ? message : message.data;
|
|
1157
|
+
const { type, payload } = parentPort3 ? message : message.data;
|
|
1166
1158
|
onMessage(type, payload);
|
|
1167
1159
|
};
|
|
1168
1160
|
}
|
|
@@ -1184,11 +1176,7 @@
|
|
|
1184
1176
|
}
|
|
1185
1177
|
}
|
|
1186
1178
|
static async postMessage(type, payload) {
|
|
1187
|
-
const data = {
|
|
1188
|
-
source: "loaders.gl",
|
|
1189
|
-
type,
|
|
1190
|
-
payload
|
|
1191
|
-
};
|
|
1179
|
+
const data = { source: "loaders.gl", type, payload };
|
|
1192
1180
|
const transferList = getTransferList(payload);
|
|
1193
1181
|
const parentPort2 = await getParentPort();
|
|
1194
1182
|
if (parentPort2) {
|
|
@@ -1199,10 +1187,7 @@
|
|
|
1199
1187
|
}
|
|
1200
1188
|
};
|
|
1201
1189
|
function isKnownMessage(message) {
|
|
1202
|
-
const {
|
|
1203
|
-
type,
|
|
1204
|
-
data
|
|
1205
|
-
} = message;
|
|
1190
|
+
const { type, data } = message;
|
|
1206
1191
|
return type === "message" && data && typeof data.source === "string" && data.source.startsWith("loaders.gl");
|
|
1207
1192
|
}
|
|
1208
1193
|
|
|
@@ -1216,11 +1201,7 @@
|
|
|
1216
1201
|
switch (type) {
|
|
1217
1202
|
case "process":
|
|
1218
1203
|
try {
|
|
1219
|
-
const {
|
|
1220
|
-
input,
|
|
1221
|
-
options = {},
|
|
1222
|
-
context = {}
|
|
1223
|
-
} = payload;
|
|
1204
|
+
const { input, options = {}, context = {} } = payload;
|
|
1224
1205
|
const result = await parseData({
|
|
1225
1206
|
loader,
|
|
1226
1207
|
arrayBuffer: input,
|
|
@@ -1230,14 +1211,10 @@
|
|
|
1230
1211
|
_parse: parseOnMainThread
|
|
1231
1212
|
}
|
|
1232
1213
|
});
|
|
1233
|
-
WorkerBody.postMessage("done", {
|
|
1234
|
-
result
|
|
1235
|
-
});
|
|
1214
|
+
WorkerBody.postMessage("done", { result });
|
|
1236
1215
|
} catch (error) {
|
|
1237
1216
|
const message = error instanceof Error ? error.message : "";
|
|
1238
|
-
WorkerBody.postMessage("error", {
|
|
1239
|
-
error: message
|
|
1240
|
-
});
|
|
1217
|
+
WorkerBody.postMessage("error", { error: message });
|
|
1241
1218
|
}
|
|
1242
1219
|
break;
|
|
1243
1220
|
default:
|
|
@@ -1264,21 +1241,11 @@
|
|
|
1264
1241
|
}
|
|
1265
1242
|
};
|
|
1266
1243
|
WorkerBody.addEventListener(onMessage);
|
|
1267
|
-
const payload = {
|
|
1268
|
-
id: id2,
|
|
1269
|
-
input: arrayBuffer,
|
|
1270
|
-
options
|
|
1271
|
-
};
|
|
1244
|
+
const payload = { id: id2, input: arrayBuffer, options };
|
|
1272
1245
|
WorkerBody.postMessage("process", payload);
|
|
1273
1246
|
});
|
|
1274
1247
|
}
|
|
1275
|
-
async function parseData(
|
|
1276
|
-
let {
|
|
1277
|
-
loader,
|
|
1278
|
-
arrayBuffer,
|
|
1279
|
-
options,
|
|
1280
|
-
context
|
|
1281
|
-
} = _ref;
|
|
1248
|
+
async function parseData({ loader, arrayBuffer, options, context }) {
|
|
1282
1249
|
let data;
|
|
1283
1250
|
let parser;
|
|
1284
1251
|
if (loader.parseSync || loader.parse) {
|
|
@@ -1296,9 +1263,7 @@
|
|
|
1296
1263
|
modules: loader && loader.options && loader.options.modules || {},
|
|
1297
1264
|
worker: false
|
|
1298
1265
|
};
|
|
1299
|
-
return await parser(data, {
|
|
1300
|
-
...options
|
|
1301
|
-
}, context, loader);
|
|
1266
|
+
return await parser(data, { ...options }, context, loader);
|
|
1302
1267
|
}
|
|
1303
1268
|
|
|
1304
1269
|
// src/layers/schema/fast-pbf.ts
|
|
@@ -1430,7 +1395,7 @@
|
|
|
1430
1395
|
}
|
|
1431
1396
|
|
|
1432
1397
|
// src/layers/schema/carto-spatial-tile-loader.ts
|
|
1433
|
-
var VERSION = true ? "9.0.0-beta.
|
|
1398
|
+
var VERSION = true ? "9.0.0-beta.8" : "latest";
|
|
1434
1399
|
var id = "cartoSpatialTile";
|
|
1435
1400
|
var DEFAULT_OPTIONS = {
|
|
1436
1401
|
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,10 +1271,7 @@
|
|
|
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) => {
|
|
@@ -1296,10 +1291,7 @@
|
|
|
1296
1291
|
return;
|
|
1297
1292
|
}
|
|
1298
1293
|
const parentPort3 = await getParentPort();
|
|
1299
|
-
const {
|
|
1300
|
-
type,
|
|
1301
|
-
payload
|
|
1302
|
-
} = parentPort3 ? message : message.data;
|
|
1294
|
+
const { type, payload } = parentPort3 ? message : message.data;
|
|
1303
1295
|
onMessage(type, payload);
|
|
1304
1296
|
};
|
|
1305
1297
|
}
|
|
@@ -1321,11 +1313,7 @@
|
|
|
1321
1313
|
}
|
|
1322
1314
|
}
|
|
1323
1315
|
static async postMessage(type, payload) {
|
|
1324
|
-
const data = {
|
|
1325
|
-
source: "loaders.gl",
|
|
1326
|
-
type,
|
|
1327
|
-
payload
|
|
1328
|
-
};
|
|
1316
|
+
const data = { source: "loaders.gl", type, payload };
|
|
1329
1317
|
const transferList = getTransferList(payload);
|
|
1330
1318
|
const parentPort2 = await getParentPort();
|
|
1331
1319
|
if (parentPort2) {
|
|
@@ -1336,10 +1324,7 @@
|
|
|
1336
1324
|
}
|
|
1337
1325
|
};
|
|
1338
1326
|
function isKnownMessage(message) {
|
|
1339
|
-
const {
|
|
1340
|
-
type,
|
|
1341
|
-
data
|
|
1342
|
-
} = message;
|
|
1327
|
+
const { type, data } = message;
|
|
1343
1328
|
return type === "message" && data && typeof data.source === "string" && data.source.startsWith("loaders.gl");
|
|
1344
1329
|
}
|
|
1345
1330
|
|
|
@@ -1353,11 +1338,7 @@
|
|
|
1353
1338
|
switch (type) {
|
|
1354
1339
|
case "process":
|
|
1355
1340
|
try {
|
|
1356
|
-
const {
|
|
1357
|
-
input,
|
|
1358
|
-
options = {},
|
|
1359
|
-
context = {}
|
|
1360
|
-
} = payload;
|
|
1341
|
+
const { input, options = {}, context = {} } = payload;
|
|
1361
1342
|
const result = await parseData({
|
|
1362
1343
|
loader,
|
|
1363
1344
|
arrayBuffer: input,
|
|
@@ -1367,14 +1348,10 @@
|
|
|
1367
1348
|
_parse: parseOnMainThread
|
|
1368
1349
|
}
|
|
1369
1350
|
});
|
|
1370
|
-
WorkerBody.postMessage("done", {
|
|
1371
|
-
result
|
|
1372
|
-
});
|
|
1351
|
+
WorkerBody.postMessage("done", { result });
|
|
1373
1352
|
} catch (error) {
|
|
1374
1353
|
const message = error instanceof Error ? error.message : "";
|
|
1375
|
-
WorkerBody.postMessage("error", {
|
|
1376
|
-
error: message
|
|
1377
|
-
});
|
|
1354
|
+
WorkerBody.postMessage("error", { error: message });
|
|
1378
1355
|
}
|
|
1379
1356
|
break;
|
|
1380
1357
|
default:
|
|
@@ -1401,21 +1378,11 @@
|
|
|
1401
1378
|
}
|
|
1402
1379
|
};
|
|
1403
1380
|
WorkerBody.addEventListener(onMessage);
|
|
1404
|
-
const payload = {
|
|
1405
|
-
id: id2,
|
|
1406
|
-
input: arrayBuffer,
|
|
1407
|
-
options
|
|
1408
|
-
};
|
|
1381
|
+
const payload = { id: id2, input: arrayBuffer, options };
|
|
1409
1382
|
WorkerBody.postMessage("process", payload);
|
|
1410
1383
|
});
|
|
1411
1384
|
}
|
|
1412
|
-
async function parseData(
|
|
1413
|
-
let {
|
|
1414
|
-
loader,
|
|
1415
|
-
arrayBuffer,
|
|
1416
|
-
options,
|
|
1417
|
-
context
|
|
1418
|
-
} = _ref;
|
|
1385
|
+
async function parseData({ loader, arrayBuffer, options, context }) {
|
|
1419
1386
|
let data;
|
|
1420
1387
|
let parser;
|
|
1421
1388
|
if (loader.parseSync || loader.parse) {
|
|
@@ -1433,9 +1400,7 @@
|
|
|
1433
1400
|
modules: loader && loader.options && loader.options.modules || {},
|
|
1434
1401
|
worker: false
|
|
1435
1402
|
};
|
|
1436
|
-
return await parser(data, {
|
|
1437
|
-
...options
|
|
1438
|
-
}, context, loader);
|
|
1403
|
+
return await parser(data, { ...options }, context, loader);
|
|
1439
1404
|
}
|
|
1440
1405
|
|
|
1441
1406
|
// src/layers/schema/carto-vector-tile-loader.ts
|
|
@@ -1658,7 +1623,7 @@
|
|
|
1658
1623
|
}
|
|
1659
1624
|
|
|
1660
1625
|
// src/layers/schema/carto-vector-tile-loader.ts
|
|
1661
|
-
var VERSION = true ? "9.0.0-beta.
|
|
1626
|
+
var VERSION = true ? "9.0.0-beta.8" : "latest";
|
|
1662
1627
|
var id = "cartoVectorTile";
|
|
1663
1628
|
var DEFAULT_OPTIONS = {
|
|
1664
1629
|
cartoVectorTile: {
|
package/dist/dist.dev.js
CHANGED
|
@@ -10536,11 +10536,11 @@ void main(void) {
|
|
|
10536
10536
|
|
|
10537
10537
|
// ../../node_modules/@loaders.gl/gis/dist/lib/binary-features/binary-to-geojson.js
|
|
10538
10538
|
function binaryToGeojson(data, options) {
|
|
10539
|
-
const globalFeatureId = options
|
|
10539
|
+
const globalFeatureId = options?.globalFeatureId;
|
|
10540
10540
|
if (globalFeatureId !== void 0) {
|
|
10541
10541
|
return getSingleFeature(data, globalFeatureId);
|
|
10542
10542
|
}
|
|
10543
|
-
return parseFeatures(data, options
|
|
10543
|
+
return parseFeatures(data, options?.type);
|
|
10544
10544
|
}
|
|
10545
10545
|
function getSingleFeature(data, globalFeatureId) {
|
|
10546
10546
|
const dataArray = normalizeInput(data);
|
|
@@ -10578,7 +10578,7 @@ void main(void) {
|
|
|
10578
10578
|
return polygonToGeoJson(data, startIndex, endIndex);
|
|
10579
10579
|
default:
|
|
10580
10580
|
const unexpectedInput = data;
|
|
10581
|
-
throw new Error(`Unsupported geometry type: ${unexpectedInput
|
|
10581
|
+
throw new Error(`Unsupported geometry type: ${unexpectedInput?.type}`);
|
|
10582
10582
|
}
|
|
10583
10583
|
}
|
|
10584
10584
|
function normalizeInput(data, type) {
|
|
@@ -10622,33 +10622,20 @@ void main(void) {
|
|
|
10622
10622
|
const geometry = binaryToGeometry(data, startIndex, endIndex);
|
|
10623
10623
|
const properties = parseProperties(data, startIndex, endIndex);
|
|
10624
10624
|
const fields = parseFields(data, startIndex, endIndex);
|
|
10625
|
-
return {
|
|
10626
|
-
type: "Feature",
|
|
10627
|
-
geometry,
|
|
10628
|
-
properties,
|
|
10629
|
-
...fields
|
|
10630
|
-
};
|
|
10625
|
+
return { type: "Feature", geometry, properties, ...fields };
|
|
10631
10626
|
}
|
|
10632
|
-
function parseFields(data) {
|
|
10633
|
-
let startIndex = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
10634
|
-
let endIndex = arguments.length > 2 ? arguments[2] : void 0;
|
|
10627
|
+
function parseFields(data, startIndex = 0, endIndex) {
|
|
10635
10628
|
return data.fields && data.fields[data.featureIds.value[startIndex]];
|
|
10636
10629
|
}
|
|
10637
|
-
function parseProperties(data) {
|
|
10638
|
-
let startIndex = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
10639
|
-
let endIndex = arguments.length > 2 ? arguments[2] : void 0;
|
|
10630
|
+
function parseProperties(data, startIndex = 0, endIndex) {
|
|
10640
10631
|
const properties = Object.assign({}, data.properties[data.featureIds.value[startIndex]]);
|
|
10641
10632
|
for (const key in data.numericProps) {
|
|
10642
10633
|
properties[key] = data.numericProps[key].value[startIndex];
|
|
10643
10634
|
}
|
|
10644
10635
|
return properties;
|
|
10645
10636
|
}
|
|
10646
|
-
function polygonToGeoJson(data) {
|
|
10647
|
-
|
|
10648
|
-
let endIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Infinity;
|
|
10649
|
-
const {
|
|
10650
|
-
positions
|
|
10651
|
-
} = data;
|
|
10637
|
+
function polygonToGeoJson(data, startIndex = -Infinity, endIndex = Infinity) {
|
|
10638
|
+
const { positions } = data;
|
|
10652
10639
|
const polygonIndices = data.polygonIndices.value.filter((x) => x >= startIndex && x <= endIndex);
|
|
10653
10640
|
const primitivePolygonIndices = data.primitivePolygonIndices.value.filter((x) => x >= startIndex && x <= endIndex);
|
|
10654
10641
|
const multi = polygonIndices.length > 2;
|
|
@@ -10660,10 +10647,7 @@ void main(void) {
|
|
|
10660
10647
|
const ringCoordinates = ringToGeoJson(positions, startRingIndex, endRingIndex);
|
|
10661
10648
|
coordinates2.push(ringCoordinates);
|
|
10662
10649
|
}
|
|
10663
|
-
return {
|
|
10664
|
-
type: "Polygon",
|
|
10665
|
-
coordinates: coordinates2
|
|
10666
|
-
};
|
|
10650
|
+
return { type: "Polygon", coordinates: coordinates2 };
|
|
10667
10651
|
}
|
|
10668
10652
|
const coordinates = [];
|
|
10669
10653
|
for (let i = 0; i < polygonIndices.length - 1; i++) {
|
|
@@ -10672,52 +10656,31 @@ void main(void) {
|
|
|
10672
10656
|
const polygonCoordinates = polygonToGeoJson(data, startPolygonIndex, endPolygonIndex).coordinates;
|
|
10673
10657
|
coordinates.push(polygonCoordinates);
|
|
10674
10658
|
}
|
|
10675
|
-
return {
|
|
10676
|
-
type: "MultiPolygon",
|
|
10677
|
-
coordinates
|
|
10678
|
-
};
|
|
10659
|
+
return { type: "MultiPolygon", coordinates };
|
|
10679
10660
|
}
|
|
10680
|
-
function lineStringToGeoJson(data) {
|
|
10681
|
-
|
|
10682
|
-
let endIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Infinity;
|
|
10683
|
-
const {
|
|
10684
|
-
positions
|
|
10685
|
-
} = data;
|
|
10661
|
+
function lineStringToGeoJson(data, startIndex = -Infinity, endIndex = Infinity) {
|
|
10662
|
+
const { positions } = data;
|
|
10686
10663
|
const pathIndices = data.pathIndices.value.filter((x) => x >= startIndex && x <= endIndex);
|
|
10687
10664
|
const multi = pathIndices.length > 2;
|
|
10688
10665
|
if (!multi) {
|
|
10689
10666
|
const coordinates2 = ringToGeoJson(positions, pathIndices[0], pathIndices[1]);
|
|
10690
|
-
return {
|
|
10691
|
-
type: "LineString",
|
|
10692
|
-
coordinates: coordinates2
|
|
10693
|
-
};
|
|
10667
|
+
return { type: "LineString", coordinates: coordinates2 };
|
|
10694
10668
|
}
|
|
10695
10669
|
const coordinates = [];
|
|
10696
10670
|
for (let i = 0; i < pathIndices.length - 1; i++) {
|
|
10697
10671
|
const ringCoordinates = ringToGeoJson(positions, pathIndices[i], pathIndices[i + 1]);
|
|
10698
10672
|
coordinates.push(ringCoordinates);
|
|
10699
10673
|
}
|
|
10700
|
-
return {
|
|
10701
|
-
type: "MultiLineString",
|
|
10702
|
-
coordinates
|
|
10703
|
-
};
|
|
10674
|
+
return { type: "MultiLineString", coordinates };
|
|
10704
10675
|
}
|
|
10705
10676
|
function pointToGeoJson(data, startIndex, endIndex) {
|
|
10706
|
-
const {
|
|
10707
|
-
positions
|
|
10708
|
-
} = data;
|
|
10677
|
+
const { positions } = data;
|
|
10709
10678
|
const coordinates = ringToGeoJson(positions, startIndex, endIndex);
|
|
10710
10679
|
const multi = coordinates.length > 1;
|
|
10711
10680
|
if (multi) {
|
|
10712
|
-
return {
|
|
10713
|
-
type: "MultiPoint",
|
|
10714
|
-
coordinates
|
|
10715
|
-
};
|
|
10681
|
+
return { type: "MultiPoint", coordinates };
|
|
10716
10682
|
}
|
|
10717
|
-
return {
|
|
10718
|
-
type: "Point",
|
|
10719
|
-
coordinates: coordinates[0]
|
|
10720
|
-
};
|
|
10683
|
+
return { type: "Point", coordinates: coordinates[0] };
|
|
10721
10684
|
}
|
|
10722
10685
|
function ringToGeoJson(positions, startIndex, endIndex) {
|
|
10723
10686
|
startIndex = startIndex || 0;
|
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.7" : "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.7" : "latest";
|
|
519
519
|
var id2 = "cartoSpatialTile";
|
|
520
520
|
var DEFAULT_OPTIONS2 = {
|
|
521
521
|
cartoSpatialTile: {
|
|
@@ -1255,7 +1255,7 @@ var carto_properties_tile_loader_default = CartoPropertiesTileLoader;
|
|
|
1255
1255
|
|
|
1256
1256
|
// dist/layers/schema/carto-vector-tile-loader.js
|
|
1257
1257
|
var import_earcut = __toESM(require("earcut"), 1);
|
|
1258
|
-
var VERSION3 = true ? "9.0.0-beta.
|
|
1258
|
+
var VERSION3 = true ? "9.0.0-beta.7" : "latest";
|
|
1259
1259
|
var id3 = "cartoVectorTile";
|
|
1260
1260
|
var DEFAULT_OPTIONS3 = {
|
|
1261
1261
|
cartoVectorTile: {
|