@geowiki/map 0.16.0-dev.0 → 0.16.0-dev.1
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/index.js +357 -219
- package/dist/index.mjs +354 -216
- package/dist/styles.css +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -138,7 +138,8 @@ var init_GenericCache = __esm({
|
|
|
138
138
|
getFromStorage(key) {
|
|
139
139
|
try {
|
|
140
140
|
const stored = localStorage.getItem(key);
|
|
141
|
-
if (!stored)
|
|
141
|
+
if (!stored)
|
|
142
|
+
return null;
|
|
142
143
|
const entry = JSON.parse(stored);
|
|
143
144
|
if (this.isValid(entry)) {
|
|
144
145
|
this.hitCount++;
|
|
@@ -556,7 +557,7 @@ var prepareRGBImage = (array, width, height) => {
|
|
|
556
557
|
ctx == null ? void 0 : ctx.putImageData(imageData, 0, 0);
|
|
557
558
|
return canvas;
|
|
558
559
|
};
|
|
559
|
-
var getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvasContext, selectedBand) => __async(
|
|
560
|
+
var getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvasContext, selectedBand) => __async(void 0, null, function* () {
|
|
560
561
|
var _a, _b;
|
|
561
562
|
try {
|
|
562
563
|
var tiffWidth = rasterItem.width;
|
|
@@ -572,7 +573,8 @@ var getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvas
|
|
|
572
573
|
var rgb = null;
|
|
573
574
|
if (((_a = rasterItem.name) == null ? void 0 : _a.toLowerCase().includes("ndvi")) && ((_b = rasterItem.name) == null ? void 0 : _b.toLowerCase().includes("perc")))
|
|
574
575
|
rgb = yield getNDVIValueForPixel(ndviImageCanvasContext, xTiff, yTiff);
|
|
575
|
-
else
|
|
576
|
+
else
|
|
577
|
+
rgb = null;
|
|
576
578
|
return [
|
|
577
579
|
selectedValue,
|
|
578
580
|
rgb !== null && rgb !== void 0 ? {
|
|
@@ -615,11 +617,12 @@ var deepCloneRasterAssetItem = (isAnnualAnnotation, asset, assetBuffer, uri, sel
|
|
|
615
617
|
rasterItem.buffer = [...asset.buffer];
|
|
616
618
|
rasterItem.uri = [...asset.uri];
|
|
617
619
|
rasterItem.buffer[selectedBand] = new Uint32Array(assetBuffer);
|
|
618
|
-
if (Array.isArray(rasterItem.uri))
|
|
620
|
+
if (Array.isArray(rasterItem.uri))
|
|
621
|
+
rasterItem.uri[selectedBand] = uri;
|
|
619
622
|
}
|
|
620
623
|
return rasterItem;
|
|
621
624
|
};
|
|
622
|
-
var getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnnotation, selectedBand, metadata) => __async(
|
|
625
|
+
var getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnnotation, selectedBand, metadata) => __async(void 0, null, function* () {
|
|
623
626
|
var { newArray, canvas } = yield getEmptyPreviewRasterItemForInsert(
|
|
624
627
|
length,
|
|
625
628
|
width,
|
|
@@ -644,12 +647,12 @@ var getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnno
|
|
|
644
647
|
}
|
|
645
648
|
return rasterItem;
|
|
646
649
|
});
|
|
647
|
-
var getEmptyPreviewRasterItemForInsert = (length, width, height, labels) => __async(
|
|
650
|
+
var getEmptyPreviewRasterItemForInsert = (length, width, height, labels) => __async(void 0, null, function* () {
|
|
648
651
|
const newArray = new Uint32Array(length).fill(0);
|
|
649
652
|
const canvas = grayScaleArrayToCanvas(newArray, width, height, labels);
|
|
650
653
|
return { newArray, canvas };
|
|
651
654
|
});
|
|
652
|
-
var updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnnotation) => __async(
|
|
655
|
+
var updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnnotation) => __async(void 0, null, function* () {
|
|
653
656
|
var _a, _b, _c;
|
|
654
657
|
if (!fromRasterItem) {
|
|
655
658
|
return toPreviewRasterItem;
|
|
@@ -675,7 +678,7 @@ var updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnno
|
|
|
675
678
|
}
|
|
676
679
|
return toPreviewRasterItem;
|
|
677
680
|
});
|
|
678
|
-
var getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(
|
|
681
|
+
var getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(void 0, null, function* () {
|
|
679
682
|
const tiff = yield fromArrayBuffer(arrayBuffer);
|
|
680
683
|
const image = yield tiff.getImage();
|
|
681
684
|
const pool = new Pool();
|
|
@@ -699,7 +702,7 @@ var getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(null, null, func
|
|
|
699
702
|
pool.destroy();
|
|
700
703
|
return { width, height, rasterItems };
|
|
701
704
|
});
|
|
702
|
-
var getRasterItems = (arrayBuffer, projectType) => __async(
|
|
705
|
+
var getRasterItems = (arrayBuffer, projectType) => __async(void 0, null, function* () {
|
|
703
706
|
const tiff = yield fromArrayBuffer(arrayBuffer);
|
|
704
707
|
const image = yield tiff.getImage();
|
|
705
708
|
const pool = new Pool();
|
|
@@ -739,7 +742,7 @@ var getRasterItems = (arrayBuffer, projectType) => __async(null, null, function*
|
|
|
739
742
|
pool.destroy();
|
|
740
743
|
return { rasters, width, height, rasterItems };
|
|
741
744
|
});
|
|
742
|
-
var getAssetItemsForLocationAssets = (assets, labels) => __async(
|
|
745
|
+
var getAssetItemsForLocationAssets = (assets, labels) => __async(void 0, null, function* () {
|
|
743
746
|
var rasterItems = [];
|
|
744
747
|
for (var i = 0; i < (assets == null ? void 0 : assets.length); i++) {
|
|
745
748
|
const item = assets[i];
|
|
@@ -762,7 +765,7 @@ var getAssetItemsForLocationAssets = (assets, labels) => __async(null, null, fun
|
|
|
762
765
|
}
|
|
763
766
|
return rasterItems;
|
|
764
767
|
});
|
|
765
|
-
var getRasterAssetItemsForLocationComposite = (assets) => __async(
|
|
768
|
+
var getRasterAssetItemsForLocationComposite = (assets) => __async(void 0, null, function* () {
|
|
766
769
|
var rasterItems = [];
|
|
767
770
|
for (var i = 0; i < (assets == null ? void 0 : assets.length); i++) {
|
|
768
771
|
const item = assets[i];
|
|
@@ -783,7 +786,7 @@ var getRasterAssetItemsForLocationComposite = (assets) => __async(null, null, fu
|
|
|
783
786
|
}
|
|
784
787
|
return rasterItems;
|
|
785
788
|
});
|
|
786
|
-
var copyAllRasterSegments = (rasterItem, previewRasterItem, selectedValue, labelValue, labels) => __async(
|
|
789
|
+
var copyAllRasterSegments = (rasterItem, previewRasterItem, selectedValue, labelValue, labels) => __async(void 0, null, function* () {
|
|
787
790
|
var newBuffer = overwriteArrayBufferWithSelectedValue(
|
|
788
791
|
rasterItem.buffer,
|
|
789
792
|
previewRasterItem.buffer,
|
|
@@ -859,7 +862,8 @@ function getAdjPixel(y, x, selectedValue, array2dMatrix) {
|
|
|
859
862
|
while (pixelsToCheck.length > 0) {
|
|
860
863
|
const [xTiff, yTiff] = pixelsToCheck.pop();
|
|
861
864
|
var key = xTiff + "_" + yTiff;
|
|
862
|
-
if (checkedPixels.has(key))
|
|
865
|
+
if (checkedPixels.has(key))
|
|
866
|
+
continue;
|
|
863
867
|
checkedPixels.add(key);
|
|
864
868
|
if (array2dMatrix[yTiff][xTiff] === selectedValue) {
|
|
865
869
|
sameValPixels.push([yTiff, xTiff]);
|
|
@@ -881,7 +885,7 @@ function getAdjPixel(y, x, selectedValue, array2dMatrix) {
|
|
|
881
885
|
}
|
|
882
886
|
return sameValPixels;
|
|
883
887
|
}
|
|
884
|
-
var paintRasterSegment = (sourceRasterItem, destRasterItem, locations, bounds, labelValue, labels, paintType, selectedBand, isAnnualAnnotation) => __async(
|
|
888
|
+
var paintRasterSegment = (sourceRasterItem, destRasterItem, locations, bounds, labelValue, labels, paintType, selectedBand, isAnnualAnnotation) => __async(void 0, null, function* () {
|
|
885
889
|
var tiffWidth = sourceRasterItem.width;
|
|
886
890
|
var tiffHeight = sourceRasterItem.height;
|
|
887
891
|
var annotatedRaster = isAnnualAnnotation ? destRasterItem.buffer : destRasterItem.buffer[selectedBand];
|
|
@@ -1004,7 +1008,8 @@ function pointInsidePolygon(xTiff, yTiff, vs) {
|
|
|
1004
1008
|
var xi = vs[i].xTiff, yi = vs[i].yTiff;
|
|
1005
1009
|
var xj = vs[j].xTiff, yj = vs[j].yTiff;
|
|
1006
1010
|
var intersect = yi > yTiff !== yj > yTiff && xTiff < (xj - xi) * (yTiff - yi) / (yj - yi) + xi;
|
|
1007
|
-
if (intersect)
|
|
1011
|
+
if (intersect)
|
|
1012
|
+
inside = !inside;
|
|
1008
1013
|
}
|
|
1009
1014
|
return inside;
|
|
1010
1015
|
}
|
|
@@ -1043,7 +1048,7 @@ function getDiagonalCoordinates(x1, y1, x2, y2) {
|
|
|
1043
1048
|
coordinates.push({ yTiff: x2, xTiff: y2 });
|
|
1044
1049
|
return coordinates;
|
|
1045
1050
|
}
|
|
1046
|
-
var getActiveLearningAnnotation = (assetHref, projectType) => __async(
|
|
1051
|
+
var getActiveLearningAnnotation = (assetHref, projectType) => __async(void 0, null, function* () {
|
|
1047
1052
|
const res = yield fetch(assetHref);
|
|
1048
1053
|
const buffer = yield res.arrayBuffer();
|
|
1049
1054
|
const rItems = yield getRasterItems(buffer, projectType);
|
|
@@ -1060,7 +1065,7 @@ var getActiveLearningAnnotation = (assetHref, projectType) => __async(null, null
|
|
|
1060
1065
|
};
|
|
1061
1066
|
return assetItem;
|
|
1062
1067
|
});
|
|
1063
|
-
var createImageDataForNDVI = (asset) => __async(
|
|
1068
|
+
var createImageDataForNDVI = (asset) => __async(void 0, null, function* () {
|
|
1064
1069
|
var canvas = document.createElement("canvas");
|
|
1065
1070
|
var context = canvas.getContext("2d");
|
|
1066
1071
|
var image = new Image();
|
|
@@ -1070,7 +1075,7 @@ var createImageDataForNDVI = (asset) => __async(null, null, function* () {
|
|
|
1070
1075
|
context == null ? void 0 : context.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
1071
1076
|
return context;
|
|
1072
1077
|
});
|
|
1073
|
-
var getNDVIValueForPixel = (ndviImageCanvasContext, x, y) => __async(
|
|
1078
|
+
var getNDVIValueForPixel = (ndviImageCanvasContext, x, y) => __async(void 0, null, function* () {
|
|
1074
1079
|
var context = ndviImageCanvasContext;
|
|
1075
1080
|
var data = context == null ? void 0 : context.getImageData(x, y, 1, 1).data;
|
|
1076
1081
|
return data;
|
|
@@ -1297,7 +1302,8 @@ function getRasterAssetItemsForLocationAssets(assets) {
|
|
|
1297
1302
|
if (Array.isArray((_a = rItem.result) == null ? void 0 : _a.base64)) {
|
|
1298
1303
|
bufferData = (_b = rItem.result) == null ? void 0 : _b.base64.map((x) => {
|
|
1299
1304
|
var _a2, _b2;
|
|
1300
|
-
if (((_a2 = rItem.result) == null ? void 0 : _a2.arrayType) == "uint8")
|
|
1305
|
+
if (((_a2 = rItem.result) == null ? void 0 : _a2.arrayType) == "uint8")
|
|
1306
|
+
return Buffer.from(x, "base64");
|
|
1301
1307
|
else if (((_b2 = rItem.result) == null ? void 0 : _b2.arrayType) == "uint32") {
|
|
1302
1308
|
const buffer2 = Buffer.from(x, "base64");
|
|
1303
1309
|
return new Uint32Array(
|
|
@@ -1378,14 +1384,16 @@ function ClearAnnotation(annotatedRasterAsset, isAnnualAnnotation, selectedBand,
|
|
|
1378
1384
|
selectedBand,
|
|
1379
1385
|
annotationRasterAsset.metadata
|
|
1380
1386
|
);
|
|
1381
|
-
if (isAnnualAnnotation)
|
|
1387
|
+
if (isAnnualAnnotation)
|
|
1388
|
+
return { annotationRaster, pastValues };
|
|
1382
1389
|
else {
|
|
1383
1390
|
var multiBandAnnotation = annotatedRasterAsset;
|
|
1384
1391
|
if (multiBandAnnotation == null ? void 0 : multiBandAnnotation.buffer[selectedBand]) {
|
|
1385
1392
|
multiBandAnnotation.buffer[selectedBand] = annotationRaster.buffer[selectedBand];
|
|
1386
1393
|
multiBandAnnotation.uri[selectedBand] = annotationRaster.uri[selectedBand];
|
|
1387
1394
|
return { multiBandAnnotation, undefined: void 0 };
|
|
1388
|
-
} else
|
|
1395
|
+
} else
|
|
1396
|
+
return { annotatedRasterAsset: void 0, undefined: void 0 };
|
|
1389
1397
|
}
|
|
1390
1398
|
});
|
|
1391
1399
|
}
|
|
@@ -1419,7 +1427,8 @@ function createTask(locationId, projectId, referenceDate) {
|
|
|
1419
1427
|
currentTask: res.task,
|
|
1420
1428
|
annotation_dates: yield getAnnotationDates(res == null ? void 0 : res.task)
|
|
1421
1429
|
};
|
|
1422
|
-
} else
|
|
1430
|
+
} else
|
|
1431
|
+
return { location: null, currentTask: null, annotation_dates: null };
|
|
1423
1432
|
});
|
|
1424
1433
|
}
|
|
1425
1434
|
function getTask(taskId) {
|
|
@@ -1447,7 +1456,8 @@ function getTask(taskId) {
|
|
|
1447
1456
|
annotation_dates: yield getAnnotationDates(res == null ? void 0 : res.task),
|
|
1448
1457
|
location: locData
|
|
1449
1458
|
};
|
|
1450
|
-
} else
|
|
1459
|
+
} else
|
|
1460
|
+
return { currentTask: null, annotation_dates: null, location: null };
|
|
1451
1461
|
});
|
|
1452
1462
|
}
|
|
1453
1463
|
function getActiveLearningAnnotationAsset(assetHref, labels, projectDetail) {
|
|
@@ -1499,7 +1509,8 @@ function insertEmptyBufferForSingleBand(length, width, height, selectedBand, ann
|
|
|
1499
1509
|
annotatedAsset.buffer[selectedBand] = newArray;
|
|
1500
1510
|
annotatedAsset.uri[selectedBand] = canvas.toDataURL();
|
|
1501
1511
|
return annotatedAsset;
|
|
1502
|
-
} else
|
|
1512
|
+
} else
|
|
1513
|
+
return null;
|
|
1503
1514
|
});
|
|
1504
1515
|
}
|
|
1505
1516
|
function getTaskChangeDetails(taskId) {
|
|
@@ -1513,8 +1524,10 @@ function getTaskGeometryDetail(taskId) {
|
|
|
1513
1524
|
});
|
|
1514
1525
|
}
|
|
1515
1526
|
function getCentroid(geometry, has_area_of_interest, geometry_aoi, is_segment, geometry_segment) {
|
|
1516
|
-
if (has_area_of_interest)
|
|
1517
|
-
|
|
1527
|
+
if (has_area_of_interest)
|
|
1528
|
+
return geometry_aoi;
|
|
1529
|
+
if (is_segment)
|
|
1530
|
+
return geometry_segment;
|
|
1518
1531
|
return geometry;
|
|
1519
1532
|
}
|
|
1520
1533
|
function showAnnotation(savedAnnotations, submittedAnnotations, annotatedRasterAsset) {
|
|
@@ -1656,7 +1669,7 @@ var useEvolandStore = create()((set) => ({
|
|
|
1656
1669
|
setRecenterLocation: () => set({ recenterLocation: false }),
|
|
1657
1670
|
setTimerReset: (timerreset) => set({ timerReset: timerreset }),
|
|
1658
1671
|
setAnnotationTime: (annotationtime) => set({ annotationTime: annotationtime }),
|
|
1659
|
-
onLocationSelected: (point3) => __async(
|
|
1672
|
+
onLocationSelected: (point3) => __async(void 0, null, function* () {
|
|
1660
1673
|
var data = yield LocationService2.getPolygonUtmlocationLonLonLatLatWidthWidthHeightHeightGet(
|
|
1661
1674
|
point3.lng,
|
|
1662
1675
|
point3.lat,
|
|
@@ -1682,10 +1695,10 @@ var useEvolandStore = create()((set) => ({
|
|
|
1682
1695
|
location: locData
|
|
1683
1696
|
});
|
|
1684
1697
|
}),
|
|
1685
|
-
onRecenterLocation: () => __async(
|
|
1698
|
+
onRecenterLocation: () => __async(void 0, null, function* () {
|
|
1686
1699
|
return set({ recenterLocation: true });
|
|
1687
1700
|
}),
|
|
1688
|
-
getLocationAssets: (locationId, projectId, type, taskId) => __async(
|
|
1701
|
+
getLocationAssets: (locationId, projectId, type, taskId) => __async(void 0, null, function* () {
|
|
1689
1702
|
var _a, _b;
|
|
1690
1703
|
const state = useEvolandStore.getState();
|
|
1691
1704
|
var {
|
|
@@ -1808,7 +1821,7 @@ var useEvolandStore = create()((set) => ({
|
|
|
1808
1821
|
}
|
|
1809
1822
|
return [];
|
|
1810
1823
|
}),
|
|
1811
|
-
getLocationDetails: (locationId, projectId, user, taskId, isAdmin) => __async(
|
|
1824
|
+
getLocationDetails: (locationId, projectId, user, taskId, isAdmin) => __async(void 0, null, function* () {
|
|
1812
1825
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
1813
1826
|
var state = useEvolandStore.getState();
|
|
1814
1827
|
var { referenceDate, reference_dates, sessionTimeOut, projectDetail, task_for_review } = state;
|
|
@@ -1897,7 +1910,7 @@ var useEvolandStore = create()((set) => ({
|
|
|
1897
1910
|
}
|
|
1898
1911
|
}
|
|
1899
1912
|
}),
|
|
1900
|
-
getNextLocationDetails: (projectId) => __async(
|
|
1913
|
+
getNextLocationDetails: (projectId) => __async(void 0, null, function* () {
|
|
1901
1914
|
var _a, _b, _c;
|
|
1902
1915
|
set({ isLoading: true });
|
|
1903
1916
|
var state = useEvolandStore.getState();
|
|
@@ -1966,7 +1979,7 @@ var useEvolandStore = create()((set) => ({
|
|
|
1966
1979
|
setOpacity: (opacity) => set({ opacity }),
|
|
1967
1980
|
setCompositeOpacity: (opacity) => set({ compositeOpacity: opacity }),
|
|
1968
1981
|
setAnnotationOpacity: (opacity) => set({ annotationOpacity: opacity }),
|
|
1969
|
-
addLabel: (loc, bounds, label) => __async(
|
|
1982
|
+
addLabel: (loc, bounds, label) => __async(void 0, null, function* () {
|
|
1970
1983
|
var _a;
|
|
1971
1984
|
set({ isLoading: true });
|
|
1972
1985
|
var store = useEvolandStore.getState();
|
|
@@ -2026,14 +2039,14 @@ var useEvolandStore = create()((set) => ({
|
|
|
2026
2039
|
setShowTimeSeries: (value) => set({ showTimeSeries: value }),
|
|
2027
2040
|
reset: () => set(initialState),
|
|
2028
2041
|
setSelectedColorLabel: (label) => set({ selectedColorLabel: label }),
|
|
2029
|
-
getLegendsDetails: (array) => __async(
|
|
2042
|
+
getLegendsDetails: (array) => __async(void 0, null, function* () {
|
|
2030
2043
|
var store = useEvolandStore.getState();
|
|
2031
2044
|
var legends = yield getLegends(array, store.labels);
|
|
2032
2045
|
set({
|
|
2033
2046
|
legends
|
|
2034
2047
|
});
|
|
2035
2048
|
}),
|
|
2036
|
-
getLocationMetaData: (locationId, projectId, taskId) => __async(
|
|
2049
|
+
getLocationMetaData: (locationId, projectId, taskId) => __async(void 0, null, function* () {
|
|
2037
2050
|
var _a, _b;
|
|
2038
2051
|
set({ isLoading: true });
|
|
2039
2052
|
var state = useEvolandStore.getState();
|
|
@@ -2059,7 +2072,7 @@ var useEvolandStore = create()((set) => ({
|
|
|
2059
2072
|
set({ sessionTimeOut: true, isLoading: false });
|
|
2060
2073
|
}
|
|
2061
2074
|
}),
|
|
2062
|
-
getLabels: (projectId) => __async(
|
|
2075
|
+
getLabels: (projectId) => __async(void 0, null, function* () {
|
|
2063
2076
|
var state = useEvolandStore.getState();
|
|
2064
2077
|
if (state.labels) {
|
|
2065
2078
|
return state.labels;
|
|
@@ -2081,10 +2094,10 @@ var useEvolandStore = create()((set) => ({
|
|
|
2081
2094
|
});
|
|
2082
2095
|
return allLabels;
|
|
2083
2096
|
}),
|
|
2084
|
-
setBrushThickness: (value) => __async(
|
|
2097
|
+
setBrushThickness: (value) => __async(void 0, null, function* () {
|
|
2085
2098
|
return set({ brushThickness: value });
|
|
2086
2099
|
}),
|
|
2087
|
-
getProjectDetail: (projectId) => __async(
|
|
2100
|
+
getProjectDetail: (projectId) => __async(void 0, null, function* () {
|
|
2088
2101
|
set({ isLoading: true });
|
|
2089
2102
|
const projectInfo = yield ProjectService.projectDetailProjectdetailProjectIdProjectIdGet(
|
|
2090
2103
|
projectId
|
|
@@ -2095,12 +2108,12 @@ var useEvolandStore = create()((set) => ({
|
|
|
2095
2108
|
isAnnualAnnotation: (projectInfo == null ? void 0 : projectInfo.project_type) == "ANNUALLY" /* ANNUALLY */ ? true : false
|
|
2096
2109
|
});
|
|
2097
2110
|
}),
|
|
2098
|
-
getTaskEvents: (taskId) => __async(
|
|
2111
|
+
getTaskEvents: (taskId) => __async(void 0, null, function* () {
|
|
2099
2112
|
set({ isLoading: true });
|
|
2100
2113
|
const taskevents = yield TaskService2.getTaskEventsTaskeventsTaskIdTaskIdGet(taskId);
|
|
2101
2114
|
set({ isLoading: false, taskEvents: taskevents });
|
|
2102
2115
|
}),
|
|
2103
|
-
getTaskAnnotation: (submittedAnnotationAsset, assetType) => __async(
|
|
2116
|
+
getTaskAnnotation: (submittedAnnotationAsset, assetType) => __async(void 0, null, function* () {
|
|
2104
2117
|
var _a, _b, _c;
|
|
2105
2118
|
if (submittedAnnotationAsset != null && submittedAnnotationAsset.length > 0) {
|
|
2106
2119
|
const state = useEvolandStore.getState();
|
|
@@ -2150,7 +2163,7 @@ var useEvolandStore = create()((set) => ({
|
|
|
2150
2163
|
setCurrentPosition: (position) => set({ currentPosition: position }),
|
|
2151
2164
|
setSessionTimeOut: (hasTimeOut) => set({ sessionTimeOut: hasTimeOut }),
|
|
2152
2165
|
setLatestTaskAnnotation: (locationTask) => set({ latestTaskAnnotation: locationTask }),
|
|
2153
|
-
getTaskReferenceDates: (projectId, locatioId, asset_type, setSelected) => __async(
|
|
2166
|
+
getTaskReferenceDates: (projectId, locatioId, asset_type, setSelected) => __async(void 0, null, function* () {
|
|
2154
2167
|
const state = useEvolandStore.getState();
|
|
2155
2168
|
const { annotation_dates, reference_dates, selectedReferenceDate } = state;
|
|
2156
2169
|
var task_ref_dates = yield getRefDates(projectId, locatioId, asset_type);
|
|
@@ -2166,7 +2179,7 @@ var useEvolandStore = create()((set) => ({
|
|
|
2166
2179
|
});
|
|
2167
2180
|
}
|
|
2168
2181
|
}),
|
|
2169
|
-
setSelectedReferenceDate: (currentReferenceDate) => __async(
|
|
2182
|
+
setSelectedReferenceDate: (currentReferenceDate) => __async(void 0, null, function* () {
|
|
2170
2183
|
const state = useEvolandStore.getState();
|
|
2171
2184
|
const { selectedReferenceDate, reference_dates } = state;
|
|
2172
2185
|
if (currentReferenceDate !== selectedReferenceDate)
|
|
@@ -2175,49 +2188,49 @@ var useEvolandStore = create()((set) => ({
|
|
|
2175
2188
|
selectedBand: reference_dates == null ? void 0 : reference_dates.indexOf(currentReferenceDate)
|
|
2176
2189
|
});
|
|
2177
2190
|
}),
|
|
2178
|
-
setUpdateAsset: (updateAssets) => __async(
|
|
2191
|
+
setUpdateAsset: (updateAssets) => __async(void 0, null, function* () {
|
|
2179
2192
|
return set({ updateAssets });
|
|
2180
2193
|
}),
|
|
2181
|
-
setComment: (comment) => __async(
|
|
2194
|
+
setComment: (comment) => __async(void 0, null, function* () {
|
|
2182
2195
|
return set({ comment });
|
|
2183
2196
|
}),
|
|
2184
|
-
setAnnualAnnotation: (val) => __async(
|
|
2197
|
+
setAnnualAnnotation: (val) => __async(void 0, null, function* () {
|
|
2185
2198
|
return set({ isAnnualAnnotation: val });
|
|
2186
2199
|
}),
|
|
2187
|
-
setSelectedBand: (bandIndex) => __async(
|
|
2200
|
+
setSelectedBand: (bandIndex) => __async(void 0, null, function* () {
|
|
2188
2201
|
return set({ selectedBand: bandIndex });
|
|
2189
2202
|
}),
|
|
2190
|
-
setAnnotationDates: (annotationDates) => __async(
|
|
2203
|
+
setAnnotationDates: (annotationDates) => __async(void 0, null, function* () {
|
|
2191
2204
|
return set({ annotation_dates: annotationDates });
|
|
2192
2205
|
}),
|
|
2193
|
-
setSavedAnnotations: (savedAnnotation) => __async(
|
|
2206
|
+
setSavedAnnotations: (savedAnnotation) => __async(void 0, null, function* () {
|
|
2194
2207
|
return set({ savedAnnotations: savedAnnotation });
|
|
2195
2208
|
}),
|
|
2196
|
-
setLabelList: (labels) => __async(
|
|
2209
|
+
setLabelList: (labels) => __async(void 0, null, function* () {
|
|
2197
2210
|
return set({ labelList: labels });
|
|
2198
2211
|
}),
|
|
2199
|
-
setLocation: (loc) => __async(
|
|
2212
|
+
setLocation: (loc) => __async(void 0, null, function* () {
|
|
2200
2213
|
return set({ location: loc });
|
|
2201
2214
|
}),
|
|
2202
|
-
setCurrentTask: (task) => __async(
|
|
2215
|
+
setCurrentTask: (task) => __async(void 0, null, function* () {
|
|
2203
2216
|
return set({ currentTask: task });
|
|
2204
2217
|
}),
|
|
2205
|
-
setTimeSeriesTypes: (types) => __async(
|
|
2218
|
+
setTimeSeriesTypes: (types) => __async(void 0, null, function* () {
|
|
2206
2219
|
return set({ timeSeriesTypes: types });
|
|
2207
2220
|
}),
|
|
2208
|
-
setTimeSeriesAssets: (assets) => __async(
|
|
2221
|
+
setTimeSeriesAssets: (assets) => __async(void 0, null, function* () {
|
|
2209
2222
|
return set({ timeSeriesAssets: assets });
|
|
2210
2223
|
}),
|
|
2211
|
-
setActiveLearningAnnotations: (active_learning) => __async(
|
|
2224
|
+
setActiveLearningAnnotations: (active_learning) => __async(void 0, null, function* () {
|
|
2212
2225
|
return set({ activeLearningAnnotations: active_learning });
|
|
2213
2226
|
}),
|
|
2214
|
-
setSubmittedAnnotations: (submit_annotation) => __async(
|
|
2227
|
+
setSubmittedAnnotations: (submit_annotation) => __async(void 0, null, function* () {
|
|
2215
2228
|
return set({ submittedAnnotations: submit_annotation });
|
|
2216
2229
|
}),
|
|
2217
|
-
setAnnotatedRasterAsset: (annotated_raster) => __async(
|
|
2230
|
+
setAnnotatedRasterAsset: (annotated_raster) => __async(void 0, null, function* () {
|
|
2218
2231
|
return set({ annotatedRasterAsset: annotated_raster });
|
|
2219
2232
|
}),
|
|
2220
|
-
setTaskGeometry: (task_geometry) => __async(
|
|
2233
|
+
setTaskGeometry: (task_geometry) => __async(void 0, null, function* () {
|
|
2221
2234
|
return set({ taskGeometry: task_geometry });
|
|
2222
2235
|
}),
|
|
2223
2236
|
setTaskForReview(taskForReview) {
|
|
@@ -2335,7 +2348,8 @@ var TiffImage = (props) => {
|
|
|
2335
2348
|
} else if (localcomment !== void 0 && (localcomment == null ? void 0 : localcomment.includes("#" + x))) {
|
|
2336
2349
|
localcomment = localcomment.replace(" #" + x, "");
|
|
2337
2350
|
this.className = "rounded-xl flex inline-flex text-secondary p-1 text-sm";
|
|
2338
|
-
} else
|
|
2351
|
+
} else
|
|
2352
|
+
localcomment = "#" + x + " ";
|
|
2339
2353
|
if (evolandStore.comment !== void 0 && evolandStore.comment !== null && !((_a5 = evolandStore.comment) == null ? void 0 : _a5.includes("#" + x)))
|
|
2340
2354
|
evolandStore.setComment(
|
|
2341
2355
|
evolandStore.comment + localcomment
|
|
@@ -2344,7 +2358,8 @@ var TiffImage = (props) => {
|
|
|
2344
2358
|
evolandStore.setComment(
|
|
2345
2359
|
evolandStore.comment.replace(" #" + x, "")
|
|
2346
2360
|
);
|
|
2347
|
-
else
|
|
2361
|
+
else
|
|
2362
|
+
evolandStore.setComment(localcomment);
|
|
2348
2363
|
});
|
|
2349
2364
|
container.appendChild(content);
|
|
2350
2365
|
}
|
|
@@ -2385,7 +2400,7 @@ var TiffImage = (props) => {
|
|
|
2385
2400
|
bubblingMouseEvents: false,
|
|
2386
2401
|
className: "border-2 border-blue-600"
|
|
2387
2402
|
}).bringToFront();
|
|
2388
|
-
imageOverlay3.on("mouseover", (e) => __async(
|
|
2403
|
+
imageOverlay3.on("mouseover", (e) => __async(void 0, null, function* () {
|
|
2389
2404
|
var _a3, _b2;
|
|
2390
2405
|
if (isBrush()) {
|
|
2391
2406
|
tooltip2 = L.tooltip({ offset: L.point(20, 0), opacity: 0.6 }).setContent(
|
|
@@ -2407,20 +2422,21 @@ var TiffImage = (props) => {
|
|
|
2407
2422
|
).setLatLng(e.latlng).addTo(map);
|
|
2408
2423
|
}
|
|
2409
2424
|
}));
|
|
2410
|
-
imageOverlay3.on("mousemove", (e) => __async(
|
|
2425
|
+
imageOverlay3.on("mousemove", (e) => __async(void 0, null, function* () {
|
|
2411
2426
|
evolandStore.setNDVIRGBValues(ndvi);
|
|
2412
2427
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2413
2428
|
if (isDrawing) {
|
|
2414
2429
|
handleMouseMove(e);
|
|
2415
2430
|
}
|
|
2416
2431
|
}));
|
|
2417
|
-
imageOverlay3.on("mouseout", () => __async(
|
|
2432
|
+
imageOverlay3.on("mouseout", () => __async(void 0, null, function* () {
|
|
2418
2433
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2419
2434
|
}));
|
|
2420
|
-
imageOverlay3.on("click", (e) => __async(
|
|
2435
|
+
imageOverlay3.on("click", (e) => __async(void 0, null, function* () {
|
|
2421
2436
|
var _a3, _b2, _c2;
|
|
2422
2437
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2423
|
-
if (((_a3 = evolandStore.selectedRasterAsset) == null ? void 0 : _a3.type) == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */)
|
|
2438
|
+
if (((_a3 = evolandStore.selectedRasterAsset) == null ? void 0 : _a3.type) == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */)
|
|
2439
|
+
return;
|
|
2424
2440
|
if (evolandStore.selectedColorLabel == null && evolandStore.selectedToolType !== 6 /* ClearSegmentWithPolygon */) {
|
|
2425
2441
|
alert("Please select label");
|
|
2426
2442
|
return;
|
|
@@ -2467,23 +2483,25 @@ var TiffImage = (props) => {
|
|
|
2467
2483
|
opacity: 0.8,
|
|
2468
2484
|
lineCap: "round"
|
|
2469
2485
|
}).addTo(map);
|
|
2470
|
-
polyLine.on("click", () => __async(
|
|
2486
|
+
polyLine.on("click", () => __async(void 0, null, function* () {
|
|
2471
2487
|
stopPaint();
|
|
2472
2488
|
}));
|
|
2473
|
-
polyLine.on("mouseover", (e) => __async(
|
|
2489
|
+
polyLine.on("mouseover", (e) => __async(void 0, null, function* () {
|
|
2474
2490
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2475
2491
|
tooltip2 = L.tooltip({ offset: L.point(20, 0), opacity: 0.6 }).setContent("Click to Stop").setLatLng(e.latlng).addTo(map);
|
|
2476
2492
|
}));
|
|
2477
|
-
polyLine.on("mousemove", () => __async(
|
|
2493
|
+
polyLine.on("mousemove", () => __async(void 0, null, function* () {
|
|
2478
2494
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2479
2495
|
}));
|
|
2480
|
-
polyLine.on("mouseout", () => __async(
|
|
2496
|
+
polyLine.on("mouseout", () => __async(void 0, null, function* () {
|
|
2481
2497
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2482
2498
|
}));
|
|
2483
2499
|
}
|
|
2484
2500
|
return () => {
|
|
2485
|
-
if (imageOverlay3)
|
|
2486
|
-
|
|
2501
|
+
if (imageOverlay3)
|
|
2502
|
+
map.removeLayer(imageOverlay3);
|
|
2503
|
+
if (tagsPopUp)
|
|
2504
|
+
map.removeLayer(tagsPopUp);
|
|
2487
2505
|
if (rectangle3 && evolandStore.isAnnualAnnotation)
|
|
2488
2506
|
map.removeLayer(rectangle3);
|
|
2489
2507
|
if (polyLine !== void 0) {
|
|
@@ -2576,7 +2594,7 @@ var ReadOnlyTiffImage = (props) => {
|
|
|
2576
2594
|
bubblingMouseEvents: false,
|
|
2577
2595
|
className: "border-2 border-blue-600"
|
|
2578
2596
|
}).bringToBack();
|
|
2579
|
-
imageOverlay3.on("mouseover", (e) => __async(
|
|
2597
|
+
imageOverlay3.on("mouseover", (e) => __async(void 0, null, function* () {
|
|
2580
2598
|
var data = yield getCanvasDataFromImageArray(
|
|
2581
2599
|
props.raster,
|
|
2582
2600
|
e.latlng,
|
|
@@ -2586,7 +2604,7 @@ var ReadOnlyTiffImage = (props) => {
|
|
|
2586
2604
|
);
|
|
2587
2605
|
setNDVI(data[1]);
|
|
2588
2606
|
}));
|
|
2589
|
-
imageOverlay3.on("mousemove", () => __async(
|
|
2607
|
+
imageOverlay3.on("mousemove", () => __async(void 0, null, function* () {
|
|
2590
2608
|
evolandStore.setNDVIRGBValues(ndvi);
|
|
2591
2609
|
}));
|
|
2592
2610
|
imageOverlay3.addTo(map);
|
|
@@ -2604,9 +2622,12 @@ var ReadOnlyTiffImage = (props) => {
|
|
|
2604
2622
|
}).addTo(map);
|
|
2605
2623
|
}
|
|
2606
2624
|
return () => {
|
|
2607
|
-
if (imageOverlay3)
|
|
2608
|
-
|
|
2609
|
-
if (
|
|
2625
|
+
if (imageOverlay3)
|
|
2626
|
+
map.removeLayer(imageOverlay3);
|
|
2627
|
+
if (rectangle3 && showRectangleAtCenter)
|
|
2628
|
+
map.removeLayer(rectangle3);
|
|
2629
|
+
if (props.polygonBounds)
|
|
2630
|
+
map.removeLayer(polygon_segment);
|
|
2610
2631
|
};
|
|
2611
2632
|
}, [props, map, showRectangleAtCenter]);
|
|
2612
2633
|
return null;
|
|
@@ -2849,7 +2870,8 @@ import { AuthenticationFailure } from "@geowiki/ui";
|
|
|
2849
2870
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
2850
2871
|
var EvolandContainer = ({ sessionStatus }) => {
|
|
2851
2872
|
const evolandStore = useEvolandStore();
|
|
2852
|
-
if (sessionStatus === "unauthenticated")
|
|
2873
|
+
if (sessionStatus === "unauthenticated")
|
|
2874
|
+
return /* @__PURE__ */ jsx4(AuthenticationFailure, {});
|
|
2853
2875
|
return evolandStore.location && /* @__PURE__ */ jsx4(EvoLandGeometry, {});
|
|
2854
2876
|
};
|
|
2855
2877
|
|
|
@@ -3033,7 +3055,8 @@ var defaultStyles = {
|
|
|
3033
3055
|
};
|
|
3034
3056
|
var excludedProperties = /* @__PURE__ */ new Set(["bbox", "geometry", "type"]);
|
|
3035
3057
|
var formatValue = (value) => {
|
|
3036
|
-
if (value === null || value === void 0)
|
|
3058
|
+
if (value === null || value === void 0)
|
|
3059
|
+
return "";
|
|
3037
3060
|
if (typeof value === "number") {
|
|
3038
3061
|
return value.toLocaleString();
|
|
3039
3062
|
}
|
|
@@ -3269,7 +3292,8 @@ var BetterWMS = class extends L6.TileLayer.WMS {
|
|
|
3269
3292
|
* Builds the URL for the GetFeatureInfo WMS request
|
|
3270
3293
|
*/
|
|
3271
3294
|
getFeatureInfoUrl(latlng) {
|
|
3272
|
-
if (!this.currentMap)
|
|
3295
|
+
if (!this.currentMap)
|
|
3296
|
+
return null;
|
|
3273
3297
|
const point3 = this.currentMap.latLngToContainerPoint(latlng);
|
|
3274
3298
|
const size = this.currentMap.getSize();
|
|
3275
3299
|
const wmsParams = this.wmsParams;
|
|
@@ -3338,7 +3362,8 @@ var BetterWMS = class extends L6.TileLayer.WMS {
|
|
|
3338
3362
|
return;
|
|
3339
3363
|
}
|
|
3340
3364
|
this.geoJsonLayer.addData(content);
|
|
3341
|
-
if (!this.currentMap)
|
|
3365
|
+
if (!this.currentMap)
|
|
3366
|
+
return;
|
|
3342
3367
|
if (this.currentPopup) {
|
|
3343
3368
|
this.currentMap.closePopup(this.currentPopup);
|
|
3344
3369
|
}
|
|
@@ -3355,7 +3380,8 @@ var BetterWMS = class extends L6.TileLayer.WMS {
|
|
|
3355
3380
|
* Show loading popup
|
|
3356
3381
|
*/
|
|
3357
3382
|
showLoading(latlng) {
|
|
3358
|
-
if (!this.currentMap || this.loading || !this.canShowLoading)
|
|
3383
|
+
if (!this.currentMap || this.loading || !this.canShowLoading)
|
|
3384
|
+
return;
|
|
3359
3385
|
this.loading = true;
|
|
3360
3386
|
this.currentPopup = L6.popup(this.popupOptions).setLatLng(latlng).setContent(this.loadingContent).openOn(this.currentMap);
|
|
3361
3387
|
}
|
|
@@ -3366,7 +3392,8 @@ var BetterWMS = class extends L6.TileLayer.WMS {
|
|
|
3366
3392
|
return __async(this, null, function* () {
|
|
3367
3393
|
var _a, _b, _c;
|
|
3368
3394
|
const url = this.getFeatureInfoUrl(event.latlng);
|
|
3369
|
-
if (!url)
|
|
3395
|
+
if (!url)
|
|
3396
|
+
return;
|
|
3370
3397
|
try {
|
|
3371
3398
|
this.showLoading(event.latlng);
|
|
3372
3399
|
const data = yield this.fetchWithRetry(url);
|
|
@@ -3551,7 +3578,8 @@ import { DesignFarmerClusterPin } from "@geowiki/ui";
|
|
|
3551
3578
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
3552
3579
|
var FarmerClusterPopup = ({ properties }) => {
|
|
3553
3580
|
const fileUrl = useFileUrl2();
|
|
3554
|
-
if (!properties)
|
|
3581
|
+
if (!properties)
|
|
3582
|
+
return /* @__PURE__ */ jsx8("div", { children: "No properties found" });
|
|
3555
3583
|
const name = properties["name"];
|
|
3556
3584
|
const description = properties["description"];
|
|
3557
3585
|
const url = "/cluster/view/" + properties["id"];
|
|
@@ -3616,7 +3644,8 @@ import {
|
|
|
3616
3644
|
import Image3 from "next/image";
|
|
3617
3645
|
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
3618
3646
|
var SiteInformation = ({ data }) => {
|
|
3619
|
-
if (!data)
|
|
3647
|
+
if (!data)
|
|
3648
|
+
return null;
|
|
3620
3649
|
const baseDocUrl = "https://raw.githubusercontent.com/iiasa/static/refs/heads/main/geotrees/docs/biomass_processing_protocol/";
|
|
3621
3650
|
return /* @__PURE__ */ jsxs3("div", { className: "space-y-6", children: [
|
|
3622
3651
|
/* @__PURE__ */ jsxs3("div", { className: "space-y-4", children: [
|
|
@@ -3791,7 +3820,8 @@ var IfbnSitePopup = ({ properties }) => {
|
|
|
3791
3820
|
const [isLoading, setIsLoading] = useState5(false);
|
|
3792
3821
|
const [imageError, setImageError] = useState5(false);
|
|
3793
3822
|
const { status: sessionStatus, data: session } = useSession();
|
|
3794
|
-
if (!properties)
|
|
3823
|
+
if (!properties)
|
|
3824
|
+
return /* @__PURE__ */ jsx10("div", { children: "No properties found" });
|
|
3795
3825
|
const plotId = properties["Plot_ID"];
|
|
3796
3826
|
const subPlotId = properties["SubPlot_Id"];
|
|
3797
3827
|
const network = properties["Network"];
|
|
@@ -3800,7 +3830,7 @@ var IfbnSitePopup = ({ properties }) => {
|
|
|
3800
3830
|
const fallbackUrl = "https://cms.main.geo-wiki.org/geotrees/media/cocoa.png";
|
|
3801
3831
|
const baseImageUrl = "https://raw.githubusercontent.com/iiasa/static/refs/heads/main/geotrees/sites/";
|
|
3802
3832
|
const imageUrl = `${baseImageUrl}${plotId}.jpg?raw=true`;
|
|
3803
|
-
const fetchSiteData = () => __async(
|
|
3833
|
+
const fetchSiteData = () => __async(void 0, null, function* () {
|
|
3804
3834
|
setIsLoading(true);
|
|
3805
3835
|
try {
|
|
3806
3836
|
const response = yield fetch(
|
|
@@ -3811,7 +3841,8 @@ var IfbnSitePopup = ({ properties }) => {
|
|
|
3811
3841
|
}
|
|
3812
3842
|
}
|
|
3813
3843
|
);
|
|
3814
|
-
if (!response.ok)
|
|
3844
|
+
if (!response.ok)
|
|
3845
|
+
throw new Error("Failed to fetch data");
|
|
3815
3846
|
const data = yield response.json();
|
|
3816
3847
|
setSiteData(data);
|
|
3817
3848
|
} catch (error) {
|
|
@@ -3885,14 +3916,16 @@ var IfbnPlotPopup = ({ properties }) => {
|
|
|
3885
3916
|
const [error, setError] = useState6(null);
|
|
3886
3917
|
const API_URL = process.env.NEXT_PUBLIC_GEO_TREE_API_URL;
|
|
3887
3918
|
useEffect5(() => {
|
|
3888
|
-
const fetchApiData = () => __async(
|
|
3889
|
-
if (!(properties == null ? void 0 : properties.id))
|
|
3919
|
+
const fetchApiData = () => __async(void 0, null, function* () {
|
|
3920
|
+
if (!(properties == null ? void 0 : properties.id))
|
|
3921
|
+
return;
|
|
3890
3922
|
setIsLoading(true);
|
|
3891
3923
|
try {
|
|
3892
3924
|
const response = yield fetch(
|
|
3893
3925
|
`${API_URL}/api/plots/by-plot-id/${properties.plot_id}`
|
|
3894
3926
|
);
|
|
3895
|
-
if (!response.ok)
|
|
3927
|
+
if (!response.ok)
|
|
3928
|
+
throw new Error("Failed to fetch data");
|
|
3896
3929
|
const data = yield response.json();
|
|
3897
3930
|
console.log("API Response:", data);
|
|
3898
3931
|
setApiData(data);
|
|
@@ -4066,9 +4099,12 @@ var createClusterIcon = (color) => {
|
|
|
4066
4099
|
markers.forEach((marker2) => {
|
|
4067
4100
|
var _a, _b, _c;
|
|
4068
4101
|
const status = ((_c = (_b = (_a = marker2.feature) == null ? void 0 : _a.properties) == null ? void 0 : _b.Status) == null ? void 0 : _c.trim().toLowerCase()) || "default";
|
|
4069
|
-
if (status === "ongoing")
|
|
4070
|
-
|
|
4071
|
-
else
|
|
4102
|
+
if (status === "ongoing")
|
|
4103
|
+
statusCount.ongoing++;
|
|
4104
|
+
else if (status === "auxiliary")
|
|
4105
|
+
statusCount.auxiliary++;
|
|
4106
|
+
else
|
|
4107
|
+
statusCount.default++;
|
|
4072
4108
|
});
|
|
4073
4109
|
return L8.divIcon({
|
|
4074
4110
|
html: `<div style=
|
|
@@ -4094,7 +4130,7 @@ var GeoJsonLayer = memo(
|
|
|
4094
4130
|
({ layer }) => {
|
|
4095
4131
|
const { isLoading, error, data } = useQuery({
|
|
4096
4132
|
queryKey: ["geoJson", layer.id],
|
|
4097
|
-
queryFn: () => __async(
|
|
4133
|
+
queryFn: () => __async(void 0, null, function* () {
|
|
4098
4134
|
const res = yield fetch(layer.url);
|
|
4099
4135
|
return yield res.json();
|
|
4100
4136
|
})
|
|
@@ -4144,7 +4180,8 @@ var GeoJsonLayer = memo(
|
|
|
4144
4180
|
[layerIcon]
|
|
4145
4181
|
);
|
|
4146
4182
|
const processedData = useMemo2(() => {
|
|
4147
|
-
if (!(data == null ? void 0 : data.features))
|
|
4183
|
+
if (!(data == null ? void 0 : data.features))
|
|
4184
|
+
return data;
|
|
4148
4185
|
const processed = __spreadValues({}, data);
|
|
4149
4186
|
processed.features = data.features.map((feature) => {
|
|
4150
4187
|
var _a;
|
|
@@ -4170,8 +4207,10 @@ var GeoJsonLayer = memo(
|
|
|
4170
4207
|
}),
|
|
4171
4208
|
[layer.id]
|
|
4172
4209
|
);
|
|
4173
|
-
if (error)
|
|
4174
|
-
|
|
4210
|
+
if (error)
|
|
4211
|
+
return /* @__PURE__ */ jsx13("div", { children: "error" });
|
|
4212
|
+
if (isLoading)
|
|
4213
|
+
return /* @__PURE__ */ jsx13(LoaderFull, {});
|
|
4175
4214
|
return /* @__PURE__ */ jsx13(
|
|
4176
4215
|
MarkerClusterGroup2,
|
|
4177
4216
|
{
|
|
@@ -4244,9 +4283,12 @@ var createClusterIcon2 = (cluster) => {
|
|
|
4244
4283
|
markers.forEach((marker2) => {
|
|
4245
4284
|
var _a, _b, _c;
|
|
4246
4285
|
const status = ((_c = (_b = (_a = marker2.feature) == null ? void 0 : _a.properties) == null ? void 0 : _b.Status) == null ? void 0 : _c.trim().toLowerCase()) || "default";
|
|
4247
|
-
if (status === "ongoing")
|
|
4248
|
-
|
|
4249
|
-
else
|
|
4286
|
+
if (status === "ongoing")
|
|
4287
|
+
statusCount.ongoing++;
|
|
4288
|
+
else if (status === "auxiliary")
|
|
4289
|
+
statusCount.auxiliary++;
|
|
4290
|
+
else
|
|
4291
|
+
statusCount.default++;
|
|
4250
4292
|
});
|
|
4251
4293
|
let clusterColor = "#2E7D32";
|
|
4252
4294
|
if (statusCount.ongoing > statusCount.auxiliary && statusCount.ongoing > statusCount.default) {
|
|
@@ -4295,7 +4337,7 @@ var IfbnPlotLayer = ({
|
|
|
4295
4337
|
});
|
|
4296
4338
|
const { isLoading, error, data } = useQuery2({
|
|
4297
4339
|
queryKey: ["IfbnPlotLayer", layer.id],
|
|
4298
|
-
queryFn: () => __async(
|
|
4340
|
+
queryFn: () => __async(void 0, null, function* () {
|
|
4299
4341
|
const res = yield fetch(`${layer.url}`);
|
|
4300
4342
|
return yield res.json();
|
|
4301
4343
|
})
|
|
@@ -4304,7 +4346,8 @@ var IfbnPlotLayer = ({
|
|
|
4304
4346
|
return currentZoom <= hideMarkersAboveZoom;
|
|
4305
4347
|
};
|
|
4306
4348
|
useEffect7(() => {
|
|
4307
|
-
if (!markerClusterGroupRef.current)
|
|
4349
|
+
if (!markerClusterGroupRef.current)
|
|
4350
|
+
return;
|
|
4308
4351
|
if (shouldShowMarkers()) {
|
|
4309
4352
|
markersRef.current.forEach((marker2) => {
|
|
4310
4353
|
var _a, _b;
|
|
@@ -4392,8 +4435,10 @@ var IfbnPlotLayer = ({
|
|
|
4392
4435
|
setSelectedFeature({ feature, latlng });
|
|
4393
4436
|
};
|
|
4394
4437
|
const ref = useRef2(null);
|
|
4395
|
-
if (error)
|
|
4396
|
-
|
|
4438
|
+
if (error)
|
|
4439
|
+
return /* @__PURE__ */ jsx14("div", { children: "error" });
|
|
4440
|
+
if (isLoading)
|
|
4441
|
+
return /* @__PURE__ */ jsx14(LoaderFull2, {});
|
|
4397
4442
|
return /* @__PURE__ */ jsxs5(
|
|
4398
4443
|
MarkerClusterGroup2,
|
|
4399
4444
|
{
|
|
@@ -4654,7 +4699,8 @@ var useCustomLayerStore = create4()((set, get) => ({
|
|
|
4654
4699
|
createLayerFromTemplate: (templateId, customData) => {
|
|
4655
4700
|
var _a, _b;
|
|
4656
4701
|
const template = get().getTemplate(templateId);
|
|
4657
|
-
if (!template)
|
|
4702
|
+
if (!template)
|
|
4703
|
+
return null;
|
|
4658
4704
|
const newLayer = {
|
|
4659
4705
|
id: uuidv4(),
|
|
4660
4706
|
isCustom: true,
|
|
@@ -5025,11 +5071,16 @@ function getColumnStats(data, columnName) {
|
|
|
5025
5071
|
let type;
|
|
5026
5072
|
if (uniqueTypes.size === 1) {
|
|
5027
5073
|
const singleType = types[0];
|
|
5028
|
-
if (singleType === "string")
|
|
5029
|
-
|
|
5030
|
-
else if (singleType === "
|
|
5031
|
-
|
|
5032
|
-
else
|
|
5074
|
+
if (singleType === "string")
|
|
5075
|
+
type = "string";
|
|
5076
|
+
else if (singleType === "number")
|
|
5077
|
+
type = "number";
|
|
5078
|
+
else if (singleType === "boolean")
|
|
5079
|
+
type = "boolean";
|
|
5080
|
+
else if (singleType === "object")
|
|
5081
|
+
type = "date";
|
|
5082
|
+
else
|
|
5083
|
+
type = "mixed";
|
|
5033
5084
|
} else {
|
|
5034
5085
|
type = "mixed";
|
|
5035
5086
|
}
|
|
@@ -5042,15 +5093,21 @@ var GoogleSheetsPopup = ({
|
|
|
5042
5093
|
properties
|
|
5043
5094
|
}) => {
|
|
5044
5095
|
const isEmpty = (value) => {
|
|
5045
|
-
if (value === null || value === void 0)
|
|
5046
|
-
|
|
5047
|
-
if (typeof value === "
|
|
5048
|
-
|
|
5049
|
-
if (typeof value === "
|
|
5096
|
+
if (value === null || value === void 0)
|
|
5097
|
+
return true;
|
|
5098
|
+
if (typeof value === "string")
|
|
5099
|
+
return value.trim() === "";
|
|
5100
|
+
if (typeof value === "number")
|
|
5101
|
+
return isNaN(value);
|
|
5102
|
+
if (Array.isArray(value))
|
|
5103
|
+
return value.length === 0;
|
|
5104
|
+
if (typeof value === "object")
|
|
5105
|
+
return Object.keys(value).length === 0;
|
|
5050
5106
|
return false;
|
|
5051
5107
|
};
|
|
5052
5108
|
const isUrl = (value) => {
|
|
5053
|
-
if (typeof value !== "string")
|
|
5109
|
+
if (typeof value !== "string")
|
|
5110
|
+
return false;
|
|
5054
5111
|
const trimmedValue = value.trim();
|
|
5055
5112
|
const urlPatterns = [
|
|
5056
5113
|
/^https?:\/\//i,
|
|
@@ -5557,7 +5614,8 @@ function analyzeColumn(rows, columnName) {
|
|
|
5557
5614
|
};
|
|
5558
5615
|
}
|
|
5559
5616
|
function getLegendColumns(rows, excludeCoordinateColumns = []) {
|
|
5560
|
-
if (rows.length === 0)
|
|
5617
|
+
if (rows.length === 0)
|
|
5618
|
+
return [];
|
|
5561
5619
|
const headers = Object.keys(rows[0]);
|
|
5562
5620
|
const legendColumns = [];
|
|
5563
5621
|
for (const header of headers) {
|
|
@@ -5694,7 +5752,7 @@ function useGenericCache({
|
|
|
5694
5752
|
const isCached = cache.has(cacheKey);
|
|
5695
5753
|
const queryOptions = {
|
|
5696
5754
|
queryKey: [cacheKey.type, cacheKey.id, cacheKey.subId, cacheKey.version],
|
|
5697
|
-
queryFn: () => __async(
|
|
5755
|
+
queryFn: () => __async(this, null, function* () {
|
|
5698
5756
|
const cachedData = cache.get(cacheKey);
|
|
5699
5757
|
if (cachedData) {
|
|
5700
5758
|
console.log(
|
|
@@ -5763,7 +5821,7 @@ function useGoogleSheetsData({
|
|
|
5763
5821
|
subId: sheetConfig.sheetId,
|
|
5764
5822
|
version: "1.0.0"
|
|
5765
5823
|
} : null;
|
|
5766
|
-
const fetchData = () => __async(
|
|
5824
|
+
const fetchData = () => __async(this, null, function* () {
|
|
5767
5825
|
if (!sheetConfig) {
|
|
5768
5826
|
throw new Error("Invalid Google Sheets configuration");
|
|
5769
5827
|
}
|
|
@@ -6031,7 +6089,8 @@ var GoogleSheetsLayer = ({
|
|
|
6031
6089
|
};
|
|
6032
6090
|
const processedData = useMemo3(() => {
|
|
6033
6091
|
var _a2;
|
|
6034
|
-
if (!data)
|
|
6092
|
+
if (!data)
|
|
6093
|
+
return null;
|
|
6035
6094
|
return __spreadProps(__spreadValues({}, data), {
|
|
6036
6095
|
features: (_a2 = data.features) == null ? void 0 : _a2.map((feature) => {
|
|
6037
6096
|
var _a3;
|
|
@@ -6870,9 +6929,10 @@ var RasterPreview = (_props) => {
|
|
|
6870
6929
|
},
|
|
6871
6930
|
{ scopes: ["evoland"] }
|
|
6872
6931
|
);
|
|
6873
|
-
const onSubmit = (taskStatus) => __async(
|
|
6932
|
+
const onSubmit = (taskStatus) => __async(void 0, null, function* () {
|
|
6874
6933
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2;
|
|
6875
|
-
if (disableSubmit)
|
|
6934
|
+
if (disableSubmit)
|
|
6935
|
+
return;
|
|
6876
6936
|
setDisableSubmit(true);
|
|
6877
6937
|
var bufferData = null;
|
|
6878
6938
|
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 };
|
|
@@ -6929,7 +6989,8 @@ var RasterPreview = (_props) => {
|
|
|
6929
6989
|
if (_props.userRole === "admin") {
|
|
6930
6990
|
if (tasks == null ? void 0 : tasks.task)
|
|
6931
6991
|
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" : ""}`;
|
|
6932
|
-
else
|
|
6992
|
+
else
|
|
6993
|
+
alert("No more tasks to review");
|
|
6933
6994
|
}
|
|
6934
6995
|
var res = yield evolandStore.getNextLocationDetails(
|
|
6935
6996
|
parseInt(projectId)
|
|
@@ -6953,7 +7014,8 @@ var RasterPreview = (_props) => {
|
|
|
6953
7014
|
}
|
|
6954
7015
|
});
|
|
6955
7016
|
const arrayEqual = (a, b) => {
|
|
6956
|
-
if (a.length !== b.length)
|
|
7017
|
+
if (a.length !== b.length)
|
|
7018
|
+
return false;
|
|
6957
7019
|
return Buffer.compare(Buffer.from(a.buffer), Buffer.from(b.buffer)) === 0;
|
|
6958
7020
|
};
|
|
6959
7021
|
const flatten = (input, refArr) => {
|
|
@@ -6977,14 +7039,15 @@ var RasterPreview = (_props) => {
|
|
|
6977
7039
|
}
|
|
6978
7040
|
}
|
|
6979
7041
|
}
|
|
6980
|
-
if (indexArr.length == 0)
|
|
7042
|
+
if (indexArr.length == 0)
|
|
7043
|
+
result = emptyAnnotation;
|
|
6981
7044
|
return { data: new Uint32Array(result), indexArr };
|
|
6982
7045
|
};
|
|
6983
7046
|
function isBase64Zeros(base64String) {
|
|
6984
7047
|
const trimmed = base64String.replace(/=+$/, "");
|
|
6985
7048
|
return /^A+$/.test(trimmed);
|
|
6986
7049
|
}
|
|
6987
|
-
const onSave = () => __async(
|
|
7050
|
+
const onSave = () => __async(void 0, null, function* () {
|
|
6988
7051
|
var _a2, _b2;
|
|
6989
7052
|
var bufferData = null;
|
|
6990
7053
|
const { data, indexArr } = evolandStore.isAnnualAnnotation ? { data: evolandStore.annotatedRasterAsset.buffer, indexArr: 0 } : flatten(
|
|
@@ -7032,7 +7095,8 @@ var RasterPreview = (_props) => {
|
|
|
7032
7095
|
setSubmitNotificationMessage(
|
|
7033
7096
|
"Annotation has been SAVED successfully"
|
|
7034
7097
|
);
|
|
7035
|
-
else
|
|
7098
|
+
else
|
|
7099
|
+
setSubmitNotificationMessage("Please try again");
|
|
7036
7100
|
setSubmitNotification(true);
|
|
7037
7101
|
}
|
|
7038
7102
|
} catch (err) {
|
|
@@ -7041,7 +7105,7 @@ var RasterPreview = (_props) => {
|
|
|
7041
7105
|
}
|
|
7042
7106
|
}
|
|
7043
7107
|
});
|
|
7044
|
-
const ClearPreview = () => __async(
|
|
7108
|
+
const ClearPreview = () => __async(void 0, null, function* () {
|
|
7045
7109
|
const { annotationRaster, pastValues } = yield ClearAnnotation(
|
|
7046
7110
|
evolandStore.annotatedRasterAsset,
|
|
7047
7111
|
evolandStore.isAnnualAnnotation,
|
|
@@ -7104,14 +7168,16 @@ var RasterPreview = (_props) => {
|
|
|
7104
7168
|
)] : newValue == null ? void 0 : newValue.buffer[0] : newValue == null ? void 0 : newValue.buffer
|
|
7105
7169
|
);
|
|
7106
7170
|
};
|
|
7107
|
-
if (layerStore.layerOpacity == 0)
|
|
7171
|
+
if (layerStore.layerOpacity == 0)
|
|
7172
|
+
layerStore.setLayerOpacity(0.4);
|
|
7108
7173
|
if (!goToNextTask && evolandStore.location !== null && evolandStore.location.locationId !== searchParams.get("locationId")) {
|
|
7109
7174
|
if (status == TaskStatus.ACCEPTED || status == TaskStatus.DISCARDED || status == TaskStatus.TO_FIX) {
|
|
7110
7175
|
setGoToNextTask(true);
|
|
7111
7176
|
if (_props.userRole === "admin")
|
|
7112
7177
|
if (tasks == null ? void 0 : tasks.task)
|
|
7113
7178
|
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" : ""}`;
|
|
7114
|
-
else
|
|
7179
|
+
else
|
|
7180
|
+
alert("No more tasks to review");
|
|
7115
7181
|
} else
|
|
7116
7182
|
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}`;
|
|
7117
7183
|
}
|
|
@@ -7160,8 +7226,10 @@ var RasterPreview = (_props) => {
|
|
|
7160
7226
|
parseInt(projectId),
|
|
7161
7227
|
evolandStore.referenceDate
|
|
7162
7228
|
).then(({ location, currentTask, annotation_dates }) => {
|
|
7163
|
-
if (location)
|
|
7164
|
-
|
|
7229
|
+
if (location)
|
|
7230
|
+
evolandStore.setLocation(location);
|
|
7231
|
+
if (currentTask)
|
|
7232
|
+
evolandStore.setCurrentTask(currentTask);
|
|
7165
7233
|
evolandStore.setAnnotationDates(annotation_dates);
|
|
7166
7234
|
});
|
|
7167
7235
|
},
|
|
@@ -7197,7 +7265,8 @@ var RasterPreview = (_props) => {
|
|
|
7197
7265
|
evolandStore.setComment(
|
|
7198
7266
|
evolandStore.comment.replace(" #" + x, "")
|
|
7199
7267
|
);
|
|
7200
|
-
else
|
|
7268
|
+
else
|
|
7269
|
+
evolandStore.setComment("#" + x + " ");
|
|
7201
7270
|
},
|
|
7202
7271
|
children: [
|
|
7203
7272
|
"#",
|
|
@@ -7458,7 +7527,7 @@ var Annotation = (props) => {
|
|
|
7458
7527
|
labelId: 0
|
|
7459
7528
|
});
|
|
7460
7529
|
const [currentLabelItem, setCurrentLabelItem] = useState12();
|
|
7461
|
-
const OnSubmitActiveLearning = () => __async(
|
|
7530
|
+
const OnSubmitActiveLearning = () => __async(void 0, null, function* () {
|
|
7462
7531
|
var _a2, _b2;
|
|
7463
7532
|
setActiveLearningLoading(true);
|
|
7464
7533
|
var bufferData = null;
|
|
@@ -8551,7 +8620,8 @@ import { LoaderFull as LoaderFull5 } from "@geowiki/ui";
|
|
|
8551
8620
|
import { Fragment as Fragment8, jsx as jsx31, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8552
8621
|
var assetsByYear = (assets) => assets == null ? void 0 : assets.reduce((acc, item) => {
|
|
8553
8622
|
const year = new Date(item.reference_date).getFullYear();
|
|
8554
|
-
if (!acc[year])
|
|
8623
|
+
if (!acc[year])
|
|
8624
|
+
acc[year] = [];
|
|
8555
8625
|
acc[year].push(item);
|
|
8556
8626
|
return acc;
|
|
8557
8627
|
}, {});
|
|
@@ -8668,10 +8738,14 @@ var ViewAssets = (props) => {
|
|
|
8668
8738
|
);
|
|
8669
8739
|
if (props.taskId !== void 0 && IsTaskAnnotationLoading)
|
|
8670
8740
|
return /* @__PURE__ */ jsx31(LoaderFull5, {});
|
|
8671
|
-
if (maskTab && (masks == null ? void 0 : masks.length) == 0)
|
|
8672
|
-
|
|
8673
|
-
if (
|
|
8674
|
-
|
|
8741
|
+
if (maskTab && (masks == null ? void 0 : masks.length) == 0)
|
|
8742
|
+
setMasks(evolandStore.maskAsset);
|
|
8743
|
+
if (changeMaskTab && (changeMasks == null ? void 0 : changeMasks.length) == 0)
|
|
8744
|
+
checkChangeMasksAndLoad();
|
|
8745
|
+
if (compositesTab && composites.length == 0)
|
|
8746
|
+
checkCompositesAndLoad();
|
|
8747
|
+
if (annotationTab)
|
|
8748
|
+
checkAnnotationsAndLoad();
|
|
8675
8749
|
function checkMasksAndLoad() {
|
|
8676
8750
|
if ((masks == null ? void 0 : masks.length) === 0 && !evolandStore.maskAsset) {
|
|
8677
8751
|
evolandStore.getLocationAssets(
|
|
@@ -8682,7 +8756,8 @@ var ViewAssets = (props) => {
|
|
|
8682
8756
|
).then((res) => {
|
|
8683
8757
|
setMasks(res);
|
|
8684
8758
|
});
|
|
8685
|
-
} else if (masks.length == 0)
|
|
8759
|
+
} else if (masks.length == 0)
|
|
8760
|
+
setMasks(evolandStore.maskAsset);
|
|
8686
8761
|
}
|
|
8687
8762
|
function checkChangeMasksAndLoad() {
|
|
8688
8763
|
if ((changeMasks == null ? void 0 : changeMasks.length) === 0 && !evolandStore.changeMaskAsset) {
|
|
@@ -8728,7 +8803,8 @@ var ViewAssets = (props) => {
|
|
|
8728
8803
|
}
|
|
8729
8804
|
if (props.taskId !== void 0 && IsTaskAnnotationLoading)
|
|
8730
8805
|
return /* @__PURE__ */ jsx31(LoaderFull5, {});
|
|
8731
|
-
if (maskTab && ((masks == null ? void 0 : masks.length) == 0 || masks == null))
|
|
8806
|
+
if (maskTab && ((masks == null ? void 0 : masks.length) == 0 || masks == null))
|
|
8807
|
+
setMaskTab(false);
|
|
8732
8808
|
return /* @__PURE__ */ jsxs20("div", { children: [
|
|
8733
8809
|
/* @__PURE__ */ jsxs20(
|
|
8734
8810
|
"div",
|
|
@@ -9290,7 +9366,8 @@ var SearchAnnotation = (props) => {
|
|
|
9290
9366
|
localStorage.setItem("toDate", toDate);
|
|
9291
9367
|
if (tasks == null ? void 0 : tasks.exists)
|
|
9292
9368
|
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" : ""}`;
|
|
9293
|
-
else
|
|
9369
|
+
else
|
|
9370
|
+
alert("No data for search parameters");
|
|
9294
9371
|
},
|
|
9295
9372
|
children: [
|
|
9296
9373
|
/* @__PURE__ */ jsx32(
|
|
@@ -9604,11 +9681,14 @@ var EvolandLeftSideBar = (props) => {
|
|
|
9604
9681
|
}
|
|
9605
9682
|
if (evolandStore.projectDetail) {
|
|
9606
9683
|
if (((_m = (_l = evolandStore.projectDetail) == null ? void 0 : _l.meta_data) == null ? void 0 : _m.default_asset_view) == "SEGMENTATION_MASK" /* SegmentationMask */) {
|
|
9607
|
-
if ((masks == null ? void 0 : masks.length) === 0)
|
|
9684
|
+
if ((masks == null ? void 0 : masks.length) === 0)
|
|
9685
|
+
return /* @__PURE__ */ jsx34(LoaderFull7, {});
|
|
9608
9686
|
} else if (((_o = (_n = evolandStore.projectDetail) == null ? void 0 : _n.meta_data) == null ? void 0 : _o.default_asset_view) == "COMPOSITE" /* Composite */) {
|
|
9609
|
-
if ((composites == null ? void 0 : composites.length) === 0)
|
|
9687
|
+
if ((composites == null ? void 0 : composites.length) === 0)
|
|
9688
|
+
return /* @__PURE__ */ jsx34(LoaderFull7, {});
|
|
9610
9689
|
}
|
|
9611
|
-
} else
|
|
9690
|
+
} else
|
|
9691
|
+
return /* @__PURE__ */ jsx34(LoaderFull7, {});
|
|
9612
9692
|
return /* @__PURE__ */ jsx34(
|
|
9613
9693
|
"div",
|
|
9614
9694
|
{
|
|
@@ -9775,7 +9855,8 @@ var EvolandLeftSideBar = (props) => {
|
|
|
9775
9855
|
canDelete = confirm(
|
|
9776
9856
|
(review ? "This is a targeted review task. " : "") + "Are you sure you want to delete this task?"
|
|
9777
9857
|
);
|
|
9778
|
-
if (canDelete)
|
|
9858
|
+
if (canDelete)
|
|
9859
|
+
setDeleteTask(true);
|
|
9779
9860
|
},
|
|
9780
9861
|
children: [
|
|
9781
9862
|
/* @__PURE__ */ jsx34(
|
|
@@ -9817,7 +9898,8 @@ var EvolandLeftSideBar = (props) => {
|
|
|
9817
9898
|
evolandStore.setAnnotationDates(annotation_dates);
|
|
9818
9899
|
if (currentTask)
|
|
9819
9900
|
evolandStore.setCurrentTask(currentTask);
|
|
9820
|
-
if (location)
|
|
9901
|
+
if (location)
|
|
9902
|
+
evolandStore.setLocation(location);
|
|
9821
9903
|
if (props.userRole === "admin")
|
|
9822
9904
|
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" : "");
|
|
9823
9905
|
}
|
|
@@ -10028,9 +10110,10 @@ var Questions = (props) => {
|
|
|
10028
10110
|
userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
|
|
10029
10111
|
locationLocationId: null
|
|
10030
10112
|
});
|
|
10031
|
-
const onSubmit = (taskStatus) => __async(
|
|
10113
|
+
const onSubmit = (taskStatus) => __async(void 0, null, function* () {
|
|
10032
10114
|
var _a2, _b2, _c2, _d2, _e2;
|
|
10033
|
-
if (disableSubmit)
|
|
10115
|
+
if (disableSubmit)
|
|
10116
|
+
return;
|
|
10034
10117
|
setDisableSubmit(true);
|
|
10035
10118
|
setStatus(taskStatus[0]);
|
|
10036
10119
|
if (evolandStore.currentTask) {
|
|
@@ -10062,7 +10145,8 @@ var Questions = (props) => {
|
|
|
10062
10145
|
if (props.userRole === "admin") {
|
|
10063
10146
|
if (tasks == null ? void 0 : tasks.task)
|
|
10064
10147
|
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" : ""}`;
|
|
10065
|
-
else
|
|
10148
|
+
else
|
|
10149
|
+
alert("No more tasks to review");
|
|
10066
10150
|
}
|
|
10067
10151
|
var res = yield evolandStore.getNextLocationDetails(
|
|
10068
10152
|
parseInt(projectId)
|
|
@@ -10085,7 +10169,7 @@ var Questions = (props) => {
|
|
|
10085
10169
|
setSubmitNotificationMessage("");
|
|
10086
10170
|
}
|
|
10087
10171
|
});
|
|
10088
|
-
const onSave = () => __async(
|
|
10172
|
+
const onSave = () => __async(void 0, null, function* () {
|
|
10089
10173
|
if (evolandStore.currentTask) {
|
|
10090
10174
|
const saveQuestionnaireReq = {
|
|
10091
10175
|
task_id: evolandStore.currentTask.task_id,
|
|
@@ -10104,7 +10188,8 @@ var Questions = (props) => {
|
|
|
10104
10188
|
setSubmitNotificationMessage(
|
|
10105
10189
|
"Questionnaire has been SAVED successfully"
|
|
10106
10190
|
);
|
|
10107
|
-
else
|
|
10191
|
+
else
|
|
10192
|
+
setSubmitNotificationMessage("Please try again");
|
|
10108
10193
|
setSubmitNotification(true);
|
|
10109
10194
|
}
|
|
10110
10195
|
} catch (err) {
|
|
@@ -10137,7 +10222,8 @@ var Questions = (props) => {
|
|
|
10137
10222
|
"<" + key + ">",
|
|
10138
10223
|
"" + (label == null ? void 0 : label.labelName)
|
|
10139
10224
|
);
|
|
10140
|
-
} else
|
|
10225
|
+
} else
|
|
10226
|
+
y.text = y.text.replace("<" + key + ">", "" + value);
|
|
10141
10227
|
});
|
|
10142
10228
|
});
|
|
10143
10229
|
}
|
|
@@ -10183,7 +10269,8 @@ var Questions = (props) => {
|
|
|
10183
10269
|
if (props.userRole === "admin")
|
|
10184
10270
|
if (tasks == null ? void 0 : tasks.task)
|
|
10185
10271
|
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" : ""}`;
|
|
10186
|
-
else
|
|
10272
|
+
else
|
|
10273
|
+
alert("No more tasks to review");
|
|
10187
10274
|
} else
|
|
10188
10275
|
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}`;
|
|
10189
10276
|
}
|
|
@@ -10298,7 +10385,8 @@ var Questions = (props) => {
|
|
|
10298
10385
|
evolandStore.setComment(
|
|
10299
10386
|
evolandStore.comment.replace(" #" + x, "")
|
|
10300
10387
|
);
|
|
10301
|
-
else
|
|
10388
|
+
else
|
|
10389
|
+
evolandStore.setComment("#" + x + " ");
|
|
10302
10390
|
},
|
|
10303
10391
|
children: [
|
|
10304
10392
|
"#",
|
|
@@ -10331,7 +10419,8 @@ var Questions = (props) => {
|
|
|
10331
10419
|
onClick: () => {
|
|
10332
10420
|
if (TaskState2[x[0]] !== TaskState2.SKIPPED && TaskState2[x[0]] !== TaskState2.DISCARDED && TaskState2[x[0]] !== TaskState2.USER_DISCARDED && userAnswers.length !== requiredUserAnswers)
|
|
10333
10421
|
alert("Please provide all answers");
|
|
10334
|
-
else
|
|
10422
|
+
else
|
|
10423
|
+
onSubmit(x);
|
|
10335
10424
|
},
|
|
10336
10425
|
children: TaskState2[x[0]]
|
|
10337
10426
|
}
|
|
@@ -10377,7 +10466,7 @@ var TimeSeries = () => {
|
|
|
10377
10466
|
const bbox4 = [bounds[1], bounds[0], bounds[3], bounds[2]];
|
|
10378
10467
|
const years = changeYears != null ? changeYears : taskChangeYears;
|
|
10379
10468
|
if (years) {
|
|
10380
|
-
years.map((year) => __async(
|
|
10469
|
+
years.map((year) => __async(this, null, function* () {
|
|
10381
10470
|
yield getTimeseries(
|
|
10382
10471
|
year + "-01-01",
|
|
10383
10472
|
year + "-12-31",
|
|
@@ -10412,7 +10501,8 @@ var TimeSeries = () => {
|
|
|
10412
10501
|
})
|
|
10413
10502
|
}
|
|
10414
10503
|
);
|
|
10415
|
-
if (!appendImages)
|
|
10504
|
+
if (!appendImages)
|
|
10505
|
+
setDetailedImgUrls((yield response.json()).images);
|
|
10416
10506
|
else {
|
|
10417
10507
|
response.json().then((res) => {
|
|
10418
10508
|
setDetailedImgUrls((prevUrls) => [...prevUrls, ...res.images]);
|
|
@@ -10456,15 +10546,18 @@ var TimeSeries = () => {
|
|
|
10456
10546
|
return 1;
|
|
10457
10547
|
else if (x.substring(x.split("_")[0].length, x.length) < y.substring(y.split("_")[0].length, y.length))
|
|
10458
10548
|
return -1;
|
|
10459
|
-
else
|
|
10549
|
+
else
|
|
10550
|
+
return 0;
|
|
10460
10551
|
}).map((x, index) => /* @__PURE__ */ jsx36(
|
|
10461
10552
|
"button",
|
|
10462
10553
|
{
|
|
10463
10554
|
className: currentTab === index ? "pl-1 pr-5 border-gray-300 text-white" : "pl-1 pr-5 border-gray-300 bg-gray-200",
|
|
10464
10555
|
onClick: () => {
|
|
10465
10556
|
setDetailedImgUrls([]);
|
|
10466
|
-
if (x.includes("RGB"))
|
|
10467
|
-
|
|
10557
|
+
if (x.includes("RGB"))
|
|
10558
|
+
fetchImages("TRUE_COLOR" /* RGB */);
|
|
10559
|
+
else if (x.includes("FCC"))
|
|
10560
|
+
fetchImages("COLOR_INFRARED" /* FCC */);
|
|
10468
10561
|
setCurrentTab(index);
|
|
10469
10562
|
},
|
|
10470
10563
|
children: x.substring(x.split("_")[0].length + 1, x.length)
|
|
@@ -10643,7 +10736,8 @@ var OverlayLayer = () => {
|
|
|
10643
10736
|
if (e.target.value !== "0") {
|
|
10644
10737
|
layerStore.setSelectedLayer(e.target.value);
|
|
10645
10738
|
setShowLayerOpacity(true);
|
|
10646
|
-
if (layerStore.layerOpacity == 0)
|
|
10739
|
+
if (layerStore.layerOpacity == 0)
|
|
10740
|
+
layerStore.setLayerOpacity(0.4);
|
|
10647
10741
|
} else {
|
|
10648
10742
|
setShowLayerOpacity(false);
|
|
10649
10743
|
layerStore.setSelectedLayer("");
|
|
@@ -10706,8 +10800,10 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
10706
10800
|
for (let i = z4; i > 0; i--) {
|
|
10707
10801
|
let digit = 0;
|
|
10708
10802
|
const mask = 1 << i - 1;
|
|
10709
|
-
if ((x & mask) !== 0)
|
|
10710
|
-
|
|
10803
|
+
if ((x & mask) !== 0)
|
|
10804
|
+
digit += 1;
|
|
10805
|
+
if ((y & mask) !== 0)
|
|
10806
|
+
digit += 2;
|
|
10711
10807
|
quad = quad + digit;
|
|
10712
10808
|
}
|
|
10713
10809
|
return quad;
|
|
@@ -10721,7 +10817,8 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
10721
10817
|
}
|
|
10722
10818
|
loadMetadata() {
|
|
10723
10819
|
var _a;
|
|
10724
|
-
if (this.metaRequested)
|
|
10820
|
+
if (this.metaRequested)
|
|
10821
|
+
return;
|
|
10725
10822
|
this.metaRequested = true;
|
|
10726
10823
|
const _this = this;
|
|
10727
10824
|
const cbid = "_bing_metadata_" + L13.Util.stamp(this);
|
|
@@ -10729,7 +10826,8 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
10729
10826
|
var _a2;
|
|
10730
10827
|
window[cbid] = void 0;
|
|
10731
10828
|
const e = document.getElementById(cbid);
|
|
10732
|
-
if (e)
|
|
10829
|
+
if (e)
|
|
10830
|
+
(_a2 = e.parentNode) == null ? void 0 : _a2.removeChild(e);
|
|
10733
10831
|
if (meta.errorDetails) {
|
|
10734
10832
|
console.log(meta.errorDetails);
|
|
10735
10833
|
return;
|
|
@@ -10773,7 +10871,8 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
10773
10871
|
this._update();
|
|
10774
10872
|
}
|
|
10775
10873
|
_update() {
|
|
10776
|
-
if (this._url === null || !this._map)
|
|
10874
|
+
if (this._url === null || !this._map)
|
|
10875
|
+
return;
|
|
10777
10876
|
this._update_attribution();
|
|
10778
10877
|
super._update();
|
|
10779
10878
|
}
|
|
@@ -10935,7 +11034,8 @@ var useMapControlStore = create6((set) => ({
|
|
|
10935
11034
|
})),
|
|
10936
11035
|
toggleControlOpen: (id) => set((state) => {
|
|
10937
11036
|
const targetControl = state.controls.find((c) => c.id === id);
|
|
10938
|
-
if (!targetControl)
|
|
11037
|
+
if (!targetControl)
|
|
11038
|
+
return state;
|
|
10939
11039
|
const targetPosition = targetControl.position;
|
|
10940
11040
|
const shouldOpenTarget = !targetControl.isOpen;
|
|
10941
11041
|
const updatedControls = state.controls.map((control) => {
|
|
@@ -11121,7 +11221,7 @@ import { jsx as jsx42 } from "react/jsx-runtime";
|
|
|
11121
11221
|
var constructLegendUrl = (baseUrl, layer, format, style) => {
|
|
11122
11222
|
return `${baseUrl}?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=${format}&LAYER=${layer}&STYLE=${style}&legend_options=dpi:150`;
|
|
11123
11223
|
};
|
|
11124
|
-
var fetchLegendData = (baseUrl, layerName, format, style) => __async(
|
|
11224
|
+
var fetchLegendData = (baseUrl, layerName, format, style) => __async(void 0, null, function* () {
|
|
11125
11225
|
const legendGraphicUrl = constructLegendUrl(
|
|
11126
11226
|
baseUrl,
|
|
11127
11227
|
layerName,
|
|
@@ -11938,8 +12038,10 @@ var LayerSwitcher = memo4(() => {
|
|
|
11938
12038
|
},
|
|
11939
12039
|
[openHoverCardId]
|
|
11940
12040
|
);
|
|
11941
|
-
if (error)
|
|
11942
|
-
|
|
12041
|
+
if (error)
|
|
12042
|
+
return /* @__PURE__ */ jsx46("div", { children: "Error loading map layers" });
|
|
12043
|
+
if (isLoading)
|
|
12044
|
+
return /* @__PURE__ */ jsx46("div", { children: "Loading layers..." });
|
|
11943
12045
|
const mapMenus = parseMapMenuItems(mapMenuItems);
|
|
11944
12046
|
const hasRegularLayers = (mapMenus == null ? void 0 : mapMenus.length) > 0;
|
|
11945
12047
|
const hasCustomLayers = customLayers.length > 0;
|
|
@@ -12421,7 +12523,8 @@ var MapControlContainer = memo5(() => {
|
|
|
12421
12523
|
}, [controls]);
|
|
12422
12524
|
return /* @__PURE__ */ jsx50(TooltipProvider, { children: /* @__PURE__ */ jsx50(Fragment16, { children: Object.entries(POSITION_CLASSES2).map(([position, className]) => {
|
|
12423
12525
|
const positionControls = controlsByPosition[position] || [];
|
|
12424
|
-
if (positionControls.length === 0)
|
|
12526
|
+
if (positionControls.length === 0)
|
|
12527
|
+
return null;
|
|
12425
12528
|
return /* @__PURE__ */ jsx50(
|
|
12426
12529
|
PositionGroup,
|
|
12427
12530
|
{
|
|
@@ -12448,7 +12551,8 @@ var BasicMap = () => {
|
|
|
12448
12551
|
((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
|
|
12449
12552
|
];
|
|
12450
12553
|
useRenderInfo("BasicMap");
|
|
12451
|
-
if (isSettingsLoading)
|
|
12554
|
+
if (isSettingsLoading)
|
|
12555
|
+
return /* @__PURE__ */ jsx51(LoaderFull9, {});
|
|
12452
12556
|
return /* @__PURE__ */ jsx51(Fragment17, { children: /* @__PURE__ */ jsxs35(
|
|
12453
12557
|
MapContainer2,
|
|
12454
12558
|
{
|
|
@@ -12520,7 +12624,8 @@ var useSelectedPixelStore = create7((set) => ({
|
|
|
12520
12624
|
set((state) => {
|
|
12521
12625
|
var _a;
|
|
12522
12626
|
const feat = (_a = geoJson.features[0]) == null ? void 0 : _a.id;
|
|
12523
|
-
if (!feat)
|
|
12627
|
+
if (!feat)
|
|
12628
|
+
return state;
|
|
12524
12629
|
const existing = state.data.some(
|
|
12525
12630
|
(item) => item.features[0].id === geoJson.features[0].id
|
|
12526
12631
|
);
|
|
@@ -13193,7 +13298,7 @@ var BasfSelect = () => {
|
|
|
13193
13298
|
[selectedItems]
|
|
13194
13299
|
);
|
|
13195
13300
|
const onSubmit = useCallback7(
|
|
13196
|
-
(data) => __async(
|
|
13301
|
+
(data) => __async(void 0, null, function* () {
|
|
13197
13302
|
setIsSubmitting(true);
|
|
13198
13303
|
try {
|
|
13199
13304
|
if (checkIfItemExists(data)) {
|
|
@@ -13303,7 +13408,8 @@ function PolylineMeasureControl() {
|
|
|
13303
13408
|
const controlRef = useRef7(null);
|
|
13304
13409
|
const [active, setActive] = useState25(false);
|
|
13305
13410
|
useEffect21(() => {
|
|
13306
|
-
if (!map)
|
|
13411
|
+
if (!map)
|
|
13412
|
+
return;
|
|
13307
13413
|
controlRef.current = L15.control.polylineMeasure({
|
|
13308
13414
|
position: "topright",
|
|
13309
13415
|
unit: "metres",
|
|
@@ -13324,7 +13430,8 @@ function PolylineMeasureControl() {
|
|
|
13324
13430
|
};
|
|
13325
13431
|
}, [map]);
|
|
13326
13432
|
const togglePolylineMeasure = () => {
|
|
13327
|
-
if (!controlRef.current)
|
|
13433
|
+
if (!controlRef.current)
|
|
13434
|
+
return;
|
|
13328
13435
|
if (!controlRef.current._measureControl) {
|
|
13329
13436
|
console.warn("Measurement control not properly initialized");
|
|
13330
13437
|
return;
|
|
@@ -13340,7 +13447,8 @@ function PolylineMeasureControl() {
|
|
|
13340
13447
|
}
|
|
13341
13448
|
};
|
|
13342
13449
|
const clearMeasurements = () => {
|
|
13343
|
-
if (!controlRef.current)
|
|
13450
|
+
if (!controlRef.current)
|
|
13451
|
+
return;
|
|
13344
13452
|
controlRef.current._clearAllMeasurements();
|
|
13345
13453
|
trackMapEvent2.measurementTool("clear");
|
|
13346
13454
|
};
|
|
@@ -13449,7 +13557,8 @@ var BasfMapComponent = (_a) => {
|
|
|
13449
13557
|
Number((_i = (_h = (_g = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _g.Longitude) == null ? void 0 : _h.Text) != null ? _i : 16.3738)
|
|
13450
13558
|
];
|
|
13451
13559
|
const steps = (_k = (_j = mapSettings == null ? void 0 : mapSettings.MapSettings) == null ? void 0 : _j.TourSteps) == null ? void 0 : _k.Text;
|
|
13452
|
-
if (isSettingsLoading)
|
|
13560
|
+
if (isSettingsLoading)
|
|
13561
|
+
return /* @__PURE__ */ jsx62(LoaderFull10, {});
|
|
13453
13562
|
return /* @__PURE__ */ jsx62(Fragment20, { children: /* @__PURE__ */ jsxs42(
|
|
13454
13563
|
MapContainer3,
|
|
13455
13564
|
__spreadProps(__spreadValues({
|
|
@@ -13519,7 +13628,7 @@ var GeoTreesDownloadContent = () => {
|
|
|
13519
13628
|
}
|
|
13520
13629
|
}, [session, setValue]);
|
|
13521
13630
|
useEffect23(() => {
|
|
13522
|
-
const fetchCountries = () => __async(
|
|
13631
|
+
const fetchCountries = () => __async(void 0, null, function* () {
|
|
13523
13632
|
try {
|
|
13524
13633
|
const response = yield fetch(
|
|
13525
13634
|
`${baseUrl}/api/plots/get-available-countries`,
|
|
@@ -13535,7 +13644,7 @@ var GeoTreesDownloadContent = () => {
|
|
|
13535
13644
|
console.error("Error fetching countries:", error);
|
|
13536
13645
|
}
|
|
13537
13646
|
});
|
|
13538
|
-
const fetchVersions = () => __async(
|
|
13647
|
+
const fetchVersions = () => __async(void 0, null, function* () {
|
|
13539
13648
|
try {
|
|
13540
13649
|
const response = yield fetch(
|
|
13541
13650
|
`${baseUrl}/api/plots/available-versions`,
|
|
@@ -13789,7 +13898,8 @@ var ScaleControl3 = ({
|
|
|
13789
13898
|
const [scale, setScale] = useState27("");
|
|
13790
13899
|
useEffect24(() => {
|
|
13791
13900
|
const updateScale = () => {
|
|
13792
|
-
if (!map)
|
|
13901
|
+
if (!map)
|
|
13902
|
+
return;
|
|
13793
13903
|
const center4 = map.getCenter();
|
|
13794
13904
|
const zoom = map.getZoom();
|
|
13795
13905
|
const metersPerPixel = 156543.03392 * Math.cos(center4.lat * Math.PI / 180) / Math.pow(2, zoom);
|
|
@@ -13805,7 +13915,8 @@ var ScaleControl3 = ({
|
|
|
13805
13915
|
map.off("moveend", updateScale);
|
|
13806
13916
|
};
|
|
13807
13917
|
}, [map]);
|
|
13808
|
-
if (!scale)
|
|
13918
|
+
if (!scale)
|
|
13919
|
+
return null;
|
|
13809
13920
|
return /* @__PURE__ */ jsx64(
|
|
13810
13921
|
"div",
|
|
13811
13922
|
{
|
|
@@ -14408,7 +14519,7 @@ var GeoTreesExternalLayer = forwardRef3(
|
|
|
14408
14519
|
const externalUrl = `${API_URL}/api/external/google-sheet-geojson`;
|
|
14409
14520
|
const { isLoading, error, data } = useQuery5({
|
|
14410
14521
|
queryKey: ["geoTreesExternal", externalUrl],
|
|
14411
|
-
queryFn: () => __async(
|
|
14522
|
+
queryFn: () => __async(void 0, null, function* () {
|
|
14412
14523
|
if (!API_URL) {
|
|
14413
14524
|
throw new Error("NEXT_PUBLIC_GEO_TREE_API_URL is not configured");
|
|
14414
14525
|
}
|
|
@@ -14440,7 +14551,8 @@ var GeoTreesExternalLayer = forwardRef3(
|
|
|
14440
14551
|
);
|
|
14441
14552
|
const addGeoTreesLayer = useCallback8(() => {
|
|
14442
14553
|
var _a2;
|
|
14443
|
-
if (!data)
|
|
14554
|
+
if (!data)
|
|
14555
|
+
return;
|
|
14444
14556
|
const layerId = "geotrees-external-layer";
|
|
14445
14557
|
if (hasLayerBeenAdded(layerId) || existingLayer || hasAddedLayer.current) {
|
|
14446
14558
|
console.warn("GEO-TREES BRM layer already exists, skipping addition", {
|
|
@@ -14453,7 +14565,8 @@ var GeoTreesExternalLayer = forwardRef3(
|
|
|
14453
14565
|
const filteredFeatures = ((_a2 = data.features) == null ? void 0 : _a2.filter((feature) => {
|
|
14454
14566
|
var _a3;
|
|
14455
14567
|
const status = (_a3 = feature.properties) == null ? void 0 : _a3.Status;
|
|
14456
|
-
if (!status)
|
|
14568
|
+
if (!status)
|
|
14569
|
+
return true;
|
|
14457
14570
|
const statusKey = getStatusFromRaw(status);
|
|
14458
14571
|
return statusKey ? statusFilter[statusKey] : true;
|
|
14459
14572
|
})) || [];
|
|
@@ -14521,9 +14634,12 @@ var GeoTreesExternalLayer = forwardRef3(
|
|
|
14521
14634
|
addGeoTreesLayer();
|
|
14522
14635
|
}
|
|
14523
14636
|
}, [data, autoAdd, existingLayer, addGeoTreesLayer, hasLayerBeenAdded]);
|
|
14524
|
-
if (error)
|
|
14525
|
-
|
|
14526
|
-
if (
|
|
14637
|
+
if (error)
|
|
14638
|
+
return /* @__PURE__ */ jsx68(ErrorDisplay, { error });
|
|
14639
|
+
if (isLoading)
|
|
14640
|
+
return /* @__PURE__ */ jsx68(LoadingDisplay, {});
|
|
14641
|
+
if (!((_a = data == null ? void 0 : data.features) == null ? void 0 : _a.length))
|
|
14642
|
+
return /* @__PURE__ */ jsx68(EmptyStateDisplay, {});
|
|
14527
14643
|
return null;
|
|
14528
14644
|
}
|
|
14529
14645
|
);
|
|
@@ -14574,7 +14690,8 @@ var GeoTreesMap = () => {
|
|
|
14574
14690
|
"Error loading map settings: ",
|
|
14575
14691
|
error.message
|
|
14576
14692
|
] }) });
|
|
14577
|
-
if (isSettingsLoading)
|
|
14693
|
+
if (isSettingsLoading)
|
|
14694
|
+
return /* @__PURE__ */ jsx69(LoaderFull11, { showInCenter: false });
|
|
14578
14695
|
const zoom = (_c = (_b = (_a = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _a.Zoom) == null ? void 0 : _b.Value) != null ? _c : 12;
|
|
14579
14696
|
const center4 = [
|
|
14580
14697
|
(_f = (_e = (_d = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _d.Latitude) == null ? void 0 : _e.Text) != null ? _f : 48.2082,
|
|
@@ -14641,7 +14758,8 @@ var useAreaSelect = ({
|
|
|
14641
14758
|
const rectangleRef = useRef10(null);
|
|
14642
14759
|
useEffect28(() => {
|
|
14643
14760
|
var _a;
|
|
14644
|
-
if (!map.selectArea)
|
|
14761
|
+
if (!map.selectArea)
|
|
14762
|
+
return;
|
|
14645
14763
|
(_a = map.selectArea) == null ? void 0 : _a.setControlKey(false);
|
|
14646
14764
|
if (!rectangleRef.current) {
|
|
14647
14765
|
rectangleRef.current = new Rectangle(
|
|
@@ -14654,7 +14772,8 @@ var useAreaSelect = ({
|
|
|
14654
14772
|
}
|
|
14655
14773
|
const handleAreaSelected = (e) => {
|
|
14656
14774
|
var _a2, _b, _c;
|
|
14657
|
-
if (!e.bounds)
|
|
14775
|
+
if (!e.bounds)
|
|
14776
|
+
return;
|
|
14658
14777
|
const boundsString = e.bounds.toBBoxString();
|
|
14659
14778
|
if (onAreaSelected) {
|
|
14660
14779
|
onAreaSelected(boundsString);
|
|
@@ -14727,8 +14846,9 @@ import { jsx as jsx70, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
|
14727
14846
|
var CanopyAtlasDownload = () => {
|
|
14728
14847
|
const [format, setFormat] = useState29("shape-zip");
|
|
14729
14848
|
const { bbox: bbox4 } = useAreaSelectStore();
|
|
14730
|
-
const handleDownload = () => __async(
|
|
14731
|
-
if (!bbox4)
|
|
14849
|
+
const handleDownload = () => __async(void 0, null, function* () {
|
|
14850
|
+
if (!bbox4)
|
|
14851
|
+
return;
|
|
14732
14852
|
const params = {
|
|
14733
14853
|
request: "GetFeature",
|
|
14734
14854
|
service: "WFS",
|
|
@@ -14743,7 +14863,8 @@ var CanopyAtlasDownload = () => {
|
|
|
14743
14863
|
const wfsUrl = baseUrl + L17.Util.getParamString(params, baseUrl, true);
|
|
14744
14864
|
try {
|
|
14745
14865
|
const response = yield fetch(wfsUrl);
|
|
14746
|
-
if (!response.ok)
|
|
14866
|
+
if (!response.ok)
|
|
14867
|
+
throw new Error("Download failed");
|
|
14747
14868
|
const blob = yield response.blob();
|
|
14748
14869
|
const url = window.URL.createObjectURL(blob);
|
|
14749
14870
|
const a = document.createElement("a");
|
|
@@ -14925,15 +15046,20 @@ var CanopyFilter = memo13(({ onFilterChange }) => {
|
|
|
14925
15046
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(updatedFilters));
|
|
14926
15047
|
onFilterChange(updatedFilters);
|
|
14927
15048
|
};
|
|
14928
|
-
const handleDownload = () => __async(
|
|
15049
|
+
const handleDownload = () => __async(void 0, null, function* () {
|
|
14929
15050
|
const cqlFilters = [];
|
|
14930
|
-
if (filters.biome)
|
|
14931
|
-
|
|
14932
|
-
if (filters.
|
|
15051
|
+
if (filters.biome)
|
|
15052
|
+
cqlFilters.push(`biome='${filters.biome}'`);
|
|
15053
|
+
if (filters.realm)
|
|
15054
|
+
cqlFilters.push(`realm='${filters.realm}'`);
|
|
15055
|
+
if (filters.access)
|
|
15056
|
+
cqlFilters.push(`access='${filters.access}'`);
|
|
14933
15057
|
if (filters.idunique)
|
|
14934
15058
|
cqlFilters.push(`IDunique LIKE '%${filters.idunique}%'`);
|
|
14935
|
-
if (filters.minyear)
|
|
14936
|
-
|
|
15059
|
+
if (filters.minyear)
|
|
15060
|
+
cqlFilters.push(`minyear>=${filters.minyear}`);
|
|
15061
|
+
if (filters.maxyear)
|
|
15062
|
+
cqlFilters.push(`minyear<=${filters.maxyear}`);
|
|
14937
15063
|
const params = __spreadValues({
|
|
14938
15064
|
request: "GetFeature",
|
|
14939
15065
|
service: "WFS",
|
|
@@ -14947,7 +15073,8 @@ var CanopyFilter = memo13(({ onFilterChange }) => {
|
|
|
14947
15073
|
const wfsUrl = baseUrl + L18.Util.getParamString(params, baseUrl, true);
|
|
14948
15074
|
try {
|
|
14949
15075
|
const response = yield fetch(wfsUrl);
|
|
14950
|
-
if (!response.ok)
|
|
15076
|
+
if (!response.ok)
|
|
15077
|
+
throw new Error("Download failed");
|
|
14951
15078
|
const blob = yield response.blob();
|
|
14952
15079
|
const url = window.URL.createObjectURL(blob);
|
|
14953
15080
|
const a = document.createElement("a");
|
|
@@ -15181,8 +15308,10 @@ var constructCqlFilter = (filterParams) => {
|
|
|
15181
15308
|
return "";
|
|
15182
15309
|
}
|
|
15183
15310
|
let _a = filterParams || {}, { minyear, maxyear } = _a, rest = __objRest(_a, ["minyear", "maxyear"]);
|
|
15184
|
-
if (Array.isArray(minyear))
|
|
15185
|
-
|
|
15311
|
+
if (Array.isArray(minyear))
|
|
15312
|
+
minyear = minyear[0];
|
|
15313
|
+
if (Array.isArray(maxyear))
|
|
15314
|
+
maxyear = maxyear[0];
|
|
15186
15315
|
const cqlExpressions = [];
|
|
15187
15316
|
if (minyear && maxyear) {
|
|
15188
15317
|
cqlExpressions.push(
|
|
@@ -15289,14 +15418,16 @@ var formatPropertyValue = (value, propertyName) => {
|
|
|
15289
15418
|
return value.toString();
|
|
15290
15419
|
};
|
|
15291
15420
|
var createDefaultPopupContent = (feature, propertyNames) => {
|
|
15292
|
-
if (!feature.properties)
|
|
15421
|
+
if (!feature.properties)
|
|
15422
|
+
return "";
|
|
15293
15423
|
const propertiesToShow = (propertyNames == null ? void 0 : propertyNames.length) ? propertyNames : DEFAULT_POPUP_PROPERTIES;
|
|
15294
15424
|
const properties = Object.entries(feature.properties).filter(([key]) => propertiesToShow.includes(key)).sort((a, b) => {
|
|
15295
15425
|
const indexA = propertiesToShow.indexOf(a[0]);
|
|
15296
15426
|
const indexB = propertiesToShow.indexOf(b[0]);
|
|
15297
15427
|
return indexA - indexB;
|
|
15298
15428
|
});
|
|
15299
|
-
if (properties.length === 0)
|
|
15429
|
+
if (properties.length === 0)
|
|
15430
|
+
return "";
|
|
15300
15431
|
return `
|
|
15301
15432
|
<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);">
|
|
15302
15433
|
<div style="width: 100%; overflow-y: auto;">
|
|
@@ -15367,7 +15498,7 @@ var openDatabase = () => {
|
|
|
15367
15498
|
};
|
|
15368
15499
|
});
|
|
15369
15500
|
};
|
|
15370
|
-
var storeInIndexedDB = (key, data) => __async(
|
|
15501
|
+
var storeInIndexedDB = (key, data) => __async(void 0, null, function* () {
|
|
15371
15502
|
try {
|
|
15372
15503
|
const db = yield openDatabase();
|
|
15373
15504
|
const transaction = db.transaction(STORE_NAME, "readwrite");
|
|
@@ -15386,7 +15517,7 @@ var storeInIndexedDB = (key, data) => __async(null, null, function* () {
|
|
|
15386
15517
|
console.warn("Failed to store data in IndexedDB:", e);
|
|
15387
15518
|
}
|
|
15388
15519
|
});
|
|
15389
|
-
var getFromIndexedDB = (key) => __async(
|
|
15520
|
+
var getFromIndexedDB = (key) => __async(void 0, null, function* () {
|
|
15390
15521
|
try {
|
|
15391
15522
|
const db = yield openDatabase();
|
|
15392
15523
|
const transaction = db.transaction(STORE_NAME, "readonly");
|
|
@@ -15408,7 +15539,7 @@ var getFromIndexedDB = (key) => __async(null, null, function* () {
|
|
|
15408
15539
|
return null;
|
|
15409
15540
|
}
|
|
15410
15541
|
});
|
|
15411
|
-
var cleanupIndexedDB = () => __async(
|
|
15542
|
+
var cleanupIndexedDB = () => __async(void 0, null, function* () {
|
|
15412
15543
|
try {
|
|
15413
15544
|
const db = yield openDatabase();
|
|
15414
15545
|
const transaction = db.transaction(STORE_NAME, "readwrite");
|
|
@@ -15458,7 +15589,8 @@ var WfsLayer = ({
|
|
|
15458
15589
|
}
|
|
15459
15590
|
});
|
|
15460
15591
|
const stableFilterParams = useMemo8(() => {
|
|
15461
|
-
if (!filterParams)
|
|
15592
|
+
if (!filterParams)
|
|
15593
|
+
return null;
|
|
15462
15594
|
return JSON.stringify(filterParams);
|
|
15463
15595
|
}, [filterParams]);
|
|
15464
15596
|
const queryKey = useMemo8(() => {
|
|
@@ -15480,7 +15612,7 @@ var WfsLayer = ({
|
|
|
15480
15612
|
}, [url, layerName, filterParams, useServerFiltering]);
|
|
15481
15613
|
const { data: geoJsonData, error } = useQuery6({
|
|
15482
15614
|
queryKey,
|
|
15483
|
-
queryFn: () => __async(
|
|
15615
|
+
queryFn: () => __async(void 0, null, function* () {
|
|
15484
15616
|
mapStore.setIsLoading(true);
|
|
15485
15617
|
const wfsUrl = constructWfsUrl();
|
|
15486
15618
|
const storageKey = `wfs-data-${queryKey.join("-")}`;
|
|
@@ -15545,7 +15677,8 @@ var WfsLayer = ({
|
|
|
15545
15677
|
const getFeatureStyle = useCallback9(
|
|
15546
15678
|
(feature) => {
|
|
15547
15679
|
var _a2;
|
|
15548
|
-
if (!feature)
|
|
15680
|
+
if (!feature)
|
|
15681
|
+
return defaultStyle;
|
|
15549
15682
|
const featureId = ((_a2 = feature.id) == null ? void 0 : _a2.toString()) || JSON.stringify(feature.properties);
|
|
15550
15683
|
return featureId === selectedFeatureId ? highlightStyle : defaultStyle;
|
|
15551
15684
|
},
|
|
@@ -15556,7 +15689,8 @@ var WfsLayer = ({
|
|
|
15556
15689
|
var _a2;
|
|
15557
15690
|
const featureId = ((_a2 = feature.id) == null ? void 0 : _a2.toString()) || JSON.stringify(feature.properties);
|
|
15558
15691
|
layerRef.current[featureId] = layer;
|
|
15559
|
-
if (!popupOptions || !feature.properties)
|
|
15692
|
+
if (!popupOptions || !feature.properties)
|
|
15693
|
+
return;
|
|
15560
15694
|
let popupContent;
|
|
15561
15695
|
if (popupOptions.renderContent) {
|
|
15562
15696
|
popupContent = popupOptions.renderContent(feature);
|
|
@@ -15601,7 +15735,8 @@ var WfsLayer = ({
|
|
|
15601
15735
|
[]
|
|
15602
15736
|
);
|
|
15603
15737
|
const filteredGeoJson = useMemo8(() => {
|
|
15604
|
-
if (!geoJsonData)
|
|
15738
|
+
if (!geoJsonData)
|
|
15739
|
+
return null;
|
|
15605
15740
|
if (useServerFiltering || !filterParams || Object.keys(filterParams).length === 0) {
|
|
15606
15741
|
return geoJsonData;
|
|
15607
15742
|
}
|
|
@@ -15845,7 +15980,8 @@ var CanopyMap = () => {
|
|
|
15845
15980
|
((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
|
|
15846
15981
|
];
|
|
15847
15982
|
useRenderInfo2("BasicMap");
|
|
15848
|
-
if (isSettingsLoading)
|
|
15983
|
+
if (isSettingsLoading)
|
|
15984
|
+
return /* @__PURE__ */ jsx74(LoaderFull12, { showInCenter: false });
|
|
15849
15985
|
return /* @__PURE__ */ jsx74(Fragment26, { children: /* @__PURE__ */ jsxs52(
|
|
15850
15986
|
MapContainer5,
|
|
15851
15987
|
{
|
|
@@ -15969,7 +16105,7 @@ var BasfLeftPanel = () => {
|
|
|
15969
16105
|
[selectedItems]
|
|
15970
16106
|
);
|
|
15971
16107
|
const onSubmit = useCallback11(
|
|
15972
|
-
(data) => __async(
|
|
16108
|
+
(data) => __async(void 0, null, function* () {
|
|
15973
16109
|
setIsSubmitting(true);
|
|
15974
16110
|
try {
|
|
15975
16111
|
if (checkIfItemExists(data)) {
|
|
@@ -16211,7 +16347,8 @@ var BetterWMS2 = class extends L20.TileLayer.WMS {
|
|
|
16211
16347
|
if (url) {
|
|
16212
16348
|
fetch(url).then((res) => res.json()).then((data) => {
|
|
16213
16349
|
this.showGetFeatureInfo(event.latlng, data);
|
|
16214
|
-
if (this.onInfoReceived)
|
|
16350
|
+
if (this.onInfoReceived)
|
|
16351
|
+
this.onInfoReceived(data);
|
|
16215
16352
|
}).catch((err) => {
|
|
16216
16353
|
console.log(err);
|
|
16217
16354
|
});
|
|
@@ -16651,7 +16788,8 @@ var WaybackTimelineMap = (props) => {
|
|
|
16651
16788
|
return null;
|
|
16652
16789
|
}
|
|
16653
16790
|
useEffect33(() => {
|
|
16654
|
-
if (props.mapping)
|
|
16791
|
+
if (props.mapping)
|
|
16792
|
+
setWAYBACK_SNAPSHOTS(props.mapping);
|
|
16655
16793
|
}, [props.mapping]);
|
|
16656
16794
|
const west = parseFloat(searchParams.get("xmin"));
|
|
16657
16795
|
const south = parseFloat(searchParams.get("ymin"));
|