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