@geowiki/map 0.16.9-dev.13 → 0.16.9-dev.15
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/{GeoWikiMap-G2JPQNTZ.mjs → GeoWikiMap-3QTU7AVR.mjs} +1 -1
- package/dist/{chunk-3LCQXIYM.mjs → chunk-7CQUEXPM.mjs} +161 -255
- package/dist/index.js +301 -459
- package/dist/index.mjs +139 -203
- package/dist/styles.css +1 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -166,8 +166,7 @@ function getAdjPixel(y, x, selectedValue, array2dMatrix) {
|
|
|
166
166
|
while (pixelsToCheck.length > 0) {
|
|
167
167
|
const [xTiff, yTiff] = pixelsToCheck.pop();
|
|
168
168
|
var key = xTiff + "_" + yTiff;
|
|
169
|
-
if (checkedPixels.has(key))
|
|
170
|
-
continue;
|
|
169
|
+
if (checkedPixels.has(key)) continue;
|
|
171
170
|
checkedPixels.add(key);
|
|
172
171
|
if (array2dMatrix[yTiff][xTiff] === selectedValue) {
|
|
173
172
|
sameValPixels.push([yTiff, xTiff]);
|
|
@@ -195,8 +194,7 @@ function pointInsidePolygon(xTiff, yTiff, vs) {
|
|
|
195
194
|
var xi = vs[i].xTiff, yi = vs[i].yTiff;
|
|
196
195
|
var xj = vs[j].xTiff, yj = vs[j].yTiff;
|
|
197
196
|
var intersect = yi > yTiff !== yj > yTiff && xTiff < (xj - xi) * (yTiff - yi) / (yj - yi) + xi;
|
|
198
|
-
if (intersect)
|
|
199
|
-
inside = !inside;
|
|
197
|
+
if (intersect) inside = !inside;
|
|
200
198
|
}
|
|
201
199
|
return inside;
|
|
202
200
|
}
|
|
@@ -305,7 +303,7 @@ var init_canvas = __esm({
|
|
|
305
303
|
ctx == null ? void 0 : ctx.putImageData(imageData, 0, 0);
|
|
306
304
|
return canvas;
|
|
307
305
|
};
|
|
308
|
-
getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvasContext, selectedBand) => __async(
|
|
306
|
+
getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvasContext, selectedBand) => __async(null, null, function* () {
|
|
309
307
|
var _a, _b;
|
|
310
308
|
try {
|
|
311
309
|
var tiffWidth = rasterItem.width;
|
|
@@ -321,8 +319,7 @@ var init_canvas = __esm({
|
|
|
321
319
|
var rgb = null;
|
|
322
320
|
if (((_a = rasterItem.name) == null ? void 0 : _a.toLowerCase().includes("ndvi")) && ((_b = rasterItem.name) == null ? void 0 : _b.toLowerCase().includes("perc")))
|
|
323
321
|
rgb = yield getNDVIValueForPixel(ndviImageCanvasContext, xTiff, yTiff);
|
|
324
|
-
else
|
|
325
|
-
rgb = null;
|
|
322
|
+
else rgb = null;
|
|
326
323
|
return [
|
|
327
324
|
selectedValue,
|
|
328
325
|
rgb !== null && rgb !== void 0 ? {
|
|
@@ -365,12 +362,11 @@ var init_canvas = __esm({
|
|
|
365
362
|
rasterItem.buffer = [...asset.buffer];
|
|
366
363
|
rasterItem.uri = [...asset.uri];
|
|
367
364
|
rasterItem.buffer[selectedBand] = new Uint32Array(assetBuffer);
|
|
368
|
-
if (Array.isArray(rasterItem.uri))
|
|
369
|
-
rasterItem.uri[selectedBand] = uri;
|
|
365
|
+
if (Array.isArray(rasterItem.uri)) rasterItem.uri[selectedBand] = uri;
|
|
370
366
|
}
|
|
371
367
|
return rasterItem;
|
|
372
368
|
};
|
|
373
|
-
getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnnotation, selectedBand, metadata) => __async(
|
|
369
|
+
getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnnotation, selectedBand, metadata) => __async(null, null, function* () {
|
|
374
370
|
var { newArray, canvas } = yield getEmptyPreviewRasterItemForInsert(
|
|
375
371
|
length,
|
|
376
372
|
width,
|
|
@@ -395,12 +391,12 @@ var init_canvas = __esm({
|
|
|
395
391
|
}
|
|
396
392
|
return rasterItem;
|
|
397
393
|
});
|
|
398
|
-
getEmptyPreviewRasterItemForInsert = (length, width, height, labels) => __async(
|
|
394
|
+
getEmptyPreviewRasterItemForInsert = (length, width, height, labels) => __async(null, null, function* () {
|
|
399
395
|
const newArray = new Uint32Array(length).fill(0);
|
|
400
396
|
const canvas = grayScaleArrayToCanvas(newArray, width, height, labels);
|
|
401
397
|
return { newArray, canvas };
|
|
402
398
|
});
|
|
403
|
-
updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnnotation) => __async(
|
|
399
|
+
updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnnotation) => __async(null, null, function* () {
|
|
404
400
|
var _a, _b, _c;
|
|
405
401
|
if (!fromRasterItem) {
|
|
406
402
|
return toPreviewRasterItem;
|
|
@@ -426,7 +422,7 @@ var init_canvas = __esm({
|
|
|
426
422
|
}
|
|
427
423
|
return toPreviewRasterItem;
|
|
428
424
|
});
|
|
429
|
-
getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(
|
|
425
|
+
getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(null, null, function* () {
|
|
430
426
|
const tiff = yield (0, import_geotiff.fromArrayBuffer)(arrayBuffer);
|
|
431
427
|
const image = yield tiff.getImage();
|
|
432
428
|
const pool = new import_geotiff.Pool();
|
|
@@ -450,7 +446,7 @@ var init_canvas = __esm({
|
|
|
450
446
|
pool.destroy();
|
|
451
447
|
return { width, height, rasterItems };
|
|
452
448
|
});
|
|
453
|
-
getRasterItems = (arrayBuffer, projectType) => __async(
|
|
449
|
+
getRasterItems = (arrayBuffer, projectType) => __async(null, null, function* () {
|
|
454
450
|
const tiff = yield (0, import_geotiff.fromArrayBuffer)(arrayBuffer);
|
|
455
451
|
const image = yield tiff.getImage();
|
|
456
452
|
const pool = new import_geotiff.Pool();
|
|
@@ -490,7 +486,7 @@ var init_canvas = __esm({
|
|
|
490
486
|
pool.destroy();
|
|
491
487
|
return { rasters, width, height, rasterItems };
|
|
492
488
|
});
|
|
493
|
-
getAssetItemsForLocationAssets = (assets, labels) => __async(
|
|
489
|
+
getAssetItemsForLocationAssets = (assets, labels) => __async(null, null, function* () {
|
|
494
490
|
var rasterItems = [];
|
|
495
491
|
for (var i = 0; i < (assets == null ? void 0 : assets.length); i++) {
|
|
496
492
|
const item = assets[i];
|
|
@@ -513,7 +509,7 @@ var init_canvas = __esm({
|
|
|
513
509
|
}
|
|
514
510
|
return rasterItems;
|
|
515
511
|
});
|
|
516
|
-
getRasterAssetItemsForLocationComposite = (assets) => __async(
|
|
512
|
+
getRasterAssetItemsForLocationComposite = (assets) => __async(null, null, function* () {
|
|
517
513
|
var rasterItems = [];
|
|
518
514
|
for (var i = 0; i < (assets == null ? void 0 : assets.length); i++) {
|
|
519
515
|
const item = assets[i];
|
|
@@ -534,7 +530,7 @@ var init_canvas = __esm({
|
|
|
534
530
|
}
|
|
535
531
|
return rasterItems;
|
|
536
532
|
});
|
|
537
|
-
copyAllRasterSegments = (rasterItem, previewRasterItem, selectedValue, labelValue, labels) => __async(
|
|
533
|
+
copyAllRasterSegments = (rasterItem, previewRasterItem, selectedValue, labelValue, labels) => __async(null, null, function* () {
|
|
538
534
|
var newBuffer = overwriteArrayBufferWithSelectedValue(
|
|
539
535
|
rasterItem.buffer,
|
|
540
536
|
previewRasterItem.buffer,
|
|
@@ -603,7 +599,7 @@ var init_canvas = __esm({
|
|
|
603
599
|
return destRasterItem;
|
|
604
600
|
}
|
|
605
601
|
};
|
|
606
|
-
paintRasterSegment = (sourceRasterItem, destRasterItem, locations, bounds, labelValue, labels, paintType, selectedBand, isAnnualAnnotation) => __async(
|
|
602
|
+
paintRasterSegment = (sourceRasterItem, destRasterItem, locations, bounds, labelValue, labels, paintType, selectedBand, isAnnualAnnotation) => __async(null, null, function* () {
|
|
607
603
|
var tiffWidth = sourceRasterItem.width;
|
|
608
604
|
var tiffHeight = sourceRasterItem.height;
|
|
609
605
|
var annotatedRaster = isAnnualAnnotation ? destRasterItem.buffer : destRasterItem.buffer[selectedBand];
|
|
@@ -720,7 +716,7 @@ var init_canvas = __esm({
|
|
|
720
716
|
destRasterItem.name = "My Annotation";
|
|
721
717
|
return destRasterItem;
|
|
722
718
|
});
|
|
723
|
-
getActiveLearningAnnotation = (assetHref, projectType) => __async(
|
|
719
|
+
getActiveLearningAnnotation = (assetHref, projectType) => __async(null, null, function* () {
|
|
724
720
|
const res = yield fetch(assetHref);
|
|
725
721
|
const buffer = yield res.arrayBuffer();
|
|
726
722
|
const rItems = yield getRasterItems(buffer, projectType);
|
|
@@ -737,7 +733,7 @@ var init_canvas = __esm({
|
|
|
737
733
|
};
|
|
738
734
|
return assetItem;
|
|
739
735
|
});
|
|
740
|
-
createImageDataForNDVI = (asset) => __async(
|
|
736
|
+
createImageDataForNDVI = (asset) => __async(null, null, function* () {
|
|
741
737
|
var canvas = document.createElement("canvas");
|
|
742
738
|
var context = canvas.getContext("2d");
|
|
743
739
|
var image = new Image();
|
|
@@ -747,7 +743,7 @@ var init_canvas = __esm({
|
|
|
747
743
|
context == null ? void 0 : context.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
748
744
|
return context;
|
|
749
745
|
});
|
|
750
|
-
getNDVIValueForPixel = (ndviImageCanvasContext, x, y) => __async(
|
|
746
|
+
getNDVIValueForPixel = (ndviImageCanvasContext, x, y) => __async(null, null, function* () {
|
|
751
747
|
var context = ndviImageCanvasContext;
|
|
752
748
|
var data = context == null ? void 0 : context.getImageData(x, y, 1, 1).data;
|
|
753
749
|
return data;
|
|
@@ -961,8 +957,7 @@ function getRasterAssetItemsForLocationAssets(assets) {
|
|
|
961
957
|
if (Array.isArray((_a = rItem.result) == null ? void 0 : _a.base64)) {
|
|
962
958
|
bufferData = (_b = rItem.result) == null ? void 0 : _b.base64.map((x) => {
|
|
963
959
|
var _a2, _b2;
|
|
964
|
-
if (((_a2 = rItem.result) == null ? void 0 : _a2.arrayType) == "uint8")
|
|
965
|
-
return Buffer.from(x, "base64");
|
|
960
|
+
if (((_a2 = rItem.result) == null ? void 0 : _a2.arrayType) == "uint8") return Buffer.from(x, "base64");
|
|
966
961
|
else if (((_b2 = rItem.result) == null ? void 0 : _b2.arrayType) == "uint32") {
|
|
967
962
|
const buffer2 = Buffer.from(x, "base64");
|
|
968
963
|
return new Uint32Array(
|
|
@@ -1043,16 +1038,14 @@ function ClearAnnotation(annotatedRasterAsset, isAnnualAnnotation, selectedBand,
|
|
|
1043
1038
|
selectedBand,
|
|
1044
1039
|
annotationRasterAsset.metadata
|
|
1045
1040
|
);
|
|
1046
|
-
if (isAnnualAnnotation)
|
|
1047
|
-
return { annotationRaster, pastValues };
|
|
1041
|
+
if (isAnnualAnnotation) return { annotationRaster, pastValues };
|
|
1048
1042
|
else {
|
|
1049
1043
|
var multiBandAnnotation = annotatedRasterAsset;
|
|
1050
1044
|
if (multiBandAnnotation == null ? void 0 : multiBandAnnotation.buffer[selectedBand]) {
|
|
1051
1045
|
multiBandAnnotation.buffer[selectedBand] = annotationRaster.buffer[selectedBand];
|
|
1052
1046
|
multiBandAnnotation.uri[selectedBand] = annotationRaster.uri[selectedBand];
|
|
1053
1047
|
return { multiBandAnnotation, undefined: void 0 };
|
|
1054
|
-
} else
|
|
1055
|
-
return { annotatedRasterAsset: void 0, undefined: void 0 };
|
|
1048
|
+
} else return { annotatedRasterAsset: void 0, undefined: void 0 };
|
|
1056
1049
|
}
|
|
1057
1050
|
});
|
|
1058
1051
|
}
|
|
@@ -1086,8 +1079,7 @@ function createTask(locationId, projectId, referenceDate) {
|
|
|
1086
1079
|
currentTask: res.task,
|
|
1087
1080
|
annotation_dates: yield getAnnotationDates(res == null ? void 0 : res.task)
|
|
1088
1081
|
};
|
|
1089
|
-
} else
|
|
1090
|
-
return { location: null, currentTask: null, annotation_dates: null };
|
|
1082
|
+
} else return { location: null, currentTask: null, annotation_dates: null };
|
|
1091
1083
|
});
|
|
1092
1084
|
}
|
|
1093
1085
|
function getTask(taskId) {
|
|
@@ -1115,8 +1107,7 @@ function getTask(taskId) {
|
|
|
1115
1107
|
annotation_dates: yield getAnnotationDates(res == null ? void 0 : res.task),
|
|
1116
1108
|
location: locData
|
|
1117
1109
|
};
|
|
1118
|
-
} else
|
|
1119
|
-
return { currentTask: null, annotation_dates: null, location: null };
|
|
1110
|
+
} else return { currentTask: null, annotation_dates: null, location: null };
|
|
1120
1111
|
});
|
|
1121
1112
|
}
|
|
1122
1113
|
function getActiveLearningAnnotationAsset(assetHref, labels, projectDetail) {
|
|
@@ -1168,8 +1159,7 @@ function insertEmptyBufferForSingleBand(length, width, height, selectedBand, ann
|
|
|
1168
1159
|
annotatedAsset.buffer[selectedBand] = newArray;
|
|
1169
1160
|
annotatedAsset.uri[selectedBand] = canvas.toDataURL();
|
|
1170
1161
|
return annotatedAsset;
|
|
1171
|
-
} else
|
|
1172
|
-
return null;
|
|
1162
|
+
} else return null;
|
|
1173
1163
|
});
|
|
1174
1164
|
}
|
|
1175
1165
|
function getTaskChangeDetails(taskId) {
|
|
@@ -1183,10 +1173,8 @@ function getTaskGeometryDetail(taskId) {
|
|
|
1183
1173
|
});
|
|
1184
1174
|
}
|
|
1185
1175
|
function getCentroid(geometry, has_area_of_interest, geometry_aoi, is_segment, geometry_segment) {
|
|
1186
|
-
if (has_area_of_interest)
|
|
1187
|
-
|
|
1188
|
-
if (is_segment)
|
|
1189
|
-
return geometry_segment;
|
|
1176
|
+
if (has_area_of_interest) return geometry_aoi;
|
|
1177
|
+
if (is_segment) return geometry_segment;
|
|
1190
1178
|
return geometry;
|
|
1191
1179
|
}
|
|
1192
1180
|
function showAnnotation(savedAnnotations, submittedAnnotations, annotatedRasterAsset) {
|
|
@@ -1347,7 +1335,7 @@ var init_evoland = __esm({
|
|
|
1347
1335
|
setRecenterLocation: () => set({ recenterLocation: false }),
|
|
1348
1336
|
setTimerReset: (timerreset) => set({ timerReset: timerreset }),
|
|
1349
1337
|
setAnnotationTime: (annotationtime) => set({ annotationTime: annotationtime }),
|
|
1350
|
-
onLocationSelected: (point3) => __async(
|
|
1338
|
+
onLocationSelected: (point3) => __async(null, null, function* () {
|
|
1351
1339
|
var data = yield import_evoland_api_proxy2.LocationService.getPolygonUtmlocationLonLonLatLatWidthWidthHeightHeightGet(
|
|
1352
1340
|
point3.lng,
|
|
1353
1341
|
point3.lat,
|
|
@@ -1373,10 +1361,10 @@ var init_evoland = __esm({
|
|
|
1373
1361
|
location: locData
|
|
1374
1362
|
});
|
|
1375
1363
|
}),
|
|
1376
|
-
onRecenterLocation: () => __async(
|
|
1364
|
+
onRecenterLocation: () => __async(null, null, function* () {
|
|
1377
1365
|
return set({ recenterLocation: true });
|
|
1378
1366
|
}),
|
|
1379
|
-
getLocationAssets: (locationId, projectId, type, taskId) => __async(
|
|
1367
|
+
getLocationAssets: (locationId, projectId, type, taskId) => __async(null, null, function* () {
|
|
1380
1368
|
var _a, _b;
|
|
1381
1369
|
const state = useEvolandStore.getState();
|
|
1382
1370
|
var {
|
|
@@ -1499,7 +1487,7 @@ var init_evoland = __esm({
|
|
|
1499
1487
|
}
|
|
1500
1488
|
return [];
|
|
1501
1489
|
}),
|
|
1502
|
-
getLocationDetails: (locationId, projectId, user, taskId, isAdmin) => __async(
|
|
1490
|
+
getLocationDetails: (locationId, projectId, user, taskId, isAdmin) => __async(null, null, function* () {
|
|
1503
1491
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
1504
1492
|
var state = useEvolandStore.getState();
|
|
1505
1493
|
var { referenceDate, reference_dates, sessionTimeOut, projectDetail, task_for_review } = state;
|
|
@@ -1588,7 +1576,7 @@ var init_evoland = __esm({
|
|
|
1588
1576
|
}
|
|
1589
1577
|
}
|
|
1590
1578
|
}),
|
|
1591
|
-
getNextLocationDetails: (projectId) => __async(
|
|
1579
|
+
getNextLocationDetails: (projectId) => __async(null, null, function* () {
|
|
1592
1580
|
var _a, _b, _c;
|
|
1593
1581
|
set({ isLoading: true });
|
|
1594
1582
|
var state = useEvolandStore.getState();
|
|
@@ -1657,7 +1645,7 @@ var init_evoland = __esm({
|
|
|
1657
1645
|
setOpacity: (opacity) => set({ opacity }),
|
|
1658
1646
|
setCompositeOpacity: (opacity) => set({ compositeOpacity: opacity }),
|
|
1659
1647
|
setAnnotationOpacity: (opacity) => set({ annotationOpacity: opacity }),
|
|
1660
|
-
addLabel: (loc, bounds, label) => __async(
|
|
1648
|
+
addLabel: (loc, bounds, label) => __async(null, null, function* () {
|
|
1661
1649
|
var _a;
|
|
1662
1650
|
set({ isLoading: true });
|
|
1663
1651
|
var store = useEvolandStore.getState();
|
|
@@ -1717,14 +1705,14 @@ var init_evoland = __esm({
|
|
|
1717
1705
|
setShowTimeSeries: (value) => set({ showTimeSeries: value }),
|
|
1718
1706
|
reset: () => set(initialState),
|
|
1719
1707
|
setSelectedColorLabel: (label) => set({ selectedColorLabel: label }),
|
|
1720
|
-
getLegendsDetails: (array) => __async(
|
|
1708
|
+
getLegendsDetails: (array) => __async(null, null, function* () {
|
|
1721
1709
|
var store = useEvolandStore.getState();
|
|
1722
1710
|
var legends = yield getLegends(array, store.labels);
|
|
1723
1711
|
set({
|
|
1724
1712
|
legends
|
|
1725
1713
|
});
|
|
1726
1714
|
}),
|
|
1727
|
-
getLocationMetaData: (locationId, projectId, taskId) => __async(
|
|
1715
|
+
getLocationMetaData: (locationId, projectId, taskId) => __async(null, null, function* () {
|
|
1728
1716
|
var _a, _b;
|
|
1729
1717
|
set({ isLoading: true });
|
|
1730
1718
|
var state = useEvolandStore.getState();
|
|
@@ -1750,7 +1738,7 @@ var init_evoland = __esm({
|
|
|
1750
1738
|
set({ sessionTimeOut: true, isLoading: false });
|
|
1751
1739
|
}
|
|
1752
1740
|
}),
|
|
1753
|
-
getLabels: (projectId) => __async(
|
|
1741
|
+
getLabels: (projectId) => __async(null, null, function* () {
|
|
1754
1742
|
var state = useEvolandStore.getState();
|
|
1755
1743
|
if (state.labels) {
|
|
1756
1744
|
return state.labels;
|
|
@@ -1772,10 +1760,10 @@ var init_evoland = __esm({
|
|
|
1772
1760
|
});
|
|
1773
1761
|
return allLabels;
|
|
1774
1762
|
}),
|
|
1775
|
-
setBrushThickness: (value) => __async(
|
|
1763
|
+
setBrushThickness: (value) => __async(null, null, function* () {
|
|
1776
1764
|
return set({ brushThickness: value });
|
|
1777
1765
|
}),
|
|
1778
|
-
getProjectDetail: (projectId) => __async(
|
|
1766
|
+
getProjectDetail: (projectId) => __async(null, null, function* () {
|
|
1779
1767
|
set({ isLoading: true });
|
|
1780
1768
|
const projectInfo = yield import_evoland_api_proxy2.ProjectService.projectDetailProjectdetailProjectIdProjectIdGet(
|
|
1781
1769
|
projectId
|
|
@@ -1786,12 +1774,12 @@ var init_evoland = __esm({
|
|
|
1786
1774
|
isAnnualAnnotation: (projectInfo == null ? void 0 : projectInfo.project_type) == "ANNUALLY" /* ANNUALLY */ ? true : false
|
|
1787
1775
|
});
|
|
1788
1776
|
}),
|
|
1789
|
-
getTaskEvents: (taskId) => __async(
|
|
1777
|
+
getTaskEvents: (taskId) => __async(null, null, function* () {
|
|
1790
1778
|
set({ isLoading: true });
|
|
1791
1779
|
const taskevents = yield import_evoland_api_proxy2.TaskService.getTaskEventsTaskeventsTaskIdTaskIdGet(taskId);
|
|
1792
1780
|
set({ isLoading: false, taskEvents: taskevents });
|
|
1793
1781
|
}),
|
|
1794
|
-
getTaskAnnotation: (submittedAnnotationAsset, assetType) => __async(
|
|
1782
|
+
getTaskAnnotation: (submittedAnnotationAsset, assetType) => __async(null, null, function* () {
|
|
1795
1783
|
var _a, _b, _c;
|
|
1796
1784
|
if (submittedAnnotationAsset != null && submittedAnnotationAsset.length > 0) {
|
|
1797
1785
|
const state = useEvolandStore.getState();
|
|
@@ -1841,7 +1829,7 @@ var init_evoland = __esm({
|
|
|
1841
1829
|
setCurrentPosition: (position) => set({ currentPosition: position }),
|
|
1842
1830
|
setSessionTimeOut: (hasTimeOut) => set({ sessionTimeOut: hasTimeOut }),
|
|
1843
1831
|
setLatestTaskAnnotation: (locationTask) => set({ latestTaskAnnotation: locationTask }),
|
|
1844
|
-
getTaskReferenceDates: (projectId, locatioId, asset_type, setSelected) => __async(
|
|
1832
|
+
getTaskReferenceDates: (projectId, locatioId, asset_type, setSelected) => __async(null, null, function* () {
|
|
1845
1833
|
const state = useEvolandStore.getState();
|
|
1846
1834
|
const { annotation_dates, reference_dates, selectedReferenceDate } = state;
|
|
1847
1835
|
var task_ref_dates = yield getRefDates(projectId, locatioId, asset_type);
|
|
@@ -1857,7 +1845,7 @@ var init_evoland = __esm({
|
|
|
1857
1845
|
});
|
|
1858
1846
|
}
|
|
1859
1847
|
}),
|
|
1860
|
-
setSelectedReferenceDate: (currentReferenceDate) => __async(
|
|
1848
|
+
setSelectedReferenceDate: (currentReferenceDate) => __async(null, null, function* () {
|
|
1861
1849
|
const state = useEvolandStore.getState();
|
|
1862
1850
|
const { selectedReferenceDate, reference_dates } = state;
|
|
1863
1851
|
if (currentReferenceDate !== selectedReferenceDate)
|
|
@@ -1866,49 +1854,49 @@ var init_evoland = __esm({
|
|
|
1866
1854
|
selectedBand: reference_dates == null ? void 0 : reference_dates.indexOf(currentReferenceDate)
|
|
1867
1855
|
});
|
|
1868
1856
|
}),
|
|
1869
|
-
setUpdateAsset: (updateAssets) => __async(
|
|
1857
|
+
setUpdateAsset: (updateAssets) => __async(null, null, function* () {
|
|
1870
1858
|
return set({ updateAssets });
|
|
1871
1859
|
}),
|
|
1872
|
-
setComment: (comment) => __async(
|
|
1860
|
+
setComment: (comment) => __async(null, null, function* () {
|
|
1873
1861
|
return set({ comment });
|
|
1874
1862
|
}),
|
|
1875
|
-
setAnnualAnnotation: (val) => __async(
|
|
1863
|
+
setAnnualAnnotation: (val) => __async(null, null, function* () {
|
|
1876
1864
|
return set({ isAnnualAnnotation: val });
|
|
1877
1865
|
}),
|
|
1878
|
-
setSelectedBand: (bandIndex) => __async(
|
|
1866
|
+
setSelectedBand: (bandIndex) => __async(null, null, function* () {
|
|
1879
1867
|
return set({ selectedBand: bandIndex });
|
|
1880
1868
|
}),
|
|
1881
|
-
setAnnotationDates: (annotationDates) => __async(
|
|
1869
|
+
setAnnotationDates: (annotationDates) => __async(null, null, function* () {
|
|
1882
1870
|
return set({ annotation_dates: annotationDates });
|
|
1883
1871
|
}),
|
|
1884
|
-
setSavedAnnotations: (savedAnnotation) => __async(
|
|
1872
|
+
setSavedAnnotations: (savedAnnotation) => __async(null, null, function* () {
|
|
1885
1873
|
return set({ savedAnnotations: savedAnnotation });
|
|
1886
1874
|
}),
|
|
1887
|
-
setLabelList: (labels) => __async(
|
|
1875
|
+
setLabelList: (labels) => __async(null, null, function* () {
|
|
1888
1876
|
return set({ labelList: labels });
|
|
1889
1877
|
}),
|
|
1890
|
-
setLocation: (loc) => __async(
|
|
1878
|
+
setLocation: (loc) => __async(null, null, function* () {
|
|
1891
1879
|
return set({ location: loc });
|
|
1892
1880
|
}),
|
|
1893
|
-
setCurrentTask: (task) => __async(
|
|
1881
|
+
setCurrentTask: (task) => __async(null, null, function* () {
|
|
1894
1882
|
return set({ currentTask: task });
|
|
1895
1883
|
}),
|
|
1896
|
-
setTimeSeriesTypes: (types) => __async(
|
|
1884
|
+
setTimeSeriesTypes: (types) => __async(null, null, function* () {
|
|
1897
1885
|
return set({ timeSeriesTypes: types });
|
|
1898
1886
|
}),
|
|
1899
|
-
setTimeSeriesAssets: (assets) => __async(
|
|
1887
|
+
setTimeSeriesAssets: (assets) => __async(null, null, function* () {
|
|
1900
1888
|
return set({ timeSeriesAssets: assets });
|
|
1901
1889
|
}),
|
|
1902
|
-
setActiveLearningAnnotations: (active_learning) => __async(
|
|
1890
|
+
setActiveLearningAnnotations: (active_learning) => __async(null, null, function* () {
|
|
1903
1891
|
return set({ activeLearningAnnotations: active_learning });
|
|
1904
1892
|
}),
|
|
1905
|
-
setSubmittedAnnotations: (submit_annotation) => __async(
|
|
1893
|
+
setSubmittedAnnotations: (submit_annotation) => __async(null, null, function* () {
|
|
1906
1894
|
return set({ submittedAnnotations: submit_annotation });
|
|
1907
1895
|
}),
|
|
1908
|
-
setAnnotatedRasterAsset: (annotated_raster) => __async(
|
|
1896
|
+
setAnnotatedRasterAsset: (annotated_raster) => __async(null, null, function* () {
|
|
1909
1897
|
return set({ annotatedRasterAsset: annotated_raster });
|
|
1910
1898
|
}),
|
|
1911
|
-
setTaskGeometry: (task_geometry) => __async(
|
|
1899
|
+
setTaskGeometry: (task_geometry) => __async(null, null, function* () {
|
|
1912
1900
|
return set({ taskGeometry: task_geometry });
|
|
1913
1901
|
}),
|
|
1914
1902
|
setTaskForReview(taskForReview) {
|
|
@@ -2039,8 +2027,7 @@ var init_TiffImage = __esm({
|
|
|
2039
2027
|
} else if (localcomment !== void 0 && (localcomment == null ? void 0 : localcomment.includes("#" + x))) {
|
|
2040
2028
|
localcomment = localcomment.replace(" #" + x, "");
|
|
2041
2029
|
this.className = "rounded-xl flex inline-flex text-secondary p-1 text-sm";
|
|
2042
|
-
} else
|
|
2043
|
-
localcomment = "#" + x + " ";
|
|
2030
|
+
} else localcomment = "#" + x + " ";
|
|
2044
2031
|
if (evolandStore.comment !== void 0 && evolandStore.comment !== null && !((_a5 = evolandStore.comment) == null ? void 0 : _a5.includes("#" + x)))
|
|
2045
2032
|
evolandStore.setComment(
|
|
2046
2033
|
evolandStore.comment + localcomment
|
|
@@ -2049,8 +2036,7 @@ var init_TiffImage = __esm({
|
|
|
2049
2036
|
evolandStore.setComment(
|
|
2050
2037
|
evolandStore.comment.replace(" #" + x, "")
|
|
2051
2038
|
);
|
|
2052
|
-
else
|
|
2053
|
-
evolandStore.setComment(localcomment);
|
|
2039
|
+
else evolandStore.setComment(localcomment);
|
|
2054
2040
|
});
|
|
2055
2041
|
container.appendChild(content);
|
|
2056
2042
|
}
|
|
@@ -2091,7 +2077,7 @@ var init_TiffImage = __esm({
|
|
|
2091
2077
|
bubblingMouseEvents: false,
|
|
2092
2078
|
className: "border-2 border-blue-600"
|
|
2093
2079
|
}).bringToFront();
|
|
2094
|
-
imageOverlay3.on("mouseover", (e) => __async(
|
|
2080
|
+
imageOverlay3.on("mouseover", (e) => __async(null, null, function* () {
|
|
2095
2081
|
var _a3, _b2;
|
|
2096
2082
|
if (isBrush()) {
|
|
2097
2083
|
tooltip2 = L.tooltip({ offset: L.point(20, 0), opacity: 0.6 }).setContent(
|
|
@@ -2113,21 +2099,20 @@ var init_TiffImage = __esm({
|
|
|
2113
2099
|
).setLatLng(e.latlng).addTo(map);
|
|
2114
2100
|
}
|
|
2115
2101
|
}));
|
|
2116
|
-
imageOverlay3.on("mousemove", (e) => __async(
|
|
2102
|
+
imageOverlay3.on("mousemove", (e) => __async(null, null, function* () {
|
|
2117
2103
|
evolandStore.setNDVIRGBValues(ndvi);
|
|
2118
2104
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2119
2105
|
if (isDrawing) {
|
|
2120
2106
|
handleMouseMove(e);
|
|
2121
2107
|
}
|
|
2122
2108
|
}));
|
|
2123
|
-
imageOverlay3.on("mouseout", () => __async(
|
|
2109
|
+
imageOverlay3.on("mouseout", () => __async(null, null, function* () {
|
|
2124
2110
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2125
2111
|
}));
|
|
2126
|
-
imageOverlay3.on("click", (e) => __async(
|
|
2112
|
+
imageOverlay3.on("click", (e) => __async(null, null, function* () {
|
|
2127
2113
|
var _a3, _b2, _c2;
|
|
2128
2114
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2129
|
-
if (((_a3 = evolandStore.selectedRasterAsset) == null ? void 0 : _a3.type) == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */)
|
|
2130
|
-
return;
|
|
2115
|
+
if (((_a3 = evolandStore.selectedRasterAsset) == null ? void 0 : _a3.type) == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */) return;
|
|
2131
2116
|
if (evolandStore.selectedColorLabel == null && evolandStore.selectedToolType !== 6 /* ClearSegmentWithPolygon */) {
|
|
2132
2117
|
alert("Please select label");
|
|
2133
2118
|
return;
|
|
@@ -2174,25 +2159,23 @@ var init_TiffImage = __esm({
|
|
|
2174
2159
|
opacity: 0.8,
|
|
2175
2160
|
lineCap: "round"
|
|
2176
2161
|
}).addTo(map);
|
|
2177
|
-
polyLine.on("click", () => __async(
|
|
2162
|
+
polyLine.on("click", () => __async(null, null, function* () {
|
|
2178
2163
|
stopPaint();
|
|
2179
2164
|
}));
|
|
2180
|
-
polyLine.on("mouseover", (e) => __async(
|
|
2165
|
+
polyLine.on("mouseover", (e) => __async(null, null, function* () {
|
|
2181
2166
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2182
2167
|
tooltip2 = L.tooltip({ offset: L.point(20, 0), opacity: 0.6 }).setContent("Click to Stop").setLatLng(e.latlng).addTo(map);
|
|
2183
2168
|
}));
|
|
2184
|
-
polyLine.on("mousemove", () => __async(
|
|
2169
|
+
polyLine.on("mousemove", () => __async(null, null, function* () {
|
|
2185
2170
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2186
2171
|
}));
|
|
2187
|
-
polyLine.on("mouseout", () => __async(
|
|
2172
|
+
polyLine.on("mouseout", () => __async(null, null, function* () {
|
|
2188
2173
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2189
2174
|
}));
|
|
2190
2175
|
}
|
|
2191
2176
|
return () => {
|
|
2192
|
-
if (imageOverlay3)
|
|
2193
|
-
|
|
2194
|
-
if (tagsPopUp)
|
|
2195
|
-
map.removeLayer(tagsPopUp);
|
|
2177
|
+
if (imageOverlay3) map.removeLayer(imageOverlay3);
|
|
2178
|
+
if (tagsPopUp) map.removeLayer(tagsPopUp);
|
|
2196
2179
|
if (rectangle3 && evolandStore.isAnnualAnnotation)
|
|
2197
2180
|
map.removeLayer(rectangle3);
|
|
2198
2181
|
if (polyLine !== void 0) {
|
|
@@ -2299,7 +2282,7 @@ var init_ReadOnlyTiffImage = __esm({
|
|
|
2299
2282
|
bubblingMouseEvents: false,
|
|
2300
2283
|
className: "border-2 border-blue-600"
|
|
2301
2284
|
}).bringToBack();
|
|
2302
|
-
imageOverlay3.on("mouseover", (e) => __async(
|
|
2285
|
+
imageOverlay3.on("mouseover", (e) => __async(null, null, function* () {
|
|
2303
2286
|
var data = yield getCanvasDataFromImageArray(
|
|
2304
2287
|
props.raster,
|
|
2305
2288
|
e.latlng,
|
|
@@ -2309,7 +2292,7 @@ var init_ReadOnlyTiffImage = __esm({
|
|
|
2309
2292
|
);
|
|
2310
2293
|
setNDVI(data[1]);
|
|
2311
2294
|
}));
|
|
2312
|
-
imageOverlay3.on("mousemove", () => __async(
|
|
2295
|
+
imageOverlay3.on("mousemove", () => __async(null, null, function* () {
|
|
2313
2296
|
evolandStore.setNDVIRGBValues(ndvi);
|
|
2314
2297
|
}));
|
|
2315
2298
|
imageOverlay3.addTo(map);
|
|
@@ -2327,12 +2310,9 @@ var init_ReadOnlyTiffImage = __esm({
|
|
|
2327
2310
|
}).addTo(map);
|
|
2328
2311
|
}
|
|
2329
2312
|
return () => {
|
|
2330
|
-
if (imageOverlay3)
|
|
2331
|
-
|
|
2332
|
-
if (
|
|
2333
|
-
map.removeLayer(rectangle3);
|
|
2334
|
-
if (props.polygonBounds)
|
|
2335
|
-
map.removeLayer(polygon_segment);
|
|
2313
|
+
if (imageOverlay3) map.removeLayer(imageOverlay3);
|
|
2314
|
+
if (rectangle3 && showRectangleAtCenter) map.removeLayer(rectangle3);
|
|
2315
|
+
if (props.polygonBounds) map.removeLayer(polygon_segment);
|
|
2336
2316
|
};
|
|
2337
2317
|
}, [props, map, showRectangleAtCenter]);
|
|
2338
2318
|
return null;
|
|
@@ -2619,8 +2599,7 @@ var init_EvolandContainer = __esm({
|
|
|
2619
2599
|
import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2620
2600
|
EvolandContainer = ({ sessionStatus }) => {
|
|
2621
2601
|
const evolandStore = useEvolandStore();
|
|
2622
|
-
if (sessionStatus === "unauthenticated")
|
|
2623
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui.AuthenticationFailure, {});
|
|
2602
|
+
if (sessionStatus === "unauthenticated") return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui.AuthenticationFailure, {});
|
|
2624
2603
|
return evolandStore.location && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EvoLandGeometry, {});
|
|
2625
2604
|
};
|
|
2626
2605
|
}
|
|
@@ -2838,8 +2817,7 @@ var init_MapUtils = __esm({
|
|
|
2838
2817
|
};
|
|
2839
2818
|
excludedProperties = /* @__PURE__ */ new Set(["bbox", "geometry", "type"]);
|
|
2840
2819
|
formatValue = (value) => {
|
|
2841
|
-
if (value === null || value === void 0)
|
|
2842
|
-
return "";
|
|
2820
|
+
if (value === null || value === void 0) return "";
|
|
2843
2821
|
if (typeof value === "number") {
|
|
2844
2822
|
return value.toLocaleString();
|
|
2845
2823
|
}
|
|
@@ -3026,8 +3004,7 @@ var init_BetterWMS = __esm({
|
|
|
3026
3004
|
* Builds the URL for the GetFeatureInfo WMS request
|
|
3027
3005
|
*/
|
|
3028
3006
|
getFeatureInfoUrl(latlng) {
|
|
3029
|
-
if (!this.currentMap)
|
|
3030
|
-
return null;
|
|
3007
|
+
if (!this.currentMap) return null;
|
|
3031
3008
|
const point3 = this.currentMap.latLngToContainerPoint(latlng);
|
|
3032
3009
|
const size = this.currentMap.getSize();
|
|
3033
3010
|
const wmsParams = this.wmsParams;
|
|
@@ -3096,8 +3073,7 @@ var init_BetterWMS = __esm({
|
|
|
3096
3073
|
return;
|
|
3097
3074
|
}
|
|
3098
3075
|
this.geoJsonLayer.addData(content);
|
|
3099
|
-
if (!this.currentMap)
|
|
3100
|
-
return;
|
|
3076
|
+
if (!this.currentMap) return;
|
|
3101
3077
|
if (this.currentPopup) {
|
|
3102
3078
|
this.currentMap.closePopup(this.currentPopup);
|
|
3103
3079
|
}
|
|
@@ -3114,8 +3090,7 @@ var init_BetterWMS = __esm({
|
|
|
3114
3090
|
* Show loading popup
|
|
3115
3091
|
*/
|
|
3116
3092
|
showLoading(latlng) {
|
|
3117
|
-
if (!this.currentMap || this.loading || !this.canShowLoading)
|
|
3118
|
-
return;
|
|
3093
|
+
if (!this.currentMap || this.loading || !this.canShowLoading) return;
|
|
3119
3094
|
this.loading = true;
|
|
3120
3095
|
this.currentPopup = import_leaflet4.default.popup(this.popupOptions).setLatLng(latlng).setContent(this.loadingContent).openOn(this.currentMap);
|
|
3121
3096
|
}
|
|
@@ -3126,8 +3101,7 @@ var init_BetterWMS = __esm({
|
|
|
3126
3101
|
return __async(this, null, function* () {
|
|
3127
3102
|
var _a, _b, _c;
|
|
3128
3103
|
const url = this.getFeatureInfoUrl(event.latlng);
|
|
3129
|
-
if (!url)
|
|
3130
|
-
return;
|
|
3104
|
+
if (!url) return;
|
|
3131
3105
|
try {
|
|
3132
3106
|
this.showLoading(event.latlng);
|
|
3133
3107
|
const data = yield this.fetchWithRetry(url);
|
|
@@ -3336,8 +3310,7 @@ var init_FarmerClusterPopup = __esm({
|
|
|
3336
3310
|
import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3337
3311
|
FarmerClusterPopup = ({ properties }) => {
|
|
3338
3312
|
const fileUrl = (0, import_core7.useFileUrl)();
|
|
3339
|
-
if (!properties)
|
|
3340
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "No properties found" });
|
|
3313
|
+
if (!properties) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "No properties found" });
|
|
3341
3314
|
const name = properties["name"];
|
|
3342
3315
|
const description = properties["description"];
|
|
3343
3316
|
const url = "/cluster/view/" + properties["id"];
|
|
@@ -3405,8 +3378,7 @@ var init_IfbnSitePopup = __esm({
|
|
|
3405
3378
|
import_core9 = require("@geowiki/core");
|
|
3406
3379
|
import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3407
3380
|
SiteInformation = ({ data }) => {
|
|
3408
|
-
if (!data)
|
|
3409
|
-
return null;
|
|
3381
|
+
if (!data) return null;
|
|
3410
3382
|
const baseDocUrl = "https://raw.githubusercontent.com/iiasa/static/refs/heads/main/geotrees/docs/biomass_processing_protocol/";
|
|
3411
3383
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-6", children: [
|
|
3412
3384
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-4", children: [
|
|
@@ -3581,8 +3553,7 @@ var init_IfbnSitePopup = __esm({
|
|
|
3581
3553
|
const [isLoading, setIsLoading] = (0, import_react6.useState)(false);
|
|
3582
3554
|
const [imageError, setImageError] = (0, import_react6.useState)(false);
|
|
3583
3555
|
const { status: sessionStatus, data: session } = (0, import_core8.useSession)();
|
|
3584
|
-
if (!properties)
|
|
3585
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: "No properties found" });
|
|
3556
|
+
if (!properties) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: "No properties found" });
|
|
3586
3557
|
const plotId = properties["Plot_ID"];
|
|
3587
3558
|
const subPlotId = properties["SubPlot_Id"];
|
|
3588
3559
|
const network = properties["Network"];
|
|
@@ -3591,7 +3562,7 @@ var init_IfbnSitePopup = __esm({
|
|
|
3591
3562
|
const fallbackUrl = "https://cms.main.geo-wiki.org/geotrees/media/cocoa.png";
|
|
3592
3563
|
const baseImageUrl = "https://raw.githubusercontent.com/iiasa/static/refs/heads/main/geotrees/sites/";
|
|
3593
3564
|
const imageUrl = `${baseImageUrl}${plotId}.jpg?raw=true`;
|
|
3594
|
-
const fetchSiteData = () => __async(
|
|
3565
|
+
const fetchSiteData = () => __async(null, null, function* () {
|
|
3595
3566
|
setIsLoading(true);
|
|
3596
3567
|
try {
|
|
3597
3568
|
const response = yield fetch(
|
|
@@ -3602,8 +3573,7 @@ var init_IfbnSitePopup = __esm({
|
|
|
3602
3573
|
}
|
|
3603
3574
|
}
|
|
3604
3575
|
);
|
|
3605
|
-
if (!response.ok)
|
|
3606
|
-
throw new Error("Failed to fetch data");
|
|
3576
|
+
if (!response.ok) throw new Error("Failed to fetch data");
|
|
3607
3577
|
const data = yield response.json();
|
|
3608
3578
|
setSiteData(data);
|
|
3609
3579
|
} catch (error) {
|
|
@@ -3683,16 +3653,14 @@ var init_IfbnPlotPopup = __esm({
|
|
|
3683
3653
|
const [error, setError] = (0, import_react7.useState)(null);
|
|
3684
3654
|
const API_URL = process.env.NEXT_PUBLIC_GEO_TREE_API_URL;
|
|
3685
3655
|
(0, import_react7.useEffect)(() => {
|
|
3686
|
-
const fetchApiData = () => __async(
|
|
3687
|
-
if (!(properties == null ? void 0 : properties.id))
|
|
3688
|
-
return;
|
|
3656
|
+
const fetchApiData = () => __async(null, null, function* () {
|
|
3657
|
+
if (!(properties == null ? void 0 : properties.id)) return;
|
|
3689
3658
|
setIsLoading(true);
|
|
3690
3659
|
try {
|
|
3691
3660
|
const response = yield fetch(
|
|
3692
3661
|
`${API_URL}/api/plots/by-plot-id/${properties.plot_id}`
|
|
3693
3662
|
);
|
|
3694
|
-
if (!response.ok)
|
|
3695
|
-
throw new Error("Failed to fetch data");
|
|
3663
|
+
if (!response.ok) throw new Error("Failed to fetch data");
|
|
3696
3664
|
const data = yield response.json();
|
|
3697
3665
|
console.log("API Response:", data);
|
|
3698
3666
|
setApiData(data);
|
|
@@ -3893,12 +3861,9 @@ var init_GeoJsonLayer = __esm({
|
|
|
3893
3861
|
markers.forEach((marker2) => {
|
|
3894
3862
|
var _a, _b, _c;
|
|
3895
3863
|
const status = ((_c = (_b = (_a = marker2.feature) == null ? void 0 : _a.properties) == null ? void 0 : _b.Status) == null ? void 0 : _c.trim().toLowerCase()) || "default";
|
|
3896
|
-
if (status === "ongoing")
|
|
3897
|
-
|
|
3898
|
-
else
|
|
3899
|
-
statusCount.auxiliary++;
|
|
3900
|
-
else
|
|
3901
|
-
statusCount.default++;
|
|
3864
|
+
if (status === "ongoing") statusCount.ongoing++;
|
|
3865
|
+
else if (status === "auxiliary") statusCount.auxiliary++;
|
|
3866
|
+
else statusCount.default++;
|
|
3902
3867
|
});
|
|
3903
3868
|
return import_leaflet6.default.divIcon({
|
|
3904
3869
|
html: `<div style=
|
|
@@ -3924,7 +3889,7 @@ var init_GeoJsonLayer = __esm({
|
|
|
3924
3889
|
({ layer }) => {
|
|
3925
3890
|
const { isLoading, error, data } = (0, import_react_query.useQuery)({
|
|
3926
3891
|
queryKey: ["geoJson", layer.id],
|
|
3927
|
-
queryFn: () => __async(
|
|
3892
|
+
queryFn: () => __async(null, null, function* () {
|
|
3928
3893
|
const res = yield fetch(layer.url);
|
|
3929
3894
|
return yield res.json();
|
|
3930
3895
|
})
|
|
@@ -3974,8 +3939,7 @@ var init_GeoJsonLayer = __esm({
|
|
|
3974
3939
|
[layerIcon]
|
|
3975
3940
|
);
|
|
3976
3941
|
const processedData = (0, import_react8.useMemo)(() => {
|
|
3977
|
-
if (!(data == null ? void 0 : data.features))
|
|
3978
|
-
return data;
|
|
3942
|
+
if (!(data == null ? void 0 : data.features)) return data;
|
|
3979
3943
|
const processed = __spreadValues({}, data);
|
|
3980
3944
|
processed.features = data.features.map((feature) => {
|
|
3981
3945
|
var _a;
|
|
@@ -4001,10 +3965,8 @@ var init_GeoJsonLayer = __esm({
|
|
|
4001
3965
|
}),
|
|
4002
3966
|
[layer.id]
|
|
4003
3967
|
);
|
|
4004
|
-
if (error)
|
|
4005
|
-
|
|
4006
|
-
if (isLoading)
|
|
4007
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui6.LoaderFull, {});
|
|
3968
|
+
if (error) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: "error" });
|
|
3969
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui6.LoaderFull, {});
|
|
4008
3970
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4009
3971
|
MarkerClusterGroup2,
|
|
4010
3972
|
{
|
|
@@ -4082,12 +4044,9 @@ var init_IfbnPlotLayer = __esm({
|
|
|
4082
4044
|
markers.forEach((marker2) => {
|
|
4083
4045
|
var _a, _b, _c;
|
|
4084
4046
|
const status = ((_c = (_b = (_a = marker2.feature) == null ? void 0 : _a.properties) == null ? void 0 : _b.Status) == null ? void 0 : _c.trim().toLowerCase()) || "default";
|
|
4085
|
-
if (status === "ongoing")
|
|
4086
|
-
|
|
4087
|
-
else
|
|
4088
|
-
statusCount.auxiliary++;
|
|
4089
|
-
else
|
|
4090
|
-
statusCount.default++;
|
|
4047
|
+
if (status === "ongoing") statusCount.ongoing++;
|
|
4048
|
+
else if (status === "auxiliary") statusCount.auxiliary++;
|
|
4049
|
+
else statusCount.default++;
|
|
4091
4050
|
});
|
|
4092
4051
|
let clusterColor = "#2E7D32";
|
|
4093
4052
|
if (statusCount.ongoing > statusCount.auxiliary && statusCount.ongoing > statusCount.default) {
|
|
@@ -4136,7 +4095,7 @@ var init_IfbnPlotLayer = __esm({
|
|
|
4136
4095
|
});
|
|
4137
4096
|
const { isLoading, error, data } = (0, import_react_query2.useQuery)({
|
|
4138
4097
|
queryKey: ["IfbnPlotLayer", layer.id],
|
|
4139
|
-
queryFn: () => __async(
|
|
4098
|
+
queryFn: () => __async(null, null, function* () {
|
|
4140
4099
|
const res = yield fetch(`${layer.url}`);
|
|
4141
4100
|
return yield res.json();
|
|
4142
4101
|
})
|
|
@@ -4145,8 +4104,7 @@ var init_IfbnPlotLayer = __esm({
|
|
|
4145
4104
|
return currentZoom <= hideMarkersAboveZoom;
|
|
4146
4105
|
};
|
|
4147
4106
|
(0, import_react9.useEffect)(() => {
|
|
4148
|
-
if (!markerClusterGroupRef.current)
|
|
4149
|
-
return;
|
|
4107
|
+
if (!markerClusterGroupRef.current) return;
|
|
4150
4108
|
if (shouldShowMarkers()) {
|
|
4151
4109
|
markersRef.current.forEach((marker2) => {
|
|
4152
4110
|
var _a, _b;
|
|
@@ -4234,10 +4192,8 @@ var init_IfbnPlotLayer = __esm({
|
|
|
4234
4192
|
setSelectedFeature({ feature, latlng });
|
|
4235
4193
|
};
|
|
4236
4194
|
const ref = (0, import_react9.useRef)(null);
|
|
4237
|
-
if (error)
|
|
4238
|
-
|
|
4239
|
-
if (isLoading)
|
|
4240
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui8.LoaderFull, {});
|
|
4195
|
+
if (error) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: "error" });
|
|
4196
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui8.LoaderFull, {});
|
|
4241
4197
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4242
4198
|
MarkerClusterGroup2,
|
|
4243
4199
|
{
|
|
@@ -4494,8 +4450,7 @@ var init_customLayers = __esm({
|
|
|
4494
4450
|
createLayerFromTemplate: (templateId, customData) => {
|
|
4495
4451
|
var _a, _b;
|
|
4496
4452
|
const template = get().getTemplate(templateId);
|
|
4497
|
-
if (!template)
|
|
4498
|
-
return null;
|
|
4453
|
+
if (!template) return null;
|
|
4499
4454
|
const newLayer = {
|
|
4500
4455
|
id: (0, import_uuid.v4)(),
|
|
4501
4456
|
isCustom: true,
|
|
@@ -4862,16 +4817,11 @@ function getColumnStats(data, columnName) {
|
|
|
4862
4817
|
let type;
|
|
4863
4818
|
if (uniqueTypes.size === 1) {
|
|
4864
4819
|
const singleType = types[0];
|
|
4865
|
-
if (singleType === "string")
|
|
4866
|
-
|
|
4867
|
-
else if (singleType === "
|
|
4868
|
-
|
|
4869
|
-
else
|
|
4870
|
-
type = "boolean";
|
|
4871
|
-
else if (singleType === "object")
|
|
4872
|
-
type = "date";
|
|
4873
|
-
else
|
|
4874
|
-
type = "mixed";
|
|
4820
|
+
if (singleType === "string") type = "string";
|
|
4821
|
+
else if (singleType === "number") type = "number";
|
|
4822
|
+
else if (singleType === "boolean") type = "boolean";
|
|
4823
|
+
else if (singleType === "object") type = "date";
|
|
4824
|
+
else type = "mixed";
|
|
4875
4825
|
} else {
|
|
4876
4826
|
type = "mixed";
|
|
4877
4827
|
}
|
|
@@ -4896,21 +4846,15 @@ var init_GoogleSheetsPopup = __esm({
|
|
|
4896
4846
|
properties
|
|
4897
4847
|
}) => {
|
|
4898
4848
|
const isEmpty = (value) => {
|
|
4899
|
-
if (value === null || value === void 0)
|
|
4900
|
-
|
|
4901
|
-
if (typeof value === "
|
|
4902
|
-
|
|
4903
|
-
if (typeof value === "
|
|
4904
|
-
return isNaN(value);
|
|
4905
|
-
if (Array.isArray(value))
|
|
4906
|
-
return value.length === 0;
|
|
4907
|
-
if (typeof value === "object")
|
|
4908
|
-
return Object.keys(value).length === 0;
|
|
4849
|
+
if (value === null || value === void 0) return true;
|
|
4850
|
+
if (typeof value === "string") return value.trim() === "";
|
|
4851
|
+
if (typeof value === "number") return isNaN(value);
|
|
4852
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
4853
|
+
if (typeof value === "object") return Object.keys(value).length === 0;
|
|
4909
4854
|
return false;
|
|
4910
4855
|
};
|
|
4911
4856
|
const isUrl2 = (value) => {
|
|
4912
|
-
if (typeof value !== "string")
|
|
4913
|
-
return false;
|
|
4857
|
+
if (typeof value !== "string") return false;
|
|
4914
4858
|
const trimmedValue = value.trim();
|
|
4915
4859
|
const urlPatterns = [
|
|
4916
4860
|
/^https?:\/\//i,
|
|
@@ -5353,8 +5297,7 @@ function analyzeColumn(rows, columnName) {
|
|
|
5353
5297
|
};
|
|
5354
5298
|
}
|
|
5355
5299
|
function getLegendColumns(rows, excludeCoordinateColumns = []) {
|
|
5356
|
-
if (rows.length === 0)
|
|
5357
|
-
return [];
|
|
5300
|
+
if (rows.length === 0) return [];
|
|
5358
5301
|
const headers = Object.keys(rows[0]);
|
|
5359
5302
|
const legendColumns = [];
|
|
5360
5303
|
for (const header of headers) {
|
|
@@ -5551,7 +5494,7 @@ function useGenericCache({
|
|
|
5551
5494
|
const isCached = cache.has(cacheKey);
|
|
5552
5495
|
const queryOptions = {
|
|
5553
5496
|
queryKey: [cacheKey.type, cacheKey.id, cacheKey.subId, cacheKey.version],
|
|
5554
|
-
queryFn: () => __async(
|
|
5497
|
+
queryFn: () => __async(null, null, function* () {
|
|
5555
5498
|
const cachedData = cache.get(cacheKey);
|
|
5556
5499
|
if (cachedData) {
|
|
5557
5500
|
console.log(
|
|
@@ -5690,8 +5633,7 @@ var init_GenericCache = __esm({
|
|
|
5690
5633
|
getFromStorage(key) {
|
|
5691
5634
|
try {
|
|
5692
5635
|
const stored = localStorage.getItem(key);
|
|
5693
|
-
if (!stored)
|
|
5694
|
-
return null;
|
|
5636
|
+
if (!stored) return null;
|
|
5695
5637
|
const entry = JSON.parse(stored);
|
|
5696
5638
|
if (this.isValid(entry)) {
|
|
5697
5639
|
this.hitCount++;
|
|
@@ -5995,7 +5937,7 @@ function useGoogleSheetsData({
|
|
|
5995
5937
|
subId: sheetConfig.sheetId,
|
|
5996
5938
|
version: "1.0.0"
|
|
5997
5939
|
} : null;
|
|
5998
|
-
const fetchData = () => __async(
|
|
5940
|
+
const fetchData = () => __async(null, null, function* () {
|
|
5999
5941
|
if (!sheetConfig) {
|
|
6000
5942
|
throw new Error("Invalid Google Sheets configuration");
|
|
6001
5943
|
}
|
|
@@ -6289,8 +6231,7 @@ var init_GoogleSheetsLayer = __esm({
|
|
|
6289
6231
|
};
|
|
6290
6232
|
const processedData = (0, import_react10.useMemo)(() => {
|
|
6291
6233
|
var _a2;
|
|
6292
|
-
if (!data)
|
|
6293
|
-
return null;
|
|
6234
|
+
if (!data) return null;
|
|
6294
6235
|
return __spreadProps(__spreadValues({}, data), {
|
|
6295
6236
|
features: (_a2 = data.features) == null ? void 0 : _a2.map((feature) => {
|
|
6296
6237
|
var _a3;
|
|
@@ -7038,10 +6979,9 @@ var init_RasterPreview = __esm({
|
|
|
7038
6979
|
},
|
|
7039
6980
|
{ scopes: ["evoland"] }
|
|
7040
6981
|
);
|
|
7041
|
-
const onSubmit = (taskStatus) => __async(
|
|
6982
|
+
const onSubmit = (taskStatus) => __async(null, null, function* () {
|
|
7042
6983
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2;
|
|
7043
|
-
if (disableSubmit)
|
|
7044
|
-
return;
|
|
6984
|
+
if (disableSubmit) return;
|
|
7045
6985
|
setDisableSubmit(true);
|
|
7046
6986
|
var bufferData = null;
|
|
7047
6987
|
var { data: savedAnnotationBuffer, indexArr: savedAnnotationIndexArr } = evolandStore.savedAnnotations && evolandStore.isAnnualAnnotation ? { data: evolandStore.savedAnnotations.buffer, indexArr: 0 } : evolandStore.savedAnnotations ? flatten(evolandStore.savedAnnotations.buffer) : { data: void 0, indexArr: 0 };
|
|
@@ -7098,8 +7038,7 @@ var init_RasterPreview = __esm({
|
|
|
7098
7038
|
if (_props.userRole === "admin") {
|
|
7099
7039
|
if (tasks == null ? void 0 : tasks.task)
|
|
7100
7040
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_v2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _v2.location_id}&taskId=${(_w2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _w2.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
|
|
7101
|
-
else
|
|
7102
|
-
alert("No more tasks to review");
|
|
7041
|
+
else alert("No more tasks to review");
|
|
7103
7042
|
}
|
|
7104
7043
|
var res = yield evolandStore.getNextLocationDetails(
|
|
7105
7044
|
parseInt(projectId)
|
|
@@ -7123,8 +7062,7 @@ var init_RasterPreview = __esm({
|
|
|
7123
7062
|
}
|
|
7124
7063
|
});
|
|
7125
7064
|
const arrayEqual = (a, b) => {
|
|
7126
|
-
if (a.length !== b.length)
|
|
7127
|
-
return false;
|
|
7065
|
+
if (a.length !== b.length) return false;
|
|
7128
7066
|
return Buffer.compare(Buffer.from(a.buffer), Buffer.from(b.buffer)) === 0;
|
|
7129
7067
|
};
|
|
7130
7068
|
const flatten = (input, refArr) => {
|
|
@@ -7148,15 +7086,14 @@ var init_RasterPreview = __esm({
|
|
|
7148
7086
|
}
|
|
7149
7087
|
}
|
|
7150
7088
|
}
|
|
7151
|
-
if (indexArr.length == 0)
|
|
7152
|
-
result = emptyAnnotation;
|
|
7089
|
+
if (indexArr.length == 0) result = emptyAnnotation;
|
|
7153
7090
|
return { data: new Uint32Array(result), indexArr };
|
|
7154
7091
|
};
|
|
7155
7092
|
function isBase64Zeros(base64String) {
|
|
7156
7093
|
const trimmed = base64String.replace(/=+$/, "");
|
|
7157
7094
|
return /^A+$/.test(trimmed);
|
|
7158
7095
|
}
|
|
7159
|
-
const onSave = () => __async(
|
|
7096
|
+
const onSave = () => __async(null, null, function* () {
|
|
7160
7097
|
var _a2, _b2;
|
|
7161
7098
|
var bufferData = null;
|
|
7162
7099
|
const { data, indexArr } = evolandStore.isAnnualAnnotation ? { data: evolandStore.annotatedRasterAsset.buffer, indexArr: 0 } : flatten(
|
|
@@ -7204,8 +7141,7 @@ var init_RasterPreview = __esm({
|
|
|
7204
7141
|
setSubmitNotificationMessage(
|
|
7205
7142
|
"Annotation has been SAVED successfully"
|
|
7206
7143
|
);
|
|
7207
|
-
else
|
|
7208
|
-
setSubmitNotificationMessage("Please try again");
|
|
7144
|
+
else setSubmitNotificationMessage("Please try again");
|
|
7209
7145
|
setSubmitNotification(true);
|
|
7210
7146
|
}
|
|
7211
7147
|
} catch (err) {
|
|
@@ -7214,7 +7150,7 @@ var init_RasterPreview = __esm({
|
|
|
7214
7150
|
}
|
|
7215
7151
|
}
|
|
7216
7152
|
});
|
|
7217
|
-
const ClearPreview = () => __async(
|
|
7153
|
+
const ClearPreview = () => __async(null, null, function* () {
|
|
7218
7154
|
const { annotationRaster, pastValues } = yield ClearAnnotation(
|
|
7219
7155
|
evolandStore.annotatedRasterAsset,
|
|
7220
7156
|
evolandStore.isAnnualAnnotation,
|
|
@@ -7277,16 +7213,14 @@ var init_RasterPreview = __esm({
|
|
|
7277
7213
|
)] : newValue == null ? void 0 : newValue.buffer[0] : newValue == null ? void 0 : newValue.buffer
|
|
7278
7214
|
);
|
|
7279
7215
|
};
|
|
7280
|
-
if (layerStore.layerOpacity == 0)
|
|
7281
|
-
layerStore.setLayerOpacity(0.4);
|
|
7216
|
+
if (layerStore.layerOpacity == 0) layerStore.setLayerOpacity(0.4);
|
|
7282
7217
|
if (!goToNextTask && evolandStore.location !== null && evolandStore.location.locationId !== searchParams.get("locationId")) {
|
|
7283
7218
|
if (status == import_core13.TaskStatus.ACCEPTED || status == import_core13.TaskStatus.DISCARDED || status == import_core13.TaskStatus.TO_FIX) {
|
|
7284
7219
|
setGoToNextTask(true);
|
|
7285
7220
|
if (_props.userRole === "admin")
|
|
7286
7221
|
if (tasks == null ? void 0 : tasks.task)
|
|
7287
7222
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_a = tasks == null ? void 0 : tasks.task) == null ? void 0 : _a.location_id}&taskId=${(_b = tasks == null ? void 0 : tasks.task) == null ? void 0 : _b.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
|
|
7288
|
-
else
|
|
7289
|
-
alert("No more tasks to review");
|
|
7223
|
+
else alert("No more tasks to review");
|
|
7290
7224
|
} else
|
|
7291
7225
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_c = evolandStore.location) == null ? void 0 : _c.locationId}&taskId=${(_d = evolandStore.location) == null ? void 0 : _d.task[0].task_id}`;
|
|
7292
7226
|
}
|
|
@@ -7335,10 +7269,8 @@ var init_RasterPreview = __esm({
|
|
|
7335
7269
|
parseInt(projectId),
|
|
7336
7270
|
evolandStore.referenceDate
|
|
7337
7271
|
).then(({ location, currentTask, annotation_dates }) => {
|
|
7338
|
-
if (location)
|
|
7339
|
-
|
|
7340
|
-
if (currentTask)
|
|
7341
|
-
evolandStore.setCurrentTask(currentTask);
|
|
7272
|
+
if (location) evolandStore.setLocation(location);
|
|
7273
|
+
if (currentTask) evolandStore.setCurrentTask(currentTask);
|
|
7342
7274
|
evolandStore.setAnnotationDates(annotation_dates);
|
|
7343
7275
|
});
|
|
7344
7276
|
},
|
|
@@ -7374,8 +7306,7 @@ var init_RasterPreview = __esm({
|
|
|
7374
7306
|
evolandStore.setComment(
|
|
7375
7307
|
evolandStore.comment.replace(" #" + x, "")
|
|
7376
7308
|
);
|
|
7377
|
-
else
|
|
7378
|
-
evolandStore.setComment("#" + x + " ");
|
|
7309
|
+
else evolandStore.setComment("#" + x + " ");
|
|
7379
7310
|
},
|
|
7380
7311
|
children: [
|
|
7381
7312
|
"#",
|
|
@@ -7641,7 +7572,7 @@ var init_Annotation = __esm({
|
|
|
7641
7572
|
labelId: 0
|
|
7642
7573
|
});
|
|
7643
7574
|
const [currentLabelItem, setCurrentLabelItem] = (0, import_react16.useState)();
|
|
7644
|
-
const OnSubmitActiveLearning = () => __async(
|
|
7575
|
+
const OnSubmitActiveLearning = () => __async(null, null, function* () {
|
|
7645
7576
|
var _a2, _b2;
|
|
7646
7577
|
setActiveLearningLoading(true);
|
|
7647
7578
|
var bufferData = null;
|
|
@@ -8736,8 +8667,7 @@ var init_ViewAssets = __esm({
|
|
|
8736
8667
|
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
8737
8668
|
assetsByYear = (assets) => assets == null ? void 0 : assets.reduce((acc, item) => {
|
|
8738
8669
|
const year = new Date(item.reference_date).getFullYear();
|
|
8739
|
-
if (!acc[year])
|
|
8740
|
-
acc[year] = [];
|
|
8670
|
+
if (!acc[year]) acc[year] = [];
|
|
8741
8671
|
acc[year].push(item);
|
|
8742
8672
|
return acc;
|
|
8743
8673
|
}, {});
|
|
@@ -8854,14 +8784,10 @@ var init_ViewAssets = __esm({
|
|
|
8854
8784
|
);
|
|
8855
8785
|
if (props.taskId !== void 0 && IsTaskAnnotationLoading)
|
|
8856
8786
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui13.LoaderFull, {});
|
|
8857
|
-
if (maskTab && (masks == null ? void 0 : masks.length) == 0)
|
|
8858
|
-
|
|
8859
|
-
if (
|
|
8860
|
-
|
|
8861
|
-
if (compositesTab && composites.length == 0)
|
|
8862
|
-
checkCompositesAndLoad();
|
|
8863
|
-
if (annotationTab)
|
|
8864
|
-
checkAnnotationsAndLoad();
|
|
8787
|
+
if (maskTab && (masks == null ? void 0 : masks.length) == 0) setMasks(evolandStore.maskAsset);
|
|
8788
|
+
if (changeMaskTab && (changeMasks == null ? void 0 : changeMasks.length) == 0) checkChangeMasksAndLoad();
|
|
8789
|
+
if (compositesTab && composites.length == 0) checkCompositesAndLoad();
|
|
8790
|
+
if (annotationTab) checkAnnotationsAndLoad();
|
|
8865
8791
|
function checkMasksAndLoad() {
|
|
8866
8792
|
if ((masks == null ? void 0 : masks.length) === 0 && !evolandStore.maskAsset) {
|
|
8867
8793
|
evolandStore.getLocationAssets(
|
|
@@ -8872,8 +8798,7 @@ var init_ViewAssets = __esm({
|
|
|
8872
8798
|
).then((res) => {
|
|
8873
8799
|
setMasks(res);
|
|
8874
8800
|
});
|
|
8875
|
-
} else if (masks.length == 0)
|
|
8876
|
-
setMasks(evolandStore.maskAsset);
|
|
8801
|
+
} else if (masks.length == 0) setMasks(evolandStore.maskAsset);
|
|
8877
8802
|
}
|
|
8878
8803
|
function checkChangeMasksAndLoad() {
|
|
8879
8804
|
if ((changeMasks == null ? void 0 : changeMasks.length) === 0 && !evolandStore.changeMaskAsset) {
|
|
@@ -8919,8 +8844,7 @@ var init_ViewAssets = __esm({
|
|
|
8919
8844
|
}
|
|
8920
8845
|
if (props.taskId !== void 0 && IsTaskAnnotationLoading)
|
|
8921
8846
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui13.LoaderFull, {});
|
|
8922
|
-
if (maskTab && ((masks == null ? void 0 : masks.length) == 0 || masks == null))
|
|
8923
|
-
setMaskTab(false);
|
|
8847
|
+
if (maskTab && ((masks == null ? void 0 : masks.length) == 0 || masks == null)) setMaskTab(false);
|
|
8924
8848
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
8925
8849
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
8926
8850
|
"div",
|
|
@@ -9482,8 +9406,7 @@ var init_SearchAnnotation = __esm({
|
|
|
9482
9406
|
localStorage.setItem("toDate", toDate);
|
|
9483
9407
|
if (tasks == null ? void 0 : tasks.exists)
|
|
9484
9408
|
window.location.href = `/map?projectId=${tasks == null ? void 0 : tasks.task.project_id}&locationId=${tasks == null ? void 0 : tasks.task.location_id}&taskId=${tasks == null ? void 0 : tasks.task.task_id}${props.taskForReview ? "&review=true" : ""}`;
|
|
9485
|
-
else
|
|
9486
|
-
alert("No data for search parameters");
|
|
9409
|
+
else alert("No data for search parameters");
|
|
9487
9410
|
},
|
|
9488
9411
|
children: [
|
|
9489
9412
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -9824,14 +9747,11 @@ var init_EvolandLeftSideBar = __esm({
|
|
|
9824
9747
|
}
|
|
9825
9748
|
if (evolandStore.projectDetail) {
|
|
9826
9749
|
if (((_m = (_l = evolandStore.projectDetail) == null ? void 0 : _l.meta_data) == null ? void 0 : _m.default_asset_view) == "SEGMENTATION_MASK" /* SegmentationMask */) {
|
|
9827
|
-
if ((masks == null ? void 0 : masks.length) === 0)
|
|
9828
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9750
|
+
if ((masks == null ? void 0 : masks.length) === 0) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9829
9751
|
} else if (((_o = (_n = evolandStore.projectDetail) == null ? void 0 : _n.meta_data) == null ? void 0 : _o.default_asset_view) == "COMPOSITE" /* Composite */) {
|
|
9830
|
-
if ((composites == null ? void 0 : composites.length) === 0)
|
|
9831
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9752
|
+
if ((composites == null ? void 0 : composites.length) === 0) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9832
9753
|
}
|
|
9833
|
-
} else
|
|
9834
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9754
|
+
} else return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9835
9755
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9836
9756
|
"div",
|
|
9837
9757
|
{
|
|
@@ -9998,8 +9918,7 @@ var init_EvolandLeftSideBar = __esm({
|
|
|
9998
9918
|
canDelete = confirm(
|
|
9999
9919
|
(review ? "This is a targeted review task. " : "") + "Are you sure you want to delete this task?"
|
|
10000
9920
|
);
|
|
10001
|
-
if (canDelete)
|
|
10002
|
-
setDeleteTask(true);
|
|
9921
|
+
if (canDelete) setDeleteTask(true);
|
|
10003
9922
|
},
|
|
10004
9923
|
children: [
|
|
10005
9924
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
@@ -10041,8 +9960,7 @@ var init_EvolandLeftSideBar = __esm({
|
|
|
10041
9960
|
evolandStore.setAnnotationDates(annotation_dates);
|
|
10042
9961
|
if (currentTask)
|
|
10043
9962
|
evolandStore.setCurrentTask(currentTask);
|
|
10044
|
-
if (location)
|
|
10045
|
-
evolandStore.setLocation(location);
|
|
9963
|
+
if (location) evolandStore.setLocation(location);
|
|
10046
9964
|
if (props.userRole === "admin")
|
|
10047
9965
|
window.location.href = "/map?projectId=" + projectId + "&locationId=" + (currentTask == null ? void 0 : currentTask.location_id) + "&taskId=" + (currentTask == null ? void 0 : currentTask.task_id) + (evolandStore.task_for_review ? "&review=true" : "");
|
|
10048
9966
|
}
|
|
@@ -10234,10 +10152,9 @@ var init_Questions = __esm({
|
|
|
10234
10152
|
userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
|
|
10235
10153
|
locationLocationId: null
|
|
10236
10154
|
});
|
|
10237
|
-
const onSubmit = (taskStatus) => __async(
|
|
10155
|
+
const onSubmit = (taskStatus) => __async(null, null, function* () {
|
|
10238
10156
|
var _a2, _b2, _c2, _d2, _e2;
|
|
10239
|
-
if (disableSubmit)
|
|
10240
|
-
return;
|
|
10157
|
+
if (disableSubmit) return;
|
|
10241
10158
|
setDisableSubmit(true);
|
|
10242
10159
|
setStatus(taskStatus[0]);
|
|
10243
10160
|
if (evolandStore.currentTask) {
|
|
@@ -10269,8 +10186,7 @@ var init_Questions = __esm({
|
|
|
10269
10186
|
if (props.userRole === "admin") {
|
|
10270
10187
|
if (tasks == null ? void 0 : tasks.task)
|
|
10271
10188
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_d2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _d2.location_id}&taskId=${(_e2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _e2.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
|
|
10272
|
-
else
|
|
10273
|
-
alert("No more tasks to review");
|
|
10189
|
+
else alert("No more tasks to review");
|
|
10274
10190
|
}
|
|
10275
10191
|
var res = yield evolandStore.getNextLocationDetails(
|
|
10276
10192
|
parseInt(projectId)
|
|
@@ -10293,7 +10209,7 @@ var init_Questions = __esm({
|
|
|
10293
10209
|
setSubmitNotificationMessage("");
|
|
10294
10210
|
}
|
|
10295
10211
|
});
|
|
10296
|
-
const onSave = () => __async(
|
|
10212
|
+
const onSave = () => __async(null, null, function* () {
|
|
10297
10213
|
if (evolandStore.currentTask) {
|
|
10298
10214
|
const saveQuestionnaireReq = {
|
|
10299
10215
|
task_id: evolandStore.currentTask.task_id,
|
|
@@ -10312,8 +10228,7 @@ var init_Questions = __esm({
|
|
|
10312
10228
|
setSubmitNotificationMessage(
|
|
10313
10229
|
"Questionnaire has been SAVED successfully"
|
|
10314
10230
|
);
|
|
10315
|
-
else
|
|
10316
|
-
setSubmitNotificationMessage("Please try again");
|
|
10231
|
+
else setSubmitNotificationMessage("Please try again");
|
|
10317
10232
|
setSubmitNotification(true);
|
|
10318
10233
|
}
|
|
10319
10234
|
} catch (err) {
|
|
@@ -10346,8 +10261,7 @@ var init_Questions = __esm({
|
|
|
10346
10261
|
"<" + key + ">",
|
|
10347
10262
|
"" + (label == null ? void 0 : label.labelName)
|
|
10348
10263
|
);
|
|
10349
|
-
} else
|
|
10350
|
-
y.text = y.text.replace("<" + key + ">", "" + value);
|
|
10264
|
+
} else y.text = y.text.replace("<" + key + ">", "" + value);
|
|
10351
10265
|
});
|
|
10352
10266
|
});
|
|
10353
10267
|
}
|
|
@@ -10393,8 +10307,7 @@ var init_Questions = __esm({
|
|
|
10393
10307
|
if (props.userRole === "admin")
|
|
10394
10308
|
if (tasks == null ? void 0 : tasks.task)
|
|
10395
10309
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_c = tasks == null ? void 0 : tasks.task) == null ? void 0 : _c.location_id}&taskId=${(_d = tasks == null ? void 0 : tasks.task) == null ? void 0 : _d.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
|
|
10396
|
-
else
|
|
10397
|
-
alert("No more tasks to review");
|
|
10310
|
+
else alert("No more tasks to review");
|
|
10398
10311
|
} else
|
|
10399
10312
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_e = evolandStore.location) == null ? void 0 : _e.locationId}&taskId=${(_f = evolandStore.location) == null ? void 0 : _f.task[0].task_id}`;
|
|
10400
10313
|
}
|
|
@@ -10509,8 +10422,7 @@ var init_Questions = __esm({
|
|
|
10509
10422
|
evolandStore.setComment(
|
|
10510
10423
|
evolandStore.comment.replace(" #" + x, "")
|
|
10511
10424
|
);
|
|
10512
|
-
else
|
|
10513
|
-
evolandStore.setComment("#" + x + " ");
|
|
10425
|
+
else evolandStore.setComment("#" + x + " ");
|
|
10514
10426
|
},
|
|
10515
10427
|
children: [
|
|
10516
10428
|
"#",
|
|
@@ -10543,8 +10455,7 @@ var init_Questions = __esm({
|
|
|
10543
10455
|
onClick: () => {
|
|
10544
10456
|
if (import_core24.TaskState[x[0]] !== import_core24.TaskState.SKIPPED && import_core24.TaskState[x[0]] !== import_core24.TaskState.DISCARDED && import_core24.TaskState[x[0]] !== import_core24.TaskState.USER_DISCARDED && userAnswers.length !== requiredUserAnswers)
|
|
10545
10457
|
alert("Please provide all answers");
|
|
10546
|
-
else
|
|
10547
|
-
onSubmit(x);
|
|
10458
|
+
else onSubmit(x);
|
|
10548
10459
|
},
|
|
10549
10460
|
children: import_core24.TaskState[x[0]]
|
|
10550
10461
|
}
|
|
@@ -10601,7 +10512,7 @@ var init_TimeSeries = __esm({
|
|
|
10601
10512
|
const bbox4 = [bounds[1], bounds[0], bounds[3], bounds[2]];
|
|
10602
10513
|
const years = changeYears != null ? changeYears : taskChangeYears;
|
|
10603
10514
|
if (years) {
|
|
10604
|
-
years.map((year) => __async(
|
|
10515
|
+
years.map((year) => __async(null, null, function* () {
|
|
10605
10516
|
yield getTimeseries(
|
|
10606
10517
|
year + "-01-01",
|
|
10607
10518
|
year + "-12-31",
|
|
@@ -10636,8 +10547,7 @@ var init_TimeSeries = __esm({
|
|
|
10636
10547
|
})
|
|
10637
10548
|
}
|
|
10638
10549
|
);
|
|
10639
|
-
if (!appendImages)
|
|
10640
|
-
setDetailedImgUrls((yield response.json()).images);
|
|
10550
|
+
if (!appendImages) setDetailedImgUrls((yield response.json()).images);
|
|
10641
10551
|
else {
|
|
10642
10552
|
response.json().then((res) => {
|
|
10643
10553
|
setDetailedImgUrls((prevUrls) => [...prevUrls, ...res.images]);
|
|
@@ -10681,18 +10591,15 @@ var init_TimeSeries = __esm({
|
|
|
10681
10591
|
return 1;
|
|
10682
10592
|
else if (x.substring(x.split("_")[0].length, x.length) < y.substring(y.split("_")[0].length, y.length))
|
|
10683
10593
|
return -1;
|
|
10684
|
-
else
|
|
10685
|
-
return 0;
|
|
10594
|
+
else return 0;
|
|
10686
10595
|
}).map((x, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10687
10596
|
"button",
|
|
10688
10597
|
{
|
|
10689
10598
|
className: currentTab === index ? "pl-1 pr-5 border-gray-300 text-white" : "pl-1 pr-5 border-gray-300 bg-gray-200",
|
|
10690
10599
|
onClick: () => {
|
|
10691
10600
|
setDetailedImgUrls([]);
|
|
10692
|
-
if (x.includes("RGB"))
|
|
10693
|
-
|
|
10694
|
-
else if (x.includes("FCC"))
|
|
10695
|
-
fetchImages("COLOR_INFRARED" /* FCC */);
|
|
10601
|
+
if (x.includes("RGB")) fetchImages("TRUE_COLOR" /* RGB */);
|
|
10602
|
+
else if (x.includes("FCC")) fetchImages("COLOR_INFRARED" /* FCC */);
|
|
10696
10603
|
setCurrentTab(index);
|
|
10697
10604
|
},
|
|
10698
10605
|
children: x.substring(x.split("_")[0].length + 1, x.length)
|
|
@@ -10879,8 +10786,7 @@ var init_OverlayLayer = __esm({
|
|
|
10879
10786
|
if (e.target.value !== "0") {
|
|
10880
10787
|
layerStore.setSelectedLayer(e.target.value);
|
|
10881
10788
|
setShowLayerOpacity(true);
|
|
10882
|
-
if (layerStore.layerOpacity == 0)
|
|
10883
|
-
layerStore.setLayerOpacity(0.4);
|
|
10789
|
+
if (layerStore.layerOpacity == 0) layerStore.setLayerOpacity(0.4);
|
|
10884
10790
|
} else {
|
|
10885
10791
|
setShowLayerOpacity(false);
|
|
10886
10792
|
layerStore.setSelectedLayer("");
|
|
@@ -10944,7 +10850,7 @@ var init_GeoWikiMap = __esm({
|
|
|
10944
10850
|
import_jsx_runtime77 = require("react/jsx-runtime");
|
|
10945
10851
|
GeoWikiMapComponent = ({ mapSettings, session }) => {
|
|
10946
10852
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
10947
|
-
const mapRef = (0, import_react60.useRef)();
|
|
10853
|
+
const mapRef = (0, import_react60.useRef)(void 0);
|
|
10948
10854
|
const router = (0, import_core45.useRouter)();
|
|
10949
10855
|
var projectId = router.query.projectId;
|
|
10950
10856
|
var locationId = router.query.locationId;
|
|
@@ -11331,8 +11237,8 @@ var init_GeoWikiMap = __esm({
|
|
|
11331
11237
|
});
|
|
11332
11238
|
|
|
11333
11239
|
// src/index.tsx
|
|
11334
|
-
var
|
|
11335
|
-
__export(
|
|
11240
|
+
var index_exports = {};
|
|
11241
|
+
__export(index_exports, {
|
|
11336
11242
|
Annotation: () => Annotation,
|
|
11337
11243
|
BasfMap: () => BasfMap,
|
|
11338
11244
|
BasicMap: () => BasicMap,
|
|
@@ -11374,7 +11280,7 @@ __export(src_exports, {
|
|
|
11374
11280
|
useMapLayerStore: () => useMapLayerStore,
|
|
11375
11281
|
useMapStore: () => useMapStore
|
|
11376
11282
|
});
|
|
11377
|
-
module.exports = __toCommonJS(
|
|
11283
|
+
module.exports = __toCommonJS(index_exports);
|
|
11378
11284
|
init_GenericControl();
|
|
11379
11285
|
init_EvoLandGeometry();
|
|
11380
11286
|
init_PointSelection();
|
|
@@ -11592,10 +11498,8 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
11592
11498
|
for (let i = z4; i > 0; i--) {
|
|
11593
11499
|
let digit = 0;
|
|
11594
11500
|
const mask = 1 << i - 1;
|
|
11595
|
-
if ((x & mask) !== 0)
|
|
11596
|
-
|
|
11597
|
-
if ((y & mask) !== 0)
|
|
11598
|
-
digit += 2;
|
|
11501
|
+
if ((x & mask) !== 0) digit += 1;
|
|
11502
|
+
if ((y & mask) !== 0) digit += 2;
|
|
11599
11503
|
quad = quad + digit;
|
|
11600
11504
|
}
|
|
11601
11505
|
return quad;
|
|
@@ -11609,8 +11513,7 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
11609
11513
|
}
|
|
11610
11514
|
loadMetadata() {
|
|
11611
11515
|
var _a;
|
|
11612
|
-
if (this.metaRequested)
|
|
11613
|
-
return;
|
|
11516
|
+
if (this.metaRequested) return;
|
|
11614
11517
|
this.metaRequested = true;
|
|
11615
11518
|
const _this = this;
|
|
11616
11519
|
const cbid = "_bing_metadata_" + L13.Util.stamp(this);
|
|
@@ -11618,8 +11521,7 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
11618
11521
|
var _a2;
|
|
11619
11522
|
window[cbid] = void 0;
|
|
11620
11523
|
const e = document.getElementById(cbid);
|
|
11621
|
-
if (e)
|
|
11622
|
-
(_a2 = e.parentNode) == null ? void 0 : _a2.removeChild(e);
|
|
11524
|
+
if (e) (_a2 = e.parentNode) == null ? void 0 : _a2.removeChild(e);
|
|
11623
11525
|
if (meta.errorDetails) {
|
|
11624
11526
|
console.log(meta.errorDetails);
|
|
11625
11527
|
return;
|
|
@@ -11663,8 +11565,7 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
11663
11565
|
this._update();
|
|
11664
11566
|
}
|
|
11665
11567
|
_update() {
|
|
11666
|
-
if (this._url === null || !this._map)
|
|
11667
|
-
return;
|
|
11568
|
+
if (this._url === null || !this._map) return;
|
|
11668
11569
|
this._update_attribution();
|
|
11669
11570
|
super._update();
|
|
11670
11571
|
}
|
|
@@ -11827,8 +11728,7 @@ var useMapControlStore = (0, import_zustand6.create)((set) => ({
|
|
|
11827
11728
|
})),
|
|
11828
11729
|
toggleControlOpen: (id) => set((state) => {
|
|
11829
11730
|
const targetControl = state.controls.find((c) => c.id === id);
|
|
11830
|
-
if (!targetControl)
|
|
11831
|
-
return state;
|
|
11731
|
+
if (!targetControl) return state;
|
|
11832
11732
|
const targetPosition = targetControl.position;
|
|
11833
11733
|
const shouldOpenTarget = !targetControl.isOpen;
|
|
11834
11734
|
const updatedControls = state.controls.map((control) => {
|
|
@@ -12016,7 +11916,7 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
|
12016
11916
|
var constructLegendUrl = (baseUrl, layer, format, style) => {
|
|
12017
11917
|
return `${baseUrl}?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=${format}&LAYER=${layer}&STYLE=${style}&legend_options=dpi:150`;
|
|
12018
11918
|
};
|
|
12019
|
-
var fetchLegendData = (baseUrl, layerName, format, style) => __async(
|
|
11919
|
+
var fetchLegendData = (baseUrl, layerName, format, style) => __async(null, null, function* () {
|
|
12020
11920
|
const legendGraphicUrl = constructLegendUrl(
|
|
12021
11921
|
baseUrl,
|
|
12022
11922
|
layerName,
|
|
@@ -12817,10 +12717,8 @@ var LayerSwitcher = (0, import_react27.memo)(() => {
|
|
|
12817
12717
|
},
|
|
12818
12718
|
[openHoverCardId]
|
|
12819
12719
|
);
|
|
12820
|
-
if (error)
|
|
12821
|
-
|
|
12822
|
-
if (isLoading)
|
|
12823
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: "Loading layers..." });
|
|
12720
|
+
if (error) return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: "Error loading map layers" });
|
|
12721
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: "Loading layers..." });
|
|
12824
12722
|
const mapMenus = parseMapMenuItems(mapMenuItems);
|
|
12825
12723
|
const hasRegularLayers = (mapMenus == null ? void 0 : mapMenus.length) > 0;
|
|
12826
12724
|
const hasCustomLayers = customLayers.length > 0;
|
|
@@ -13291,8 +13189,7 @@ var MapControlContainer = (0, import_react35.memo)(() => {
|
|
|
13291
13189
|
}, [controls]);
|
|
13292
13190
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_ui24.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: Object.entries(POSITION_CLASSES2).map(([position, className]) => {
|
|
13293
13191
|
const positionControls = controlsByPosition[position] || [];
|
|
13294
|
-
if (positionControls.length === 0)
|
|
13295
|
-
return null;
|
|
13192
|
+
if (positionControls.length === 0) return null;
|
|
13296
13193
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13297
13194
|
PositionGroup,
|
|
13298
13195
|
{
|
|
@@ -13319,8 +13216,7 @@ var BasicMap = () => {
|
|
|
13319
13216
|
((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
|
|
13320
13217
|
];
|
|
13321
13218
|
(0, import_core33.useRenderInfo)("BasicMap");
|
|
13322
|
-
if (isSettingsLoading)
|
|
13323
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_ui25.LoaderFull, {});
|
|
13219
|
+
if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_ui25.LoaderFull, {});
|
|
13324
13220
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
13325
13221
|
import_react_leaflet15.MapContainer,
|
|
13326
13222
|
{
|
|
@@ -13389,8 +13285,7 @@ var useSelectedPixelStore = (0, import_zustand7.default)((set) => ({
|
|
|
13389
13285
|
set((state) => {
|
|
13390
13286
|
var _a;
|
|
13391
13287
|
const feat = (_a = geoJson.features[0]) == null ? void 0 : _a.id;
|
|
13392
|
-
if (!feat)
|
|
13393
|
-
return state;
|
|
13288
|
+
if (!feat) return state;
|
|
13394
13289
|
const existing = state.data.some(
|
|
13395
13290
|
(item) => item.features[0].id === geoJson.features[0].id
|
|
13396
13291
|
);
|
|
@@ -14056,7 +13951,7 @@ var BasfSelect = () => {
|
|
|
14056
13951
|
[selectedItems]
|
|
14057
13952
|
);
|
|
14058
13953
|
const onSubmit = (0, import_react43.useCallback)(
|
|
14059
|
-
(data) => __async(
|
|
13954
|
+
(data) => __async(null, null, function* () {
|
|
14060
13955
|
setIsSubmitting(true);
|
|
14061
13956
|
try {
|
|
14062
13957
|
if (checkIfItemExists(data)) {
|
|
@@ -14166,8 +14061,7 @@ function PolylineMeasureControl() {
|
|
|
14166
14061
|
const controlRef = (0, import_react44.useRef)(null);
|
|
14167
14062
|
const [active, setActive] = (0, import_react44.useState)(false);
|
|
14168
14063
|
(0, import_react44.useEffect)(() => {
|
|
14169
|
-
if (!map)
|
|
14170
|
-
return;
|
|
14064
|
+
if (!map) return;
|
|
14171
14065
|
controlRef.current = import_leaflet12.default.control.polylineMeasure({
|
|
14172
14066
|
position: "topright",
|
|
14173
14067
|
unit: "metres",
|
|
@@ -14188,8 +14082,7 @@ function PolylineMeasureControl() {
|
|
|
14188
14082
|
};
|
|
14189
14083
|
}, [map]);
|
|
14190
14084
|
const togglePolylineMeasure = () => {
|
|
14191
|
-
if (!controlRef.current)
|
|
14192
|
-
return;
|
|
14085
|
+
if (!controlRef.current) return;
|
|
14193
14086
|
if (!controlRef.current._measureControl) {
|
|
14194
14087
|
console.warn("Measurement control not properly initialized");
|
|
14195
14088
|
return;
|
|
@@ -14205,8 +14098,7 @@ function PolylineMeasureControl() {
|
|
|
14205
14098
|
}
|
|
14206
14099
|
};
|
|
14207
14100
|
const clearMeasurements = () => {
|
|
14208
|
-
if (!controlRef.current)
|
|
14209
|
-
return;
|
|
14101
|
+
if (!controlRef.current) return;
|
|
14210
14102
|
controlRef.current._clearAllMeasurements();
|
|
14211
14103
|
import_core38.trackMapEvent.measurementTool("clear");
|
|
14212
14104
|
};
|
|
@@ -14315,8 +14207,7 @@ var BasfMapComponent = (_a) => {
|
|
|
14315
14207
|
Number((_i = (_h = (_g = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _g.Longitude) == null ? void 0 : _h.Text) != null ? _i : 16.3738)
|
|
14316
14208
|
];
|
|
14317
14209
|
const steps = (_k = (_j = mapSettings == null ? void 0 : mapSettings.MapSettings) == null ? void 0 : _j.TourSteps) == null ? void 0 : _k.Text;
|
|
14318
|
-
if (isSettingsLoading)
|
|
14319
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_ui33.LoaderFull, {});
|
|
14210
|
+
if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_ui33.LoaderFull, {});
|
|
14320
14211
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_jsx_runtime62.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
14321
14212
|
import_react_leaflet19.MapContainer,
|
|
14322
14213
|
__spreadProps(__spreadValues({
|
|
@@ -14386,7 +14277,7 @@ var GeoTreesDownloadContent = () => {
|
|
|
14386
14277
|
}
|
|
14387
14278
|
}, [session, setValue]);
|
|
14388
14279
|
(0, import_react47.useEffect)(() => {
|
|
14389
|
-
const fetchCountries = () => __async(
|
|
14280
|
+
const fetchCountries = () => __async(null, null, function* () {
|
|
14390
14281
|
try {
|
|
14391
14282
|
const response = yield fetch(
|
|
14392
14283
|
`${baseUrl}/api/plots/get-available-countries`,
|
|
@@ -14402,7 +14293,7 @@ var GeoTreesDownloadContent = () => {
|
|
|
14402
14293
|
console.error("Error fetching countries:", error);
|
|
14403
14294
|
}
|
|
14404
14295
|
});
|
|
14405
|
-
const fetchVersions = () => __async(
|
|
14296
|
+
const fetchVersions = () => __async(null, null, function* () {
|
|
14406
14297
|
try {
|
|
14407
14298
|
const response = yield fetch(
|
|
14408
14299
|
`${baseUrl}/api/plots/available-versions`,
|
|
@@ -14656,8 +14547,7 @@ var ScaleControl3 = ({
|
|
|
14656
14547
|
const [scale, setScale] = (0, import_react48.useState)("");
|
|
14657
14548
|
(0, import_react48.useEffect)(() => {
|
|
14658
14549
|
const updateScale = () => {
|
|
14659
|
-
if (!map)
|
|
14660
|
-
return;
|
|
14550
|
+
if (!map) return;
|
|
14661
14551
|
const center4 = map.getCenter();
|
|
14662
14552
|
const zoom = map.getZoom();
|
|
14663
14553
|
const metersPerPixel = 156543.03392 * Math.cos(center4.lat * Math.PI / 180) / Math.pow(2, zoom);
|
|
@@ -14673,8 +14563,7 @@ var ScaleControl3 = ({
|
|
|
14673
14563
|
map.off("moveend", updateScale);
|
|
14674
14564
|
};
|
|
14675
14565
|
}, [map]);
|
|
14676
|
-
if (!scale)
|
|
14677
|
-
return null;
|
|
14566
|
+
if (!scale) return null;
|
|
14678
14567
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14679
14568
|
"div",
|
|
14680
14569
|
{
|
|
@@ -15273,7 +15162,7 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
|
|
|
15273
15162
|
const externalUrl = `${API_URL}/api/external/google-sheet-geojson`;
|
|
15274
15163
|
const { isLoading, error, data } = (0, import_react_query5.useQuery)({
|
|
15275
15164
|
queryKey: ["geoTreesExternal", externalUrl],
|
|
15276
|
-
queryFn: () => __async(
|
|
15165
|
+
queryFn: () => __async(null, null, function* () {
|
|
15277
15166
|
if (!API_URL) {
|
|
15278
15167
|
throw new Error("NEXT_PUBLIC_GEO_TREE_API_URL is not configured");
|
|
15279
15168
|
}
|
|
@@ -15305,8 +15194,7 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
|
|
|
15305
15194
|
);
|
|
15306
15195
|
const addGeoTreesLayer = (0, import_react51.useCallback)(() => {
|
|
15307
15196
|
var _a2;
|
|
15308
|
-
if (!data)
|
|
15309
|
-
return;
|
|
15197
|
+
if (!data) return;
|
|
15310
15198
|
const layerId = "geotrees-external-layer";
|
|
15311
15199
|
if (hasLayerBeenAdded(layerId) || existingLayer || hasAddedLayer.current) {
|
|
15312
15200
|
console.warn("GEO-TREES BRM layer already exists, skipping addition", {
|
|
@@ -15319,8 +15207,7 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
|
|
|
15319
15207
|
const filteredFeatures = ((_a2 = data.features) == null ? void 0 : _a2.filter((feature) => {
|
|
15320
15208
|
var _a3;
|
|
15321
15209
|
const status = (_a3 = feature.properties) == null ? void 0 : _a3.Status;
|
|
15322
|
-
if (!status)
|
|
15323
|
-
return true;
|
|
15210
|
+
if (!status) return true;
|
|
15324
15211
|
const statusKey = getStatusFromRaw(status);
|
|
15325
15212
|
return statusKey ? statusFilter[statusKey] : true;
|
|
15326
15213
|
})) || [];
|
|
@@ -15388,12 +15275,9 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
|
|
|
15388
15275
|
addGeoTreesLayer();
|
|
15389
15276
|
}
|
|
15390
15277
|
}, [data, autoAdd, existingLayer, addGeoTreesLayer, hasLayerBeenAdded]);
|
|
15391
|
-
if (error)
|
|
15392
|
-
|
|
15393
|
-
if (
|
|
15394
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(LoadingDisplay, {});
|
|
15395
|
-
if (!((_a = data == null ? void 0 : data.features) == null ? void 0 : _a.length))
|
|
15396
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EmptyStateDisplay, {});
|
|
15278
|
+
if (error) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ErrorDisplay, { error });
|
|
15279
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(LoadingDisplay, {});
|
|
15280
|
+
if (!((_a = data == null ? void 0 : data.features) == null ? void 0 : _a.length)) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EmptyStateDisplay, {});
|
|
15397
15281
|
return null;
|
|
15398
15282
|
}
|
|
15399
15283
|
);
|
|
@@ -15444,8 +15328,7 @@ var GeoTreesMap = () => {
|
|
|
15444
15328
|
"Error loading map settings: ",
|
|
15445
15329
|
error.message
|
|
15446
15330
|
] }) });
|
|
15447
|
-
if (isSettingsLoading)
|
|
15448
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_ui35.LoaderFull, { showInCenter: false });
|
|
15331
|
+
if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_ui35.LoaderFull, { showInCenter: false });
|
|
15449
15332
|
const zoom = (_c = (_b = (_a = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _a.Zoom) == null ? void 0 : _b.Value) != null ? _c : 12;
|
|
15450
15333
|
const center4 = [
|
|
15451
15334
|
(_f = (_e = (_d = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _d.Latitude) == null ? void 0 : _e.Text) != null ? _f : 48.2082,
|
|
@@ -15506,8 +15389,7 @@ var useAreaSelect = ({
|
|
|
15506
15389
|
const rectangleRef = (0, import_react53.useRef)(null);
|
|
15507
15390
|
(0, import_react53.useEffect)(() => {
|
|
15508
15391
|
var _a;
|
|
15509
|
-
if (!map.selectArea)
|
|
15510
|
-
return;
|
|
15392
|
+
if (!map.selectArea) return;
|
|
15511
15393
|
(_a = map.selectArea) == null ? void 0 : _a.setControlKey(false);
|
|
15512
15394
|
if (!rectangleRef.current) {
|
|
15513
15395
|
rectangleRef.current = new import_leaflet17.Rectangle(
|
|
@@ -15520,8 +15402,7 @@ var useAreaSelect = ({
|
|
|
15520
15402
|
}
|
|
15521
15403
|
const handleAreaSelected = (e) => {
|
|
15522
15404
|
var _a2, _b, _c;
|
|
15523
|
-
if (!e.bounds)
|
|
15524
|
-
return;
|
|
15405
|
+
if (!e.bounds) return;
|
|
15525
15406
|
const boundsString = e.bounds.toBBoxString();
|
|
15526
15407
|
if (onAreaSelected) {
|
|
15527
15408
|
onAreaSelected(boundsString);
|
|
@@ -15594,9 +15475,8 @@ var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
|
15594
15475
|
var CanopyAtlasDownload = () => {
|
|
15595
15476
|
const [format, setFormat] = (0, import_react54.useState)("shape-zip");
|
|
15596
15477
|
const { bbox: bbox4 } = useAreaSelectStore();
|
|
15597
|
-
const handleDownload = () => __async(
|
|
15598
|
-
if (!bbox4)
|
|
15599
|
-
return;
|
|
15478
|
+
const handleDownload = () => __async(null, null, function* () {
|
|
15479
|
+
if (!bbox4) return;
|
|
15600
15480
|
const params = {
|
|
15601
15481
|
request: "GetFeature",
|
|
15602
15482
|
service: "WFS",
|
|
@@ -15611,8 +15491,7 @@ var CanopyAtlasDownload = () => {
|
|
|
15611
15491
|
const wfsUrl = baseUrl + import_leaflet18.default.Util.getParamString(params, baseUrl, true);
|
|
15612
15492
|
try {
|
|
15613
15493
|
const response = yield fetch(wfsUrl);
|
|
15614
|
-
if (!response.ok)
|
|
15615
|
-
throw new Error("Download failed");
|
|
15494
|
+
if (!response.ok) throw new Error("Download failed");
|
|
15616
15495
|
const blob = yield response.blob();
|
|
15617
15496
|
const url = window.URL.createObjectURL(blob);
|
|
15618
15497
|
const a = document.createElement("a");
|
|
@@ -15786,20 +15665,15 @@ var CanopyFilter = (0, import_react55.memo)(({ onFilterChange }) => {
|
|
|
15786
15665
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(updatedFilters));
|
|
15787
15666
|
onFilterChange(updatedFilters);
|
|
15788
15667
|
};
|
|
15789
|
-
const handleDownload = () => __async(
|
|
15668
|
+
const handleDownload = () => __async(null, null, function* () {
|
|
15790
15669
|
const cqlFilters = [];
|
|
15791
|
-
if (filters.biome)
|
|
15792
|
-
|
|
15793
|
-
if (filters.
|
|
15794
|
-
cqlFilters.push(`realm='${filters.realm}'`);
|
|
15795
|
-
if (filters.access)
|
|
15796
|
-
cqlFilters.push(`access='${filters.access}'`);
|
|
15670
|
+
if (filters.biome) cqlFilters.push(`biome='${filters.biome}'`);
|
|
15671
|
+
if (filters.realm) cqlFilters.push(`realm='${filters.realm}'`);
|
|
15672
|
+
if (filters.access) cqlFilters.push(`access='${filters.access}'`);
|
|
15797
15673
|
if (filters.idunique)
|
|
15798
15674
|
cqlFilters.push(`IDunique LIKE '%${filters.idunique}%'`);
|
|
15799
|
-
if (filters.minyear)
|
|
15800
|
-
|
|
15801
|
-
if (filters.maxyear)
|
|
15802
|
-
cqlFilters.push(`minyear<=${filters.maxyear}`);
|
|
15675
|
+
if (filters.minyear) cqlFilters.push(`minyear>=${filters.minyear}`);
|
|
15676
|
+
if (filters.maxyear) cqlFilters.push(`minyear<=${filters.maxyear}`);
|
|
15803
15677
|
const params = __spreadValues({
|
|
15804
15678
|
request: "GetFeature",
|
|
15805
15679
|
service: "WFS",
|
|
@@ -15813,8 +15687,7 @@ var CanopyFilter = (0, import_react55.memo)(({ onFilterChange }) => {
|
|
|
15813
15687
|
const wfsUrl = baseUrl + import_leaflet19.default.Util.getParamString(params, baseUrl, true);
|
|
15814
15688
|
try {
|
|
15815
15689
|
const response = yield fetch(wfsUrl);
|
|
15816
|
-
if (!response.ok)
|
|
15817
|
-
throw new Error("Download failed");
|
|
15690
|
+
if (!response.ok) throw new Error("Download failed");
|
|
15818
15691
|
const blob = yield response.blob();
|
|
15819
15692
|
const url = window.URL.createObjectURL(blob);
|
|
15820
15693
|
const a = document.createElement("a");
|
|
@@ -16050,10 +15923,8 @@ var constructCqlFilter = (filterParams) => {
|
|
|
16050
15923
|
return "";
|
|
16051
15924
|
}
|
|
16052
15925
|
let _a = filterParams || {}, { minyear, maxyear } = _a, rest = __objRest(_a, ["minyear", "maxyear"]);
|
|
16053
|
-
if (Array.isArray(minyear))
|
|
16054
|
-
|
|
16055
|
-
if (Array.isArray(maxyear))
|
|
16056
|
-
maxyear = maxyear[0];
|
|
15926
|
+
if (Array.isArray(minyear)) minyear = minyear[0];
|
|
15927
|
+
if (Array.isArray(maxyear)) maxyear = maxyear[0];
|
|
16057
15928
|
const cqlExpressions = [];
|
|
16058
15929
|
if (minyear && maxyear) {
|
|
16059
15930
|
cqlExpressions.push(
|
|
@@ -16160,16 +16031,14 @@ var formatPropertyValue = (value, propertyName) => {
|
|
|
16160
16031
|
return value.toString();
|
|
16161
16032
|
};
|
|
16162
16033
|
var createDefaultPopupContent = (feature, propertyNames) => {
|
|
16163
|
-
if (!feature.properties)
|
|
16164
|
-
return "";
|
|
16034
|
+
if (!feature.properties) return "";
|
|
16165
16035
|
const propertiesToShow = (propertyNames == null ? void 0 : propertyNames.length) ? propertyNames : DEFAULT_POPUP_PROPERTIES;
|
|
16166
16036
|
const properties = Object.entries(feature.properties).filter(([key]) => propertiesToShow.includes(key)).sort((a, b) => {
|
|
16167
16037
|
const indexA = propertiesToShow.indexOf(a[0]);
|
|
16168
16038
|
const indexB = propertiesToShow.indexOf(b[0]);
|
|
16169
16039
|
return indexA - indexB;
|
|
16170
16040
|
});
|
|
16171
|
-
if (properties.length === 0)
|
|
16172
|
-
return "";
|
|
16041
|
+
if (properties.length === 0) return "";
|
|
16173
16042
|
return `
|
|
16174
16043
|
<div class="leaflet-popup-content-wrapper" style="background-color: #fff; padding: 0; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.15);">
|
|
16175
16044
|
<div style="width: 100%; overflow-y: auto;">
|
|
@@ -16240,7 +16109,7 @@ var openDatabase = () => {
|
|
|
16240
16109
|
};
|
|
16241
16110
|
});
|
|
16242
16111
|
};
|
|
16243
|
-
var storeInIndexedDB = (key, data) => __async(
|
|
16112
|
+
var storeInIndexedDB = (key, data) => __async(null, null, function* () {
|
|
16244
16113
|
try {
|
|
16245
16114
|
const db = yield openDatabase();
|
|
16246
16115
|
const transaction = db.transaction(STORE_NAME, "readwrite");
|
|
@@ -16259,7 +16128,7 @@ var storeInIndexedDB = (key, data) => __async(void 0, null, function* () {
|
|
|
16259
16128
|
console.warn("Failed to store data in IndexedDB:", e);
|
|
16260
16129
|
}
|
|
16261
16130
|
});
|
|
16262
|
-
var getFromIndexedDB = (key) => __async(
|
|
16131
|
+
var getFromIndexedDB = (key) => __async(null, null, function* () {
|
|
16263
16132
|
try {
|
|
16264
16133
|
const db = yield openDatabase();
|
|
16265
16134
|
const transaction = db.transaction(STORE_NAME, "readonly");
|
|
@@ -16281,7 +16150,7 @@ var getFromIndexedDB = (key) => __async(void 0, null, function* () {
|
|
|
16281
16150
|
return null;
|
|
16282
16151
|
}
|
|
16283
16152
|
});
|
|
16284
|
-
var cleanupIndexedDB = () => __async(
|
|
16153
|
+
var cleanupIndexedDB = () => __async(null, null, function* () {
|
|
16285
16154
|
try {
|
|
16286
16155
|
const db = yield openDatabase();
|
|
16287
16156
|
const transaction = db.transaction(STORE_NAME, "readwrite");
|
|
@@ -16331,8 +16200,7 @@ var WfsLayer = ({
|
|
|
16331
16200
|
}
|
|
16332
16201
|
});
|
|
16333
16202
|
const stableFilterParams = (0, import_react56.useMemo)(() => {
|
|
16334
|
-
if (!filterParams)
|
|
16335
|
-
return null;
|
|
16203
|
+
if (!filterParams) return null;
|
|
16336
16204
|
return JSON.stringify(filterParams);
|
|
16337
16205
|
}, [filterParams]);
|
|
16338
16206
|
const queryKey = (0, import_react56.useMemo)(() => {
|
|
@@ -16354,7 +16222,7 @@ var WfsLayer = ({
|
|
|
16354
16222
|
}, [url, layerName, filterParams, useServerFiltering]);
|
|
16355
16223
|
const { data: geoJsonData, error } = (0, import_react_query6.useQuery)({
|
|
16356
16224
|
queryKey,
|
|
16357
|
-
queryFn: () => __async(
|
|
16225
|
+
queryFn: () => __async(null, null, function* () {
|
|
16358
16226
|
mapStore.setIsLoading(true);
|
|
16359
16227
|
const wfsUrl = constructWfsUrl();
|
|
16360
16228
|
const storageKey = `wfs-data-${queryKey.join("-")}`;
|
|
@@ -16419,8 +16287,7 @@ var WfsLayer = ({
|
|
|
16419
16287
|
const getFeatureStyle = (0, import_react56.useCallback)(
|
|
16420
16288
|
(feature) => {
|
|
16421
16289
|
var _a2;
|
|
16422
|
-
if (!feature)
|
|
16423
|
-
return defaultStyle;
|
|
16290
|
+
if (!feature) return defaultStyle;
|
|
16424
16291
|
const featureId = ((_a2 = feature.id) == null ? void 0 : _a2.toString()) || JSON.stringify(feature.properties);
|
|
16425
16292
|
return featureId === selectedFeatureId ? highlightStyle : defaultStyle;
|
|
16426
16293
|
},
|
|
@@ -16431,8 +16298,7 @@ var WfsLayer = ({
|
|
|
16431
16298
|
var _a2;
|
|
16432
16299
|
const featureId = ((_a2 = feature.id) == null ? void 0 : _a2.toString()) || JSON.stringify(feature.properties);
|
|
16433
16300
|
layerRef.current[featureId] = layer;
|
|
16434
|
-
if (!popupOptions || !feature.properties)
|
|
16435
|
-
return;
|
|
16301
|
+
if (!popupOptions || !feature.properties) return;
|
|
16436
16302
|
let popupContent;
|
|
16437
16303
|
if (popupOptions.renderContent) {
|
|
16438
16304
|
popupContent = popupOptions.renderContent(feature);
|
|
@@ -16477,8 +16343,7 @@ var WfsLayer = ({
|
|
|
16477
16343
|
[]
|
|
16478
16344
|
);
|
|
16479
16345
|
const filteredGeoJson = (0, import_react56.useMemo)(() => {
|
|
16480
|
-
if (!geoJsonData)
|
|
16481
|
-
return null;
|
|
16346
|
+
if (!geoJsonData) return null;
|
|
16482
16347
|
if (useServerFiltering || !filterParams || Object.keys(filterParams).length === 0) {
|
|
16483
16348
|
return geoJsonData;
|
|
16484
16349
|
}
|
|
@@ -16715,15 +16580,14 @@ var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
|
16715
16580
|
var CanopyMap = () => {
|
|
16716
16581
|
var _a, _b, _c, _d, _e, _f;
|
|
16717
16582
|
const { data: mapSettings, isLoading: isSettingsLoading } = (0, import_useMapSettings4.default)();
|
|
16718
|
-
const mapRef = (0, import_react58.useRef)();
|
|
16583
|
+
const mapRef = (0, import_react58.useRef)(void 0);
|
|
16719
16584
|
const zoom = ((_b = (_a = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _a.Zoom) == null ? void 0 : _b.Value) || 5;
|
|
16720
16585
|
const center4 = [
|
|
16721
16586
|
((_d = (_c = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _c.Latitude) == null ? void 0 : _d.Text) || 48.2082,
|
|
16722
16587
|
((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
|
|
16723
16588
|
];
|
|
16724
16589
|
(0, import_core41.useRenderInfo)("BasicMap");
|
|
16725
|
-
if (isSettingsLoading)
|
|
16726
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_ui41.LoaderFull, { showInCenter: false });
|
|
16590
|
+
if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_ui41.LoaderFull, { showInCenter: false });
|
|
16727
16591
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_jsx_runtime74.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
16728
16592
|
import_react_leaflet27.MapContainer,
|
|
16729
16593
|
{
|
|
@@ -16847,7 +16711,7 @@ var BasfLeftPanel = () => {
|
|
|
16847
16711
|
[selectedItems]
|
|
16848
16712
|
);
|
|
16849
16713
|
const onSubmit = (0, import_react59.useCallback)(
|
|
16850
|
-
(data) => __async(
|
|
16714
|
+
(data) => __async(null, null, function* () {
|
|
16851
16715
|
setIsSubmitting(true);
|
|
16852
16716
|
try {
|
|
16853
16717
|
if (checkIfItemExists(data)) {
|
|
@@ -16953,8 +16817,7 @@ var WaybackTimelineMap = (props) => {
|
|
|
16953
16817
|
return null;
|
|
16954
16818
|
}
|
|
16955
16819
|
(0, import_react61.useEffect)(() => {
|
|
16956
|
-
if (props.mapping)
|
|
16957
|
-
setWAYBACK_SNAPSHOTS(props.mapping);
|
|
16820
|
+
if (props.mapping) setWAYBACK_SNAPSHOTS(props.mapping);
|
|
16958
16821
|
}, [props.mapping]);
|
|
16959
16822
|
const west = parseFloat(searchParams.get("xmin"));
|
|
16960
16823
|
const south = parseFloat(searchParams.get("ymin"));
|
|
@@ -17353,7 +17216,7 @@ var LayerItem2 = (0, import_react62.memo)(
|
|
|
17353
17216
|
}
|
|
17354
17217
|
);
|
|
17355
17218
|
LayerItem2.displayName = "LayerItem";
|
|
17356
|
-
var LayerSwitcher2 = (0, import_react62.memo)(({ mapMenuItems, customLayers }) => {
|
|
17219
|
+
var LayerSwitcher2 = (0, import_react62.memo)((({ mapMenuItems, customLayers }) => {
|
|
17357
17220
|
const store = useMapLayerStore2();
|
|
17358
17221
|
const [openHoverCardId, setOpenHoverCardId] = (0, import_react62.useState)(null);
|
|
17359
17222
|
(0, import_react62.useEffect)(() => {
|
|
@@ -17409,8 +17272,7 @@ var LayerSwitcher2 = (0, import_react62.memo)(({ mapMenuItems, customLayers }) =
|
|
|
17409
17272
|
) !== -1,
|
|
17410
17273
|
onToggle: () => {
|
|
17411
17274
|
handleToggle(layer);
|
|
17412
|
-
if (layer.ontoggle)
|
|
17413
|
-
layer.ontoggle();
|
|
17275
|
+
if (layer.ontoggle) layer.ontoggle();
|
|
17414
17276
|
},
|
|
17415
17277
|
openHoverCardId,
|
|
17416
17278
|
onInfoClick: handleInfoClick
|
|
@@ -17466,7 +17328,7 @@ var LayerSwitcher2 = (0, import_react62.memo)(({ mapMenuItems, customLayers }) =
|
|
|
17466
17328
|
] })
|
|
17467
17329
|
] }, menu.id);
|
|
17468
17330
|
}) });
|
|
17469
|
-
});
|
|
17331
|
+
}));
|
|
17470
17332
|
LayerSwitcher2.displayName = "LayerSwitcher";
|
|
17471
17333
|
|
|
17472
17334
|
// src/Components/Generic/Map/MapControlToolbar.tsx
|
|
@@ -17476,21 +17338,15 @@ var import_ui45 = require("@geowiki/ui");
|
|
|
17476
17338
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
17477
17339
|
function r(e) {
|
|
17478
17340
|
var t, f, n = "";
|
|
17479
|
-
if ("string" == typeof e || "number" == typeof e)
|
|
17480
|
-
|
|
17481
|
-
|
|
17482
|
-
|
|
17483
|
-
|
|
17484
|
-
for (t = 0; t < o; t++)
|
|
17485
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
17486
|
-
} else
|
|
17487
|
-
for (f in e)
|
|
17488
|
-
e[f] && (n && (n += " "), n += f);
|
|
17341
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
17342
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
17343
|
+
var o = e.length;
|
|
17344
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
17345
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
17489
17346
|
return n;
|
|
17490
17347
|
}
|
|
17491
17348
|
function clsx() {
|
|
17492
|
-
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++)
|
|
17493
|
-
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
17349
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
17494
17350
|
return n;
|
|
17495
17351
|
}
|
|
17496
17352
|
|
|
@@ -17871,7 +17727,7 @@ var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
|
|
|
17871
17727
|
var fractionRegex = /^\d+\/\d+$/;
|
|
17872
17728
|
var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
|
|
17873
17729
|
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
17874
|
-
var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))
|
|
17730
|
+
var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
|
|
17875
17731
|
var shadowRegex = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
17876
17732
|
function isLength(value) {
|
|
17877
17733
|
return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value) || isArbitraryLength(value);
|
|
@@ -17971,8 +17827,11 @@ function getDefaultConfig() {
|
|
|
17971
17827
|
var getOverflow = function getOverflow2() {
|
|
17972
17828
|
return ["auto", "hidden", "clip", "visible", "scroll"];
|
|
17973
17829
|
};
|
|
17974
|
-
var
|
|
17975
|
-
return ["auto", spacing];
|
|
17830
|
+
var getSpacingWithAutoAndArbitrary = function getSpacingWithAutoAndArbitrary2() {
|
|
17831
|
+
return ["auto", isArbitraryValue, spacing];
|
|
17832
|
+
};
|
|
17833
|
+
var getSpacingWithArbitrary = function getSpacingWithArbitrary2() {
|
|
17834
|
+
return [isArbitraryValue, spacing];
|
|
17976
17835
|
};
|
|
17977
17836
|
var getLengthWithEmpty = function getLengthWithEmpty2() {
|
|
17978
17837
|
return ["", isLength];
|
|
@@ -18009,29 +17868,29 @@ function getDefaultConfig() {
|
|
|
18009
17868
|
theme: {
|
|
18010
17869
|
colors: [isAny],
|
|
18011
17870
|
spacing: [isLength],
|
|
18012
|
-
blur: ["none", "", isTshirtSize,
|
|
17871
|
+
blur: ["none", "", isTshirtSize, isArbitraryValue],
|
|
18013
17872
|
brightness: getNumber(),
|
|
18014
17873
|
borderColor: [colors],
|
|
18015
|
-
borderRadius: ["none", "", "full", isTshirtSize,
|
|
18016
|
-
borderSpacing:
|
|
17874
|
+
borderRadius: ["none", "", "full", isTshirtSize, isArbitraryValue],
|
|
17875
|
+
borderSpacing: getSpacingWithArbitrary(),
|
|
18017
17876
|
borderWidth: getLengthWithEmpty(),
|
|
18018
17877
|
contrast: getNumber(),
|
|
18019
17878
|
grayscale: getZeroAndEmpty(),
|
|
18020
17879
|
hueRotate: getNumberAndArbitrary(),
|
|
18021
17880
|
invert: getZeroAndEmpty(),
|
|
18022
|
-
gap:
|
|
17881
|
+
gap: getSpacingWithArbitrary(),
|
|
18023
17882
|
gradientColorStops: [colors],
|
|
18024
17883
|
gradientColorStopPositions: [isPercent, isArbitraryLength],
|
|
18025
|
-
inset:
|
|
18026
|
-
margin:
|
|
17884
|
+
inset: getSpacingWithAutoAndArbitrary(),
|
|
17885
|
+
margin: getSpacingWithAutoAndArbitrary(),
|
|
18027
17886
|
opacity: getNumber(),
|
|
18028
|
-
padding:
|
|
17887
|
+
padding: getSpacingWithArbitrary(),
|
|
18029
17888
|
saturate: getNumber(),
|
|
18030
17889
|
scale: getNumber(),
|
|
18031
17890
|
sepia: getZeroAndEmpty(),
|
|
18032
17891
|
skew: getNumberAndArbitrary(),
|
|
18033
|
-
space:
|
|
18034
|
-
translate:
|
|
17892
|
+
space: getSpacingWithArbitrary(),
|
|
17893
|
+
translate: getSpacingWithArbitrary()
|
|
18035
17894
|
},
|
|
18036
17895
|
classGroups: {
|
|
18037
17896
|
// Layout
|
|
@@ -18255,7 +18114,7 @@ function getDefaultConfig() {
|
|
|
18255
18114
|
* @see https://tailwindcss.com/docs/flex-basis
|
|
18256
18115
|
*/
|
|
18257
18116
|
basis: [{
|
|
18258
|
-
basis:
|
|
18117
|
+
basis: getSpacingWithAutoAndArbitrary()
|
|
18259
18118
|
}],
|
|
18260
18119
|
/**
|
|
18261
18120
|
* Flex Direction
|
|
@@ -18312,7 +18171,7 @@ function getDefaultConfig() {
|
|
|
18312
18171
|
*/
|
|
18313
18172
|
"col-start-end": [{
|
|
18314
18173
|
col: ["auto", {
|
|
18315
|
-
span: [isInteger]
|
|
18174
|
+
span: ["full", isInteger]
|
|
18316
18175
|
}, isArbitraryValue]
|
|
18317
18176
|
}],
|
|
18318
18177
|
/**
|
|
@@ -18621,14 +18480,14 @@ function getDefaultConfig() {
|
|
|
18621
18480
|
* @see https://tailwindcss.com/docs/width
|
|
18622
18481
|
*/
|
|
18623
18482
|
w: [{
|
|
18624
|
-
w: ["auto", "min", "max", "fit", spacing]
|
|
18483
|
+
w: ["auto", "min", "max", "fit", isArbitraryValue, spacing]
|
|
18625
18484
|
}],
|
|
18626
18485
|
/**
|
|
18627
18486
|
* Min-Width
|
|
18628
18487
|
* @see https://tailwindcss.com/docs/min-width
|
|
18629
18488
|
*/
|
|
18630
18489
|
"min-w": [{
|
|
18631
|
-
"min-w": ["min", "max", "fit", isLength]
|
|
18490
|
+
"min-w": ["min", "max", "fit", isArbitraryValue, isLength]
|
|
18632
18491
|
}],
|
|
18633
18492
|
/**
|
|
18634
18493
|
* Max-Width
|
|
@@ -18637,28 +18496,28 @@ function getDefaultConfig() {
|
|
|
18637
18496
|
"max-w": [{
|
|
18638
18497
|
"max-w": ["0", "none", "full", "min", "max", "fit", "prose", {
|
|
18639
18498
|
screen: [isTshirtSize]
|
|
18640
|
-
}, isTshirtSize,
|
|
18499
|
+
}, isTshirtSize, isArbitraryValue]
|
|
18641
18500
|
}],
|
|
18642
18501
|
/**
|
|
18643
18502
|
* Height
|
|
18644
18503
|
* @see https://tailwindcss.com/docs/height
|
|
18645
18504
|
*/
|
|
18646
18505
|
h: [{
|
|
18647
|
-
h: [spacing, "auto", "min", "max", "fit"]
|
|
18506
|
+
h: [isArbitraryValue, spacing, "auto", "min", "max", "fit"]
|
|
18648
18507
|
}],
|
|
18649
18508
|
/**
|
|
18650
18509
|
* Min-Height
|
|
18651
18510
|
* @see https://tailwindcss.com/docs/min-height
|
|
18652
18511
|
*/
|
|
18653
18512
|
"min-h": [{
|
|
18654
|
-
"min-h": ["min", "max", "fit", isLength]
|
|
18513
|
+
"min-h": ["min", "max", "fit", isArbitraryValue, isLength]
|
|
18655
18514
|
}],
|
|
18656
18515
|
/**
|
|
18657
18516
|
* Max-Height
|
|
18658
18517
|
* @see https://tailwindcss.com/docs/max-height
|
|
18659
18518
|
*/
|
|
18660
18519
|
"max-h": [{
|
|
18661
|
-
"max-h": [spacing, "min", "max", "fit"]
|
|
18520
|
+
"max-h": [isArbitraryValue, spacing, "min", "max", "fit"]
|
|
18662
18521
|
}],
|
|
18663
18522
|
// Typography
|
|
18664
18523
|
/**
|
|
@@ -18727,7 +18586,7 @@ function getDefaultConfig() {
|
|
|
18727
18586
|
* @see https://tailwindcss.com/docs/letter-spacing
|
|
18728
18587
|
*/
|
|
18729
18588
|
tracking: [{
|
|
18730
|
-
tracking: ["tighter", "tight", "normal", "wide", "wider", "widest",
|
|
18589
|
+
tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", isArbitraryValue]
|
|
18731
18590
|
}],
|
|
18732
18591
|
/**
|
|
18733
18592
|
* Line Clamp
|
|
@@ -18741,7 +18600,7 @@ function getDefaultConfig() {
|
|
|
18741
18600
|
* @see https://tailwindcss.com/docs/line-height
|
|
18742
18601
|
*/
|
|
18743
18602
|
leading: [{
|
|
18744
|
-
leading: ["none", "tight", "snug", "normal", "relaxed", "loose", isLength]
|
|
18603
|
+
leading: ["none", "tight", "snug", "normal", "relaxed", "loose", isArbitraryValue, isLength]
|
|
18745
18604
|
}],
|
|
18746
18605
|
/**
|
|
18747
18606
|
* List Style Image
|
|
@@ -18824,7 +18683,7 @@ function getDefaultConfig() {
|
|
|
18824
18683
|
* @see https://tailwindcss.com/docs/text-underline-offset
|
|
18825
18684
|
*/
|
|
18826
18685
|
"underline-offset": [{
|
|
18827
|
-
"underline-offset": ["auto", isLength]
|
|
18686
|
+
"underline-offset": ["auto", isArbitraryValue, isLength]
|
|
18828
18687
|
}],
|
|
18829
18688
|
/**
|
|
18830
18689
|
* Text Decoration Color
|
|
@@ -18848,14 +18707,14 @@ function getDefaultConfig() {
|
|
|
18848
18707
|
* @see https://tailwindcss.com/docs/text-indent
|
|
18849
18708
|
*/
|
|
18850
18709
|
indent: [{
|
|
18851
|
-
indent:
|
|
18710
|
+
indent: getSpacingWithArbitrary()
|
|
18852
18711
|
}],
|
|
18853
18712
|
/**
|
|
18854
18713
|
* Vertical Alignment
|
|
18855
18714
|
* @see https://tailwindcss.com/docs/vertical-align
|
|
18856
18715
|
*/
|
|
18857
18716
|
"vertical-align": [{
|
|
18858
|
-
align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super",
|
|
18717
|
+
align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryValue]
|
|
18859
18718
|
}],
|
|
18860
18719
|
/**
|
|
18861
18720
|
* Whitespace
|
|
@@ -19285,7 +19144,7 @@ function getDefaultConfig() {
|
|
|
19285
19144
|
* @see https://tailwindcss.com/docs/outline-offset
|
|
19286
19145
|
*/
|
|
19287
19146
|
"outline-offset": [{
|
|
19288
|
-
"outline-offset": [isLength]
|
|
19147
|
+
"outline-offset": [isArbitraryValue, isLength]
|
|
19289
19148
|
}],
|
|
19290
19149
|
/**
|
|
19291
19150
|
* Outline Width
|
|
@@ -19364,7 +19223,7 @@ function getDefaultConfig() {
|
|
|
19364
19223
|
opacity: [opacity]
|
|
19365
19224
|
}],
|
|
19366
19225
|
/**
|
|
19367
|
-
* Mix
|
|
19226
|
+
* Mix Blend Mode
|
|
19368
19227
|
* @see https://tailwindcss.com/docs/mix-blend-mode
|
|
19369
19228
|
*/
|
|
19370
19229
|
"mix-blend": [{
|
|
@@ -19723,126 +19582,126 @@ function getDefaultConfig() {
|
|
|
19723
19582
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19724
19583
|
*/
|
|
19725
19584
|
"scroll-m": [{
|
|
19726
|
-
"scroll-m":
|
|
19585
|
+
"scroll-m": getSpacingWithArbitrary()
|
|
19727
19586
|
}],
|
|
19728
19587
|
/**
|
|
19729
19588
|
* Scroll Margin X
|
|
19730
19589
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19731
19590
|
*/
|
|
19732
19591
|
"scroll-mx": [{
|
|
19733
|
-
"scroll-mx":
|
|
19592
|
+
"scroll-mx": getSpacingWithArbitrary()
|
|
19734
19593
|
}],
|
|
19735
19594
|
/**
|
|
19736
19595
|
* Scroll Margin Y
|
|
19737
19596
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19738
19597
|
*/
|
|
19739
19598
|
"scroll-my": [{
|
|
19740
|
-
"scroll-my":
|
|
19599
|
+
"scroll-my": getSpacingWithArbitrary()
|
|
19741
19600
|
}],
|
|
19742
19601
|
/**
|
|
19743
19602
|
* Scroll Margin Start
|
|
19744
19603
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19745
19604
|
*/
|
|
19746
19605
|
"scroll-ms": [{
|
|
19747
|
-
"scroll-ms":
|
|
19606
|
+
"scroll-ms": getSpacingWithArbitrary()
|
|
19748
19607
|
}],
|
|
19749
19608
|
/**
|
|
19750
19609
|
* Scroll Margin End
|
|
19751
19610
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19752
19611
|
*/
|
|
19753
19612
|
"scroll-me": [{
|
|
19754
|
-
"scroll-me":
|
|
19613
|
+
"scroll-me": getSpacingWithArbitrary()
|
|
19755
19614
|
}],
|
|
19756
19615
|
/**
|
|
19757
19616
|
* Scroll Margin Top
|
|
19758
19617
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19759
19618
|
*/
|
|
19760
19619
|
"scroll-mt": [{
|
|
19761
|
-
"scroll-mt":
|
|
19620
|
+
"scroll-mt": getSpacingWithArbitrary()
|
|
19762
19621
|
}],
|
|
19763
19622
|
/**
|
|
19764
19623
|
* Scroll Margin Right
|
|
19765
19624
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19766
19625
|
*/
|
|
19767
19626
|
"scroll-mr": [{
|
|
19768
|
-
"scroll-mr":
|
|
19627
|
+
"scroll-mr": getSpacingWithArbitrary()
|
|
19769
19628
|
}],
|
|
19770
19629
|
/**
|
|
19771
19630
|
* Scroll Margin Bottom
|
|
19772
19631
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19773
19632
|
*/
|
|
19774
19633
|
"scroll-mb": [{
|
|
19775
|
-
"scroll-mb":
|
|
19634
|
+
"scroll-mb": getSpacingWithArbitrary()
|
|
19776
19635
|
}],
|
|
19777
19636
|
/**
|
|
19778
19637
|
* Scroll Margin Left
|
|
19779
19638
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19780
19639
|
*/
|
|
19781
19640
|
"scroll-ml": [{
|
|
19782
|
-
"scroll-ml":
|
|
19641
|
+
"scroll-ml": getSpacingWithArbitrary()
|
|
19783
19642
|
}],
|
|
19784
19643
|
/**
|
|
19785
19644
|
* Scroll Padding
|
|
19786
19645
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19787
19646
|
*/
|
|
19788
19647
|
"scroll-p": [{
|
|
19789
|
-
"scroll-p":
|
|
19648
|
+
"scroll-p": getSpacingWithArbitrary()
|
|
19790
19649
|
}],
|
|
19791
19650
|
/**
|
|
19792
19651
|
* Scroll Padding X
|
|
19793
19652
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19794
19653
|
*/
|
|
19795
19654
|
"scroll-px": [{
|
|
19796
|
-
"scroll-px":
|
|
19655
|
+
"scroll-px": getSpacingWithArbitrary()
|
|
19797
19656
|
}],
|
|
19798
19657
|
/**
|
|
19799
19658
|
* Scroll Padding Y
|
|
19800
19659
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19801
19660
|
*/
|
|
19802
19661
|
"scroll-py": [{
|
|
19803
|
-
"scroll-py":
|
|
19662
|
+
"scroll-py": getSpacingWithArbitrary()
|
|
19804
19663
|
}],
|
|
19805
19664
|
/**
|
|
19806
19665
|
* Scroll Padding Start
|
|
19807
19666
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19808
19667
|
*/
|
|
19809
19668
|
"scroll-ps": [{
|
|
19810
|
-
"scroll-ps":
|
|
19669
|
+
"scroll-ps": getSpacingWithArbitrary()
|
|
19811
19670
|
}],
|
|
19812
19671
|
/**
|
|
19813
19672
|
* Scroll Padding End
|
|
19814
19673
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19815
19674
|
*/
|
|
19816
19675
|
"scroll-pe": [{
|
|
19817
|
-
"scroll-pe":
|
|
19676
|
+
"scroll-pe": getSpacingWithArbitrary()
|
|
19818
19677
|
}],
|
|
19819
19678
|
/**
|
|
19820
19679
|
* Scroll Padding Top
|
|
19821
19680
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19822
19681
|
*/
|
|
19823
19682
|
"scroll-pt": [{
|
|
19824
|
-
"scroll-pt":
|
|
19683
|
+
"scroll-pt": getSpacingWithArbitrary()
|
|
19825
19684
|
}],
|
|
19826
19685
|
/**
|
|
19827
19686
|
* Scroll Padding Right
|
|
19828
19687
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19829
19688
|
*/
|
|
19830
19689
|
"scroll-pr": [{
|
|
19831
|
-
"scroll-pr":
|
|
19690
|
+
"scroll-pr": getSpacingWithArbitrary()
|
|
19832
19691
|
}],
|
|
19833
19692
|
/**
|
|
19834
19693
|
* Scroll Padding Bottom
|
|
19835
19694
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19836
19695
|
*/
|
|
19837
19696
|
"scroll-pb": [{
|
|
19838
|
-
"scroll-pb":
|
|
19697
|
+
"scroll-pb": getSpacingWithArbitrary()
|
|
19839
19698
|
}],
|
|
19840
19699
|
/**
|
|
19841
19700
|
* Scroll Padding Left
|
|
19842
19701
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19843
19702
|
*/
|
|
19844
19703
|
"scroll-pl": [{
|
|
19845
|
-
"scroll-pl":
|
|
19704
|
+
"scroll-pl": getSpacingWithArbitrary()
|
|
19846
19705
|
}],
|
|
19847
19706
|
/**
|
|
19848
19707
|
* Scroll Snap Align
|
|
@@ -20105,8 +19964,7 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20105
19964
|
const map = mapRef.current;
|
|
20106
19965
|
const changeMapProjection = () => {
|
|
20107
19966
|
var _a;
|
|
20108
|
-
if (!mapRef.current)
|
|
20109
|
-
return;
|
|
19967
|
+
if (!mapRef.current) return;
|
|
20110
19968
|
const map2 = mapRef.current;
|
|
20111
19969
|
const currentProjection = (_a = map2.getProjection()) == null ? void 0 : _a.type;
|
|
20112
19970
|
const newProjection = currentProjection === "mercator" ? "globe" : "mercator";
|
|
@@ -20115,28 +19973,24 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20115
19973
|
});
|
|
20116
19974
|
};
|
|
20117
19975
|
const zoomIn = () => {
|
|
20118
|
-
if (!mapRef.current)
|
|
20119
|
-
return;
|
|
19976
|
+
if (!mapRef.current) return;
|
|
20120
19977
|
const map2 = mapRef.current;
|
|
20121
19978
|
map2.zoomIn();
|
|
20122
19979
|
return map2.getBounds();
|
|
20123
19980
|
};
|
|
20124
19981
|
const zoomOut = () => {
|
|
20125
|
-
if (!mapRef.current)
|
|
20126
|
-
return;
|
|
19982
|
+
if (!mapRef.current) return;
|
|
20127
19983
|
const map2 = mapRef.current;
|
|
20128
19984
|
map2.zoomOut();
|
|
20129
19985
|
return map2.getBounds();
|
|
20130
19986
|
};
|
|
20131
19987
|
function getLayersByPattern(pattern) {
|
|
20132
|
-
if (!mapRef.current)
|
|
20133
|
-
return;
|
|
19988
|
+
if (!mapRef.current) return;
|
|
20134
19989
|
const map2 = mapRef.current;
|
|
20135
19990
|
return map2 == null ? void 0 : map2.getStyle().layers.filter((layer) => pattern.test(layer.id)).map((layer) => layer.id);
|
|
20136
19991
|
}
|
|
20137
19992
|
const handleToggle = (layerId) => {
|
|
20138
|
-
if (!mapRef.current)
|
|
20139
|
-
return;
|
|
19993
|
+
if (!mapRef.current) return;
|
|
20140
19994
|
const map2 = mapRef.current;
|
|
20141
19995
|
const layers = getLayersByPattern(new RegExp(layerId));
|
|
20142
19996
|
layers == null ? void 0 : layers.forEach((id) => {
|
|
@@ -20264,7 +20118,7 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20264
20118
|
return control;
|
|
20265
20119
|
}));
|
|
20266
20120
|
};
|
|
20267
|
-
const loadSvgImage = (color) => __async(
|
|
20121
|
+
const loadSvgImage = (color) => __async(null, null, function* () {
|
|
20268
20122
|
let svgText = (0, import_server8.renderToStaticMarkup)(
|
|
20269
20123
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_MapPinIcon4.default, { className: "w-6 h-6" })
|
|
20270
20124
|
);
|
|
@@ -20276,17 +20130,15 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20276
20130
|
yield img.decode();
|
|
20277
20131
|
return img;
|
|
20278
20132
|
});
|
|
20279
|
-
const updatePinImage = (source) => __async(
|
|
20133
|
+
const updatePinImage = (source) => __async(null, null, function* () {
|
|
20280
20134
|
const img = yield loadSvgImage(source.style.pin_color);
|
|
20281
20135
|
const imgName = `${source.name}-pin`;
|
|
20282
|
-
if (map == null ? void 0 : map.hasImage(imgName))
|
|
20283
|
-
map == null ? void 0 : map.removeImage(imgName);
|
|
20136
|
+
if (map == null ? void 0 : map.hasImage(imgName)) map == null ? void 0 : map.removeImage(imgName);
|
|
20284
20137
|
map == null ? void 0 : map.addImage(imgName, img);
|
|
20285
20138
|
});
|
|
20286
20139
|
const updateClusterColors = (source) => {
|
|
20287
20140
|
const layerId = `${source.name}-cluster-circles`;
|
|
20288
|
-
if (!(map == null ? void 0 : map.getLayer(layerId)))
|
|
20289
|
-
return;
|
|
20141
|
+
if (!(map == null ? void 0 : map.getLayer(layerId))) return;
|
|
20290
20142
|
const current = map == null ? void 0 : map.getPaintProperty(layerId, "circle-color");
|
|
20291
20143
|
if (current !== source.style.cluster_color) {
|
|
20292
20144
|
map == null ? void 0 : map.setPaintProperty(layerId, "circle-color", source.style.cluster_color);
|
|
@@ -20331,9 +20183,8 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20331
20183
|
}
|
|
20332
20184
|
};
|
|
20333
20185
|
const loadSourceData = () => {
|
|
20334
|
-
if ((sourceData == null ? void 0 : sourceData.length) == 0)
|
|
20335
|
-
|
|
20336
|
-
sourceData == null ? void 0 : sourceData.forEach((source) => __async(void 0, null, function* () {
|
|
20186
|
+
if ((sourceData == null ? void 0 : sourceData.length) == 0) return;
|
|
20187
|
+
sourceData == null ? void 0 : sourceData.forEach((source) => __async(null, null, function* () {
|
|
20337
20188
|
const existing_data = map == null ? void 0 : map.getSource(source.name);
|
|
20338
20189
|
if (!existing_data) {
|
|
20339
20190
|
if (source.is_cluster) {
|
|
@@ -20457,12 +20308,9 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20457
20308
|
}));
|
|
20458
20309
|
};
|
|
20459
20310
|
(0, import_react66.useEffect)(() => {
|
|
20460
|
-
if (typeof mapContainer === "function")
|
|
20461
|
-
|
|
20462
|
-
if (!
|
|
20463
|
-
return;
|
|
20464
|
-
if (!sourceData)
|
|
20465
|
-
return;
|
|
20311
|
+
if (typeof mapContainer === "function") return;
|
|
20312
|
+
if (!(mapContainer == null ? void 0 : mapContainer.current)) return;
|
|
20313
|
+
if (!sourceData) return;
|
|
20466
20314
|
const map2 = new import_maplibre_gl.default.Map({
|
|
20467
20315
|
container: mapContainer == null ? void 0 : mapContainer.current,
|
|
20468
20316
|
style: {
|
|
@@ -20495,7 +20343,7 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20495
20343
|
map2.scrollZoom.disable();
|
|
20496
20344
|
mapRef.current.getContainer().addEventListener("mouseenter", () => map2.scrollZoom.enable());
|
|
20497
20345
|
mapRef.current.getContainer().addEventListener("mouseleave", () => map2.scrollZoom.disable());
|
|
20498
|
-
map2.on("load", () => __async(
|
|
20346
|
+
map2.on("load", () => __async(null, null, function* () {
|
|
20499
20347
|
changeMapProjection();
|
|
20500
20348
|
}));
|
|
20501
20349
|
return () => {
|
|
@@ -20504,8 +20352,7 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20504
20352
|
};
|
|
20505
20353
|
}, []);
|
|
20506
20354
|
(0, import_react66.useEffect)(() => {
|
|
20507
|
-
if (!map)
|
|
20508
|
-
return;
|
|
20355
|
+
if (!map) return;
|
|
20509
20356
|
const init = () => {
|
|
20510
20357
|
loadBaseLayers();
|
|
20511
20358
|
};
|
|
@@ -20520,16 +20367,14 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20520
20367
|
if (map.isStyleLoaded()) {
|
|
20521
20368
|
init();
|
|
20522
20369
|
map.on("zoomend", zoom);
|
|
20523
|
-
} else
|
|
20524
|
-
|
|
20525
|
-
|
|
20526
|
-
|
|
20527
|
-
});
|
|
20370
|
+
} else map.once("load", () => {
|
|
20371
|
+
init();
|
|
20372
|
+
map.on("zoomend", zoom);
|
|
20373
|
+
});
|
|
20528
20374
|
}, [map]);
|
|
20529
20375
|
(0, import_react66.useEffect)(() => {
|
|
20530
20376
|
var _a, _b, _c;
|
|
20531
|
-
if (!map || !sourceData)
|
|
20532
|
-
return;
|
|
20377
|
+
if (!map || !sourceData) return;
|
|
20533
20378
|
if (map.isStyleLoaded()) {
|
|
20534
20379
|
loadSourceData();
|
|
20535
20380
|
return;
|
|
@@ -20569,16 +20414,13 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20569
20414
|
};
|
|
20570
20415
|
}, [sourceData]);
|
|
20571
20416
|
(0, import_react66.useEffect)(() => {
|
|
20572
|
-
if (!map || !sourceData)
|
|
20573
|
-
return;
|
|
20417
|
+
if (!map || !sourceData) return;
|
|
20574
20418
|
sourceData.forEach((source) => {
|
|
20575
20419
|
const source_layer = map.getSource(source.name);
|
|
20576
|
-
if (source_layer)
|
|
20577
|
-
source_layer.setData(source.data);
|
|
20420
|
+
if (source_layer) source_layer.setData(source.data);
|
|
20578
20421
|
});
|
|
20579
20422
|
}, [sourceData]);
|
|
20580
|
-
if (!sourceData)
|
|
20581
|
-
return;
|
|
20423
|
+
if (!sourceData) return;
|
|
20582
20424
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "relative", style: { width: "100%", height: "100%" }, children: [
|
|
20583
20425
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { ref: mapContainer, className: "w-full h-full" }),
|
|
20584
20426
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MapControlToolbar, { controls: mapControl, onToggleControl: (id) => toggleControl(id) })
|