@geowiki/map 0.16.9-dev.14 → 0.16.9-dev.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{GeoWikiMap-G2JPQNTZ.mjs → GeoWikiMap-AUSQTRUG.mjs} +1 -1
- package/dist/{chunk-3LCQXIYM.mjs → chunk-P5RXGGRU.mjs} +187 -269
- package/dist/index.js +327 -473
- package/dist/index.mjs +139 -203
- package/dist/styles.css +1 -1
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -166,8 +166,7 @@ function getAdjPixel(y, x, selectedValue, array2dMatrix) {
|
|
|
166
166
|
while (pixelsToCheck.length > 0) {
|
|
167
167
|
const [xTiff, yTiff] = pixelsToCheck.pop();
|
|
168
168
|
var key = xTiff + "_" + yTiff;
|
|
169
|
-
if (checkedPixels.has(key))
|
|
170
|
-
continue;
|
|
169
|
+
if (checkedPixels.has(key)) continue;
|
|
171
170
|
checkedPixels.add(key);
|
|
172
171
|
if (array2dMatrix[yTiff][xTiff] === selectedValue) {
|
|
173
172
|
sameValPixels.push([yTiff, xTiff]);
|
|
@@ -195,8 +194,7 @@ function pointInsidePolygon(xTiff, yTiff, vs) {
|
|
|
195
194
|
var xi = vs[i].xTiff, yi = vs[i].yTiff;
|
|
196
195
|
var xj = vs[j].xTiff, yj = vs[j].yTiff;
|
|
197
196
|
var intersect = yi > yTiff !== yj > yTiff && xTiff < (xj - xi) * (yTiff - yi) / (yj - yi) + xi;
|
|
198
|
-
if (intersect)
|
|
199
|
-
inside = !inside;
|
|
197
|
+
if (intersect) inside = !inside;
|
|
200
198
|
}
|
|
201
199
|
return inside;
|
|
202
200
|
}
|
|
@@ -305,7 +303,7 @@ var init_canvas = __esm({
|
|
|
305
303
|
ctx == null ? void 0 : ctx.putImageData(imageData, 0, 0);
|
|
306
304
|
return canvas;
|
|
307
305
|
};
|
|
308
|
-
getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvasContext, selectedBand) => __async(
|
|
306
|
+
getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvasContext, selectedBand) => __async(null, null, function* () {
|
|
309
307
|
var _a, _b;
|
|
310
308
|
try {
|
|
311
309
|
var tiffWidth = rasterItem.width;
|
|
@@ -321,8 +319,7 @@ var init_canvas = __esm({
|
|
|
321
319
|
var rgb = null;
|
|
322
320
|
if (((_a = rasterItem.name) == null ? void 0 : _a.toLowerCase().includes("ndvi")) && ((_b = rasterItem.name) == null ? void 0 : _b.toLowerCase().includes("perc")))
|
|
323
321
|
rgb = yield getNDVIValueForPixel(ndviImageCanvasContext, xTiff, yTiff);
|
|
324
|
-
else
|
|
325
|
-
rgb = null;
|
|
322
|
+
else rgb = null;
|
|
326
323
|
return [
|
|
327
324
|
selectedValue,
|
|
328
325
|
rgb !== null && rgb !== void 0 ? {
|
|
@@ -365,12 +362,11 @@ var init_canvas = __esm({
|
|
|
365
362
|
rasterItem.buffer = [...asset.buffer];
|
|
366
363
|
rasterItem.uri = [...asset.uri];
|
|
367
364
|
rasterItem.buffer[selectedBand] = new Uint32Array(assetBuffer);
|
|
368
|
-
if (Array.isArray(rasterItem.uri))
|
|
369
|
-
rasterItem.uri[selectedBand] = uri;
|
|
365
|
+
if (Array.isArray(rasterItem.uri)) rasterItem.uri[selectedBand] = uri;
|
|
370
366
|
}
|
|
371
367
|
return rasterItem;
|
|
372
368
|
};
|
|
373
|
-
getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnnotation, selectedBand, metadata) => __async(
|
|
369
|
+
getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnnotation, selectedBand, metadata) => __async(null, null, function* () {
|
|
374
370
|
var { newArray, canvas } = yield getEmptyPreviewRasterItemForInsert(
|
|
375
371
|
length,
|
|
376
372
|
width,
|
|
@@ -395,12 +391,12 @@ var init_canvas = __esm({
|
|
|
395
391
|
}
|
|
396
392
|
return rasterItem;
|
|
397
393
|
});
|
|
398
|
-
getEmptyPreviewRasterItemForInsert = (length, width, height, labels) => __async(
|
|
394
|
+
getEmptyPreviewRasterItemForInsert = (length, width, height, labels) => __async(null, null, function* () {
|
|
399
395
|
const newArray = new Uint32Array(length).fill(0);
|
|
400
396
|
const canvas = grayScaleArrayToCanvas(newArray, width, height, labels);
|
|
401
397
|
return { newArray, canvas };
|
|
402
398
|
});
|
|
403
|
-
updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnnotation) => __async(
|
|
399
|
+
updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnnotation) => __async(null, null, function* () {
|
|
404
400
|
var _a, _b, _c;
|
|
405
401
|
if (!fromRasterItem) {
|
|
406
402
|
return toPreviewRasterItem;
|
|
@@ -426,7 +422,7 @@ var init_canvas = __esm({
|
|
|
426
422
|
}
|
|
427
423
|
return toPreviewRasterItem;
|
|
428
424
|
});
|
|
429
|
-
getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(
|
|
425
|
+
getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(null, null, function* () {
|
|
430
426
|
const tiff = yield (0, import_geotiff.fromArrayBuffer)(arrayBuffer);
|
|
431
427
|
const image = yield tiff.getImage();
|
|
432
428
|
const pool = new import_geotiff.Pool();
|
|
@@ -450,7 +446,7 @@ var init_canvas = __esm({
|
|
|
450
446
|
pool.destroy();
|
|
451
447
|
return { width, height, rasterItems };
|
|
452
448
|
});
|
|
453
|
-
getRasterItems = (arrayBuffer, projectType) => __async(
|
|
449
|
+
getRasterItems = (arrayBuffer, projectType) => __async(null, null, function* () {
|
|
454
450
|
const tiff = yield (0, import_geotiff.fromArrayBuffer)(arrayBuffer);
|
|
455
451
|
const image = yield tiff.getImage();
|
|
456
452
|
const pool = new import_geotiff.Pool();
|
|
@@ -490,7 +486,7 @@ var init_canvas = __esm({
|
|
|
490
486
|
pool.destroy();
|
|
491
487
|
return { rasters, width, height, rasterItems };
|
|
492
488
|
});
|
|
493
|
-
getAssetItemsForLocationAssets = (assets, labels) => __async(
|
|
489
|
+
getAssetItemsForLocationAssets = (assets, labels) => __async(null, null, function* () {
|
|
494
490
|
var rasterItems = [];
|
|
495
491
|
for (var i = 0; i < (assets == null ? void 0 : assets.length); i++) {
|
|
496
492
|
const item = assets[i];
|
|
@@ -513,7 +509,7 @@ var init_canvas = __esm({
|
|
|
513
509
|
}
|
|
514
510
|
return rasterItems;
|
|
515
511
|
});
|
|
516
|
-
getRasterAssetItemsForLocationComposite = (assets) => __async(
|
|
512
|
+
getRasterAssetItemsForLocationComposite = (assets) => __async(null, null, function* () {
|
|
517
513
|
var rasterItems = [];
|
|
518
514
|
for (var i = 0; i < (assets == null ? void 0 : assets.length); i++) {
|
|
519
515
|
const item = assets[i];
|
|
@@ -534,7 +530,7 @@ var init_canvas = __esm({
|
|
|
534
530
|
}
|
|
535
531
|
return rasterItems;
|
|
536
532
|
});
|
|
537
|
-
copyAllRasterSegments = (rasterItem, previewRasterItem, selectedValue, labelValue, labels) => __async(
|
|
533
|
+
copyAllRasterSegments = (rasterItem, previewRasterItem, selectedValue, labelValue, labels) => __async(null, null, function* () {
|
|
538
534
|
var newBuffer = overwriteArrayBufferWithSelectedValue(
|
|
539
535
|
rasterItem.buffer,
|
|
540
536
|
previewRasterItem.buffer,
|
|
@@ -603,7 +599,7 @@ var init_canvas = __esm({
|
|
|
603
599
|
return destRasterItem;
|
|
604
600
|
}
|
|
605
601
|
};
|
|
606
|
-
paintRasterSegment = (sourceRasterItem, destRasterItem, locations, bounds, labelValue, labels, paintType, selectedBand, isAnnualAnnotation) => __async(
|
|
602
|
+
paintRasterSegment = (sourceRasterItem, destRasterItem, locations, bounds, labelValue, labels, paintType, selectedBand, isAnnualAnnotation) => __async(null, null, function* () {
|
|
607
603
|
var tiffWidth = sourceRasterItem.width;
|
|
608
604
|
var tiffHeight = sourceRasterItem.height;
|
|
609
605
|
var annotatedRaster = isAnnualAnnotation ? destRasterItem.buffer : destRasterItem.buffer[selectedBand];
|
|
@@ -720,7 +716,7 @@ var init_canvas = __esm({
|
|
|
720
716
|
destRasterItem.name = "My Annotation";
|
|
721
717
|
return destRasterItem;
|
|
722
718
|
});
|
|
723
|
-
getActiveLearningAnnotation = (assetHref, projectType) => __async(
|
|
719
|
+
getActiveLearningAnnotation = (assetHref, projectType) => __async(null, null, function* () {
|
|
724
720
|
const res = yield fetch(assetHref);
|
|
725
721
|
const buffer = yield res.arrayBuffer();
|
|
726
722
|
const rItems = yield getRasterItems(buffer, projectType);
|
|
@@ -737,7 +733,7 @@ var init_canvas = __esm({
|
|
|
737
733
|
};
|
|
738
734
|
return assetItem;
|
|
739
735
|
});
|
|
740
|
-
createImageDataForNDVI = (asset) => __async(
|
|
736
|
+
createImageDataForNDVI = (asset) => __async(null, null, function* () {
|
|
741
737
|
var canvas = document.createElement("canvas");
|
|
742
738
|
var context = canvas.getContext("2d");
|
|
743
739
|
var image = new Image();
|
|
@@ -747,7 +743,7 @@ var init_canvas = __esm({
|
|
|
747
743
|
context == null ? void 0 : context.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
748
744
|
return context;
|
|
749
745
|
});
|
|
750
|
-
getNDVIValueForPixel = (ndviImageCanvasContext, x, y) => __async(
|
|
746
|
+
getNDVIValueForPixel = (ndviImageCanvasContext, x, y) => __async(null, null, function* () {
|
|
751
747
|
var context = ndviImageCanvasContext;
|
|
752
748
|
var data = context == null ? void 0 : context.getImageData(x, y, 1, 1).data;
|
|
753
749
|
return data;
|
|
@@ -961,8 +957,7 @@ function getRasterAssetItemsForLocationAssets(assets) {
|
|
|
961
957
|
if (Array.isArray((_a = rItem.result) == null ? void 0 : _a.base64)) {
|
|
962
958
|
bufferData = (_b = rItem.result) == null ? void 0 : _b.base64.map((x) => {
|
|
963
959
|
var _a2, _b2;
|
|
964
|
-
if (((_a2 = rItem.result) == null ? void 0 : _a2.arrayType) == "uint8")
|
|
965
|
-
return Buffer.from(x, "base64");
|
|
960
|
+
if (((_a2 = rItem.result) == null ? void 0 : _a2.arrayType) == "uint8") return Buffer.from(x, "base64");
|
|
966
961
|
else if (((_b2 = rItem.result) == null ? void 0 : _b2.arrayType) == "uint32") {
|
|
967
962
|
const buffer2 = Buffer.from(x, "base64");
|
|
968
963
|
return new Uint32Array(
|
|
@@ -1043,16 +1038,14 @@ function ClearAnnotation(annotatedRasterAsset, isAnnualAnnotation, selectedBand,
|
|
|
1043
1038
|
selectedBand,
|
|
1044
1039
|
annotationRasterAsset.metadata
|
|
1045
1040
|
);
|
|
1046
|
-
if (isAnnualAnnotation)
|
|
1047
|
-
return { annotationRaster, pastValues };
|
|
1041
|
+
if (isAnnualAnnotation) return { annotationRaster, pastValues };
|
|
1048
1042
|
else {
|
|
1049
1043
|
var multiBandAnnotation = annotatedRasterAsset;
|
|
1050
1044
|
if (multiBandAnnotation == null ? void 0 : multiBandAnnotation.buffer[selectedBand]) {
|
|
1051
1045
|
multiBandAnnotation.buffer[selectedBand] = annotationRaster.buffer[selectedBand];
|
|
1052
1046
|
multiBandAnnotation.uri[selectedBand] = annotationRaster.uri[selectedBand];
|
|
1053
1047
|
return { multiBandAnnotation, undefined: void 0 };
|
|
1054
|
-
} else
|
|
1055
|
-
return { annotatedRasterAsset: void 0, undefined: void 0 };
|
|
1048
|
+
} else return { annotatedRasterAsset: void 0, undefined: void 0 };
|
|
1056
1049
|
}
|
|
1057
1050
|
});
|
|
1058
1051
|
}
|
|
@@ -1086,8 +1079,7 @@ function createTask(locationId, projectId, referenceDate) {
|
|
|
1086
1079
|
currentTask: res.task,
|
|
1087
1080
|
annotation_dates: yield getAnnotationDates(res == null ? void 0 : res.task)
|
|
1088
1081
|
};
|
|
1089
|
-
} else
|
|
1090
|
-
return { location: null, currentTask: null, annotation_dates: null };
|
|
1082
|
+
} else return { location: null, currentTask: null, annotation_dates: null };
|
|
1091
1083
|
});
|
|
1092
1084
|
}
|
|
1093
1085
|
function getTask(taskId) {
|
|
@@ -1115,8 +1107,7 @@ function getTask(taskId) {
|
|
|
1115
1107
|
annotation_dates: yield getAnnotationDates(res == null ? void 0 : res.task),
|
|
1116
1108
|
location: locData
|
|
1117
1109
|
};
|
|
1118
|
-
} else
|
|
1119
|
-
return { currentTask: null, annotation_dates: null, location: null };
|
|
1110
|
+
} else return { currentTask: null, annotation_dates: null, location: null };
|
|
1120
1111
|
});
|
|
1121
1112
|
}
|
|
1122
1113
|
function getActiveLearningAnnotationAsset(assetHref, labels, projectDetail) {
|
|
@@ -1168,8 +1159,7 @@ function insertEmptyBufferForSingleBand(length, width, height, selectedBand, ann
|
|
|
1168
1159
|
annotatedAsset.buffer[selectedBand] = newArray;
|
|
1169
1160
|
annotatedAsset.uri[selectedBand] = canvas.toDataURL();
|
|
1170
1161
|
return annotatedAsset;
|
|
1171
|
-
} else
|
|
1172
|
-
return null;
|
|
1162
|
+
} else return null;
|
|
1173
1163
|
});
|
|
1174
1164
|
}
|
|
1175
1165
|
function getTaskChangeDetails(taskId) {
|
|
@@ -1183,10 +1173,8 @@ function getTaskGeometryDetail(taskId) {
|
|
|
1183
1173
|
});
|
|
1184
1174
|
}
|
|
1185
1175
|
function getCentroid(geometry, has_area_of_interest, geometry_aoi, is_segment, geometry_segment) {
|
|
1186
|
-
if (has_area_of_interest)
|
|
1187
|
-
|
|
1188
|
-
if (is_segment)
|
|
1189
|
-
return geometry_segment;
|
|
1176
|
+
if (has_area_of_interest) return geometry_aoi;
|
|
1177
|
+
if (is_segment) return geometry_segment;
|
|
1190
1178
|
return geometry;
|
|
1191
1179
|
}
|
|
1192
1180
|
function showAnnotation(savedAnnotations, submittedAnnotations, annotatedRasterAsset) {
|
|
@@ -1347,7 +1335,7 @@ var init_evoland = __esm({
|
|
|
1347
1335
|
setRecenterLocation: () => set({ recenterLocation: false }),
|
|
1348
1336
|
setTimerReset: (timerreset) => set({ timerReset: timerreset }),
|
|
1349
1337
|
setAnnotationTime: (annotationtime) => set({ annotationTime: annotationtime }),
|
|
1350
|
-
onLocationSelected: (point3) => __async(
|
|
1338
|
+
onLocationSelected: (point3) => __async(null, null, function* () {
|
|
1351
1339
|
var data = yield import_evoland_api_proxy2.LocationService.getPolygonUtmlocationLonLonLatLatWidthWidthHeightHeightGet(
|
|
1352
1340
|
point3.lng,
|
|
1353
1341
|
point3.lat,
|
|
@@ -1373,10 +1361,10 @@ var init_evoland = __esm({
|
|
|
1373
1361
|
location: locData
|
|
1374
1362
|
});
|
|
1375
1363
|
}),
|
|
1376
|
-
onRecenterLocation: () => __async(
|
|
1364
|
+
onRecenterLocation: () => __async(null, null, function* () {
|
|
1377
1365
|
return set({ recenterLocation: true });
|
|
1378
1366
|
}),
|
|
1379
|
-
getLocationAssets: (locationId, projectId, type, taskId) => __async(
|
|
1367
|
+
getLocationAssets: (locationId, projectId, type, taskId) => __async(null, null, function* () {
|
|
1380
1368
|
var _a, _b;
|
|
1381
1369
|
const state = useEvolandStore.getState();
|
|
1382
1370
|
var {
|
|
@@ -1499,7 +1487,7 @@ var init_evoland = __esm({
|
|
|
1499
1487
|
}
|
|
1500
1488
|
return [];
|
|
1501
1489
|
}),
|
|
1502
|
-
getLocationDetails: (locationId, projectId, user, taskId, isAdmin) => __async(
|
|
1490
|
+
getLocationDetails: (locationId, projectId, user, taskId, isAdmin) => __async(null, null, function* () {
|
|
1503
1491
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
1504
1492
|
var state = useEvolandStore.getState();
|
|
1505
1493
|
var { referenceDate, reference_dates, sessionTimeOut, projectDetail, task_for_review } = state;
|
|
@@ -1588,7 +1576,7 @@ var init_evoland = __esm({
|
|
|
1588
1576
|
}
|
|
1589
1577
|
}
|
|
1590
1578
|
}),
|
|
1591
|
-
getNextLocationDetails: (projectId) => __async(
|
|
1579
|
+
getNextLocationDetails: (projectId) => __async(null, null, function* () {
|
|
1592
1580
|
var _a, _b, _c;
|
|
1593
1581
|
set({ isLoading: true });
|
|
1594
1582
|
var state = useEvolandStore.getState();
|
|
@@ -1657,7 +1645,7 @@ var init_evoland = __esm({
|
|
|
1657
1645
|
setOpacity: (opacity) => set({ opacity }),
|
|
1658
1646
|
setCompositeOpacity: (opacity) => set({ compositeOpacity: opacity }),
|
|
1659
1647
|
setAnnotationOpacity: (opacity) => set({ annotationOpacity: opacity }),
|
|
1660
|
-
addLabel: (loc, bounds, label) => __async(
|
|
1648
|
+
addLabel: (loc, bounds, label) => __async(null, null, function* () {
|
|
1661
1649
|
var _a;
|
|
1662
1650
|
set({ isLoading: true });
|
|
1663
1651
|
var store = useEvolandStore.getState();
|
|
@@ -1717,14 +1705,14 @@ var init_evoland = __esm({
|
|
|
1717
1705
|
setShowTimeSeries: (value) => set({ showTimeSeries: value }),
|
|
1718
1706
|
reset: () => set(initialState),
|
|
1719
1707
|
setSelectedColorLabel: (label) => set({ selectedColorLabel: label }),
|
|
1720
|
-
getLegendsDetails: (array) => __async(
|
|
1708
|
+
getLegendsDetails: (array) => __async(null, null, function* () {
|
|
1721
1709
|
var store = useEvolandStore.getState();
|
|
1722
1710
|
var legends = yield getLegends(array, store.labels);
|
|
1723
1711
|
set({
|
|
1724
1712
|
legends
|
|
1725
1713
|
});
|
|
1726
1714
|
}),
|
|
1727
|
-
getLocationMetaData: (locationId, projectId, taskId) => __async(
|
|
1715
|
+
getLocationMetaData: (locationId, projectId, taskId) => __async(null, null, function* () {
|
|
1728
1716
|
var _a, _b;
|
|
1729
1717
|
set({ isLoading: true });
|
|
1730
1718
|
var state = useEvolandStore.getState();
|
|
@@ -1750,7 +1738,7 @@ var init_evoland = __esm({
|
|
|
1750
1738
|
set({ sessionTimeOut: true, isLoading: false });
|
|
1751
1739
|
}
|
|
1752
1740
|
}),
|
|
1753
|
-
getLabels: (projectId) => __async(
|
|
1741
|
+
getLabels: (projectId) => __async(null, null, function* () {
|
|
1754
1742
|
var state = useEvolandStore.getState();
|
|
1755
1743
|
if (state.labels) {
|
|
1756
1744
|
return state.labels;
|
|
@@ -1772,10 +1760,10 @@ var init_evoland = __esm({
|
|
|
1772
1760
|
});
|
|
1773
1761
|
return allLabels;
|
|
1774
1762
|
}),
|
|
1775
|
-
setBrushThickness: (value) => __async(
|
|
1763
|
+
setBrushThickness: (value) => __async(null, null, function* () {
|
|
1776
1764
|
return set({ brushThickness: value });
|
|
1777
1765
|
}),
|
|
1778
|
-
getProjectDetail: (projectId) => __async(
|
|
1766
|
+
getProjectDetail: (projectId) => __async(null, null, function* () {
|
|
1779
1767
|
set({ isLoading: true });
|
|
1780
1768
|
const projectInfo = yield import_evoland_api_proxy2.ProjectService.projectDetailProjectdetailProjectIdProjectIdGet(
|
|
1781
1769
|
projectId
|
|
@@ -1786,12 +1774,12 @@ var init_evoland = __esm({
|
|
|
1786
1774
|
isAnnualAnnotation: (projectInfo == null ? void 0 : projectInfo.project_type) == "ANNUALLY" /* ANNUALLY */ ? true : false
|
|
1787
1775
|
});
|
|
1788
1776
|
}),
|
|
1789
|
-
getTaskEvents: (taskId) => __async(
|
|
1777
|
+
getTaskEvents: (taskId) => __async(null, null, function* () {
|
|
1790
1778
|
set({ isLoading: true });
|
|
1791
1779
|
const taskevents = yield import_evoland_api_proxy2.TaskService.getTaskEventsTaskeventsTaskIdTaskIdGet(taskId);
|
|
1792
1780
|
set({ isLoading: false, taskEvents: taskevents });
|
|
1793
1781
|
}),
|
|
1794
|
-
getTaskAnnotation: (submittedAnnotationAsset, assetType) => __async(
|
|
1782
|
+
getTaskAnnotation: (submittedAnnotationAsset, assetType) => __async(null, null, function* () {
|
|
1795
1783
|
var _a, _b, _c;
|
|
1796
1784
|
if (submittedAnnotationAsset != null && submittedAnnotationAsset.length > 0) {
|
|
1797
1785
|
const state = useEvolandStore.getState();
|
|
@@ -1841,7 +1829,7 @@ var init_evoland = __esm({
|
|
|
1841
1829
|
setCurrentPosition: (position) => set({ currentPosition: position }),
|
|
1842
1830
|
setSessionTimeOut: (hasTimeOut) => set({ sessionTimeOut: hasTimeOut }),
|
|
1843
1831
|
setLatestTaskAnnotation: (locationTask) => set({ latestTaskAnnotation: locationTask }),
|
|
1844
|
-
getTaskReferenceDates: (projectId, locatioId, asset_type, setSelected) => __async(
|
|
1832
|
+
getTaskReferenceDates: (projectId, locatioId, asset_type, setSelected) => __async(null, null, function* () {
|
|
1845
1833
|
const state = useEvolandStore.getState();
|
|
1846
1834
|
const { annotation_dates, reference_dates, selectedReferenceDate } = state;
|
|
1847
1835
|
var task_ref_dates = yield getRefDates(projectId, locatioId, asset_type);
|
|
@@ -1857,7 +1845,7 @@ var init_evoland = __esm({
|
|
|
1857
1845
|
});
|
|
1858
1846
|
}
|
|
1859
1847
|
}),
|
|
1860
|
-
setSelectedReferenceDate: (currentReferenceDate) => __async(
|
|
1848
|
+
setSelectedReferenceDate: (currentReferenceDate) => __async(null, null, function* () {
|
|
1861
1849
|
const state = useEvolandStore.getState();
|
|
1862
1850
|
const { selectedReferenceDate, reference_dates } = state;
|
|
1863
1851
|
if (currentReferenceDate !== selectedReferenceDate)
|
|
@@ -1866,49 +1854,49 @@ var init_evoland = __esm({
|
|
|
1866
1854
|
selectedBand: reference_dates == null ? void 0 : reference_dates.indexOf(currentReferenceDate)
|
|
1867
1855
|
});
|
|
1868
1856
|
}),
|
|
1869
|
-
setUpdateAsset: (updateAssets) => __async(
|
|
1857
|
+
setUpdateAsset: (updateAssets) => __async(null, null, function* () {
|
|
1870
1858
|
return set({ updateAssets });
|
|
1871
1859
|
}),
|
|
1872
|
-
setComment: (comment) => __async(
|
|
1860
|
+
setComment: (comment) => __async(null, null, function* () {
|
|
1873
1861
|
return set({ comment });
|
|
1874
1862
|
}),
|
|
1875
|
-
setAnnualAnnotation: (val) => __async(
|
|
1863
|
+
setAnnualAnnotation: (val) => __async(null, null, function* () {
|
|
1876
1864
|
return set({ isAnnualAnnotation: val });
|
|
1877
1865
|
}),
|
|
1878
|
-
setSelectedBand: (bandIndex) => __async(
|
|
1866
|
+
setSelectedBand: (bandIndex) => __async(null, null, function* () {
|
|
1879
1867
|
return set({ selectedBand: bandIndex });
|
|
1880
1868
|
}),
|
|
1881
|
-
setAnnotationDates: (annotationDates) => __async(
|
|
1869
|
+
setAnnotationDates: (annotationDates) => __async(null, null, function* () {
|
|
1882
1870
|
return set({ annotation_dates: annotationDates });
|
|
1883
1871
|
}),
|
|
1884
|
-
setSavedAnnotations: (savedAnnotation) => __async(
|
|
1872
|
+
setSavedAnnotations: (savedAnnotation) => __async(null, null, function* () {
|
|
1885
1873
|
return set({ savedAnnotations: savedAnnotation });
|
|
1886
1874
|
}),
|
|
1887
|
-
setLabelList: (labels) => __async(
|
|
1875
|
+
setLabelList: (labels) => __async(null, null, function* () {
|
|
1888
1876
|
return set({ labelList: labels });
|
|
1889
1877
|
}),
|
|
1890
|
-
setLocation: (loc) => __async(
|
|
1878
|
+
setLocation: (loc) => __async(null, null, function* () {
|
|
1891
1879
|
return set({ location: loc });
|
|
1892
1880
|
}),
|
|
1893
|
-
setCurrentTask: (task) => __async(
|
|
1881
|
+
setCurrentTask: (task) => __async(null, null, function* () {
|
|
1894
1882
|
return set({ currentTask: task });
|
|
1895
1883
|
}),
|
|
1896
|
-
setTimeSeriesTypes: (types) => __async(
|
|
1884
|
+
setTimeSeriesTypes: (types) => __async(null, null, function* () {
|
|
1897
1885
|
return set({ timeSeriesTypes: types });
|
|
1898
1886
|
}),
|
|
1899
|
-
setTimeSeriesAssets: (assets) => __async(
|
|
1887
|
+
setTimeSeriesAssets: (assets) => __async(null, null, function* () {
|
|
1900
1888
|
return set({ timeSeriesAssets: assets });
|
|
1901
1889
|
}),
|
|
1902
|
-
setActiveLearningAnnotations: (active_learning) => __async(
|
|
1890
|
+
setActiveLearningAnnotations: (active_learning) => __async(null, null, function* () {
|
|
1903
1891
|
return set({ activeLearningAnnotations: active_learning });
|
|
1904
1892
|
}),
|
|
1905
|
-
setSubmittedAnnotations: (submit_annotation) => __async(
|
|
1893
|
+
setSubmittedAnnotations: (submit_annotation) => __async(null, null, function* () {
|
|
1906
1894
|
return set({ submittedAnnotations: submit_annotation });
|
|
1907
1895
|
}),
|
|
1908
|
-
setAnnotatedRasterAsset: (annotated_raster) => __async(
|
|
1896
|
+
setAnnotatedRasterAsset: (annotated_raster) => __async(null, null, function* () {
|
|
1909
1897
|
return set({ annotatedRasterAsset: annotated_raster });
|
|
1910
1898
|
}),
|
|
1911
|
-
setTaskGeometry: (task_geometry) => __async(
|
|
1899
|
+
setTaskGeometry: (task_geometry) => __async(null, null, function* () {
|
|
1912
1900
|
return set({ taskGeometry: task_geometry });
|
|
1913
1901
|
}),
|
|
1914
1902
|
setTaskForReview(taskForReview) {
|
|
@@ -2039,8 +2027,7 @@ var init_TiffImage = __esm({
|
|
|
2039
2027
|
} else if (localcomment !== void 0 && (localcomment == null ? void 0 : localcomment.includes("#" + x))) {
|
|
2040
2028
|
localcomment = localcomment.replace(" #" + x, "");
|
|
2041
2029
|
this.className = "rounded-xl flex inline-flex text-secondary p-1 text-sm";
|
|
2042
|
-
} else
|
|
2043
|
-
localcomment = "#" + x + " ";
|
|
2030
|
+
} else localcomment = "#" + x + " ";
|
|
2044
2031
|
if (evolandStore.comment !== void 0 && evolandStore.comment !== null && !((_a5 = evolandStore.comment) == null ? void 0 : _a5.includes("#" + x)))
|
|
2045
2032
|
evolandStore.setComment(
|
|
2046
2033
|
evolandStore.comment + localcomment
|
|
@@ -2049,8 +2036,7 @@ var init_TiffImage = __esm({
|
|
|
2049
2036
|
evolandStore.setComment(
|
|
2050
2037
|
evolandStore.comment.replace(" #" + x, "")
|
|
2051
2038
|
);
|
|
2052
|
-
else
|
|
2053
|
-
evolandStore.setComment(localcomment);
|
|
2039
|
+
else evolandStore.setComment(localcomment);
|
|
2054
2040
|
});
|
|
2055
2041
|
container.appendChild(content);
|
|
2056
2042
|
}
|
|
@@ -2091,7 +2077,7 @@ var init_TiffImage = __esm({
|
|
|
2091
2077
|
bubblingMouseEvents: false,
|
|
2092
2078
|
className: "border-2 border-blue-600"
|
|
2093
2079
|
}).bringToFront();
|
|
2094
|
-
imageOverlay3.on("mouseover", (e) => __async(
|
|
2080
|
+
imageOverlay3.on("mouseover", (e) => __async(null, null, function* () {
|
|
2095
2081
|
var _a3, _b2;
|
|
2096
2082
|
if (isBrush()) {
|
|
2097
2083
|
tooltip2 = L.tooltip({ offset: L.point(20, 0), opacity: 0.6 }).setContent(
|
|
@@ -2113,21 +2099,20 @@ var init_TiffImage = __esm({
|
|
|
2113
2099
|
).setLatLng(e.latlng).addTo(map);
|
|
2114
2100
|
}
|
|
2115
2101
|
}));
|
|
2116
|
-
imageOverlay3.on("mousemove", (e) => __async(
|
|
2102
|
+
imageOverlay3.on("mousemove", (e) => __async(null, null, function* () {
|
|
2117
2103
|
evolandStore.setNDVIRGBValues(ndvi);
|
|
2118
2104
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2119
2105
|
if (isDrawing) {
|
|
2120
2106
|
handleMouseMove(e);
|
|
2121
2107
|
}
|
|
2122
2108
|
}));
|
|
2123
|
-
imageOverlay3.on("mouseout", () => __async(
|
|
2109
|
+
imageOverlay3.on("mouseout", () => __async(null, null, function* () {
|
|
2124
2110
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2125
2111
|
}));
|
|
2126
|
-
imageOverlay3.on("click", (e) => __async(
|
|
2112
|
+
imageOverlay3.on("click", (e) => __async(null, null, function* () {
|
|
2127
2113
|
var _a3, _b2, _c2;
|
|
2128
2114
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2129
|
-
if (((_a3 = evolandStore.selectedRasterAsset) == null ? void 0 : _a3.type) == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */)
|
|
2130
|
-
return;
|
|
2115
|
+
if (((_a3 = evolandStore.selectedRasterAsset) == null ? void 0 : _a3.type) == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */) return;
|
|
2131
2116
|
if (evolandStore.selectedColorLabel == null && evolandStore.selectedToolType !== 6 /* ClearSegmentWithPolygon */) {
|
|
2132
2117
|
alert("Please select label");
|
|
2133
2118
|
return;
|
|
@@ -2174,25 +2159,23 @@ var init_TiffImage = __esm({
|
|
|
2174
2159
|
opacity: 0.8,
|
|
2175
2160
|
lineCap: "round"
|
|
2176
2161
|
}).addTo(map);
|
|
2177
|
-
polyLine.on("click", () => __async(
|
|
2162
|
+
polyLine.on("click", () => __async(null, null, function* () {
|
|
2178
2163
|
stopPaint();
|
|
2179
2164
|
}));
|
|
2180
|
-
polyLine.on("mouseover", (e) => __async(
|
|
2165
|
+
polyLine.on("mouseover", (e) => __async(null, null, function* () {
|
|
2181
2166
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2182
2167
|
tooltip2 = L.tooltip({ offset: L.point(20, 0), opacity: 0.6 }).setContent("Click to Stop").setLatLng(e.latlng).addTo(map);
|
|
2183
2168
|
}));
|
|
2184
|
-
polyLine.on("mousemove", () => __async(
|
|
2169
|
+
polyLine.on("mousemove", () => __async(null, null, function* () {
|
|
2185
2170
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2186
2171
|
}));
|
|
2187
|
-
polyLine.on("mouseout", () => __async(
|
|
2172
|
+
polyLine.on("mouseout", () => __async(null, null, function* () {
|
|
2188
2173
|
tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
|
|
2189
2174
|
}));
|
|
2190
2175
|
}
|
|
2191
2176
|
return () => {
|
|
2192
|
-
if (imageOverlay3)
|
|
2193
|
-
|
|
2194
|
-
if (tagsPopUp)
|
|
2195
|
-
map.removeLayer(tagsPopUp);
|
|
2177
|
+
if (imageOverlay3) map.removeLayer(imageOverlay3);
|
|
2178
|
+
if (tagsPopUp) map.removeLayer(tagsPopUp);
|
|
2196
2179
|
if (rectangle3 && evolandStore.isAnnualAnnotation)
|
|
2197
2180
|
map.removeLayer(rectangle3);
|
|
2198
2181
|
if (polyLine !== void 0) {
|
|
@@ -2299,7 +2282,7 @@ var init_ReadOnlyTiffImage = __esm({
|
|
|
2299
2282
|
bubblingMouseEvents: false,
|
|
2300
2283
|
className: "border-2 border-blue-600"
|
|
2301
2284
|
}).bringToBack();
|
|
2302
|
-
imageOverlay3.on("mouseover", (e) => __async(
|
|
2285
|
+
imageOverlay3.on("mouseover", (e) => __async(null, null, function* () {
|
|
2303
2286
|
var data = yield getCanvasDataFromImageArray(
|
|
2304
2287
|
props.raster,
|
|
2305
2288
|
e.latlng,
|
|
@@ -2309,7 +2292,7 @@ var init_ReadOnlyTiffImage = __esm({
|
|
|
2309
2292
|
);
|
|
2310
2293
|
setNDVI(data[1]);
|
|
2311
2294
|
}));
|
|
2312
|
-
imageOverlay3.on("mousemove", () => __async(
|
|
2295
|
+
imageOverlay3.on("mousemove", () => __async(null, null, function* () {
|
|
2313
2296
|
evolandStore.setNDVIRGBValues(ndvi);
|
|
2314
2297
|
}));
|
|
2315
2298
|
imageOverlay3.addTo(map);
|
|
@@ -2327,12 +2310,9 @@ var init_ReadOnlyTiffImage = __esm({
|
|
|
2327
2310
|
}).addTo(map);
|
|
2328
2311
|
}
|
|
2329
2312
|
return () => {
|
|
2330
|
-
if (imageOverlay3)
|
|
2331
|
-
|
|
2332
|
-
if (
|
|
2333
|
-
map.removeLayer(rectangle3);
|
|
2334
|
-
if (props.polygonBounds)
|
|
2335
|
-
map.removeLayer(polygon_segment);
|
|
2313
|
+
if (imageOverlay3) map.removeLayer(imageOverlay3);
|
|
2314
|
+
if (rectangle3 && showRectangleAtCenter) map.removeLayer(rectangle3);
|
|
2315
|
+
if (props.polygonBounds) map.removeLayer(polygon_segment);
|
|
2336
2316
|
};
|
|
2337
2317
|
}, [props, map, showRectangleAtCenter]);
|
|
2338
2318
|
return null;
|
|
@@ -2619,8 +2599,7 @@ var init_EvolandContainer = __esm({
|
|
|
2619
2599
|
import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2620
2600
|
EvolandContainer = ({ sessionStatus }) => {
|
|
2621
2601
|
const evolandStore = useEvolandStore();
|
|
2622
|
-
if (sessionStatus === "unauthenticated")
|
|
2623
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui.AuthenticationFailure, {});
|
|
2602
|
+
if (sessionStatus === "unauthenticated") return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui.AuthenticationFailure, {});
|
|
2624
2603
|
return evolandStore.location && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EvoLandGeometry, {});
|
|
2625
2604
|
};
|
|
2626
2605
|
}
|
|
@@ -2838,8 +2817,7 @@ var init_MapUtils = __esm({
|
|
|
2838
2817
|
};
|
|
2839
2818
|
excludedProperties = /* @__PURE__ */ new Set(["bbox", "geometry", "type"]);
|
|
2840
2819
|
formatValue = (value) => {
|
|
2841
|
-
if (value === null || value === void 0)
|
|
2842
|
-
return "";
|
|
2820
|
+
if (value === null || value === void 0) return "";
|
|
2843
2821
|
if (typeof value === "number") {
|
|
2844
2822
|
return value.toLocaleString();
|
|
2845
2823
|
}
|
|
@@ -3026,8 +3004,7 @@ var init_BetterWMS = __esm({
|
|
|
3026
3004
|
* Builds the URL for the GetFeatureInfo WMS request
|
|
3027
3005
|
*/
|
|
3028
3006
|
getFeatureInfoUrl(latlng) {
|
|
3029
|
-
if (!this.currentMap)
|
|
3030
|
-
return null;
|
|
3007
|
+
if (!this.currentMap) return null;
|
|
3031
3008
|
const point3 = this.currentMap.latLngToContainerPoint(latlng);
|
|
3032
3009
|
const size = this.currentMap.getSize();
|
|
3033
3010
|
const wmsParams = this.wmsParams;
|
|
@@ -3096,8 +3073,7 @@ var init_BetterWMS = __esm({
|
|
|
3096
3073
|
return;
|
|
3097
3074
|
}
|
|
3098
3075
|
this.geoJsonLayer.addData(content);
|
|
3099
|
-
if (!this.currentMap)
|
|
3100
|
-
return;
|
|
3076
|
+
if (!this.currentMap) return;
|
|
3101
3077
|
if (this.currentPopup) {
|
|
3102
3078
|
this.currentMap.closePopup(this.currentPopup);
|
|
3103
3079
|
}
|
|
@@ -3114,8 +3090,7 @@ var init_BetterWMS = __esm({
|
|
|
3114
3090
|
* Show loading popup
|
|
3115
3091
|
*/
|
|
3116
3092
|
showLoading(latlng) {
|
|
3117
|
-
if (!this.currentMap || this.loading || !this.canShowLoading)
|
|
3118
|
-
return;
|
|
3093
|
+
if (!this.currentMap || this.loading || !this.canShowLoading) return;
|
|
3119
3094
|
this.loading = true;
|
|
3120
3095
|
this.currentPopup = import_leaflet4.default.popup(this.popupOptions).setLatLng(latlng).setContent(this.loadingContent).openOn(this.currentMap);
|
|
3121
3096
|
}
|
|
@@ -3126,8 +3101,7 @@ var init_BetterWMS = __esm({
|
|
|
3126
3101
|
return __async(this, null, function* () {
|
|
3127
3102
|
var _a, _b, _c;
|
|
3128
3103
|
const url = this.getFeatureInfoUrl(event.latlng);
|
|
3129
|
-
if (!url)
|
|
3130
|
-
return;
|
|
3104
|
+
if (!url) return;
|
|
3131
3105
|
try {
|
|
3132
3106
|
this.showLoading(event.latlng);
|
|
3133
3107
|
const data = yield this.fetchWithRetry(url);
|
|
@@ -3336,8 +3310,7 @@ var init_FarmerClusterPopup = __esm({
|
|
|
3336
3310
|
import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3337
3311
|
FarmerClusterPopup = ({ properties }) => {
|
|
3338
3312
|
const fileUrl = (0, import_core7.useFileUrl)();
|
|
3339
|
-
if (!properties)
|
|
3340
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "No properties found" });
|
|
3313
|
+
if (!properties) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "No properties found" });
|
|
3341
3314
|
const name = properties["name"];
|
|
3342
3315
|
const description = properties["description"];
|
|
3343
3316
|
const url = "/cluster/view/" + properties["id"];
|
|
@@ -3405,8 +3378,7 @@ var init_IfbnSitePopup = __esm({
|
|
|
3405
3378
|
import_core9 = require("@geowiki/core");
|
|
3406
3379
|
import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3407
3380
|
SiteInformation = ({ data }) => {
|
|
3408
|
-
if (!data)
|
|
3409
|
-
return null;
|
|
3381
|
+
if (!data) return null;
|
|
3410
3382
|
const baseDocUrl = "https://raw.githubusercontent.com/iiasa/static/refs/heads/main/geotrees/docs/biomass_processing_protocol/";
|
|
3411
3383
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-6", children: [
|
|
3412
3384
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-4", children: [
|
|
@@ -3581,8 +3553,7 @@ var init_IfbnSitePopup = __esm({
|
|
|
3581
3553
|
const [isLoading, setIsLoading] = (0, import_react6.useState)(false);
|
|
3582
3554
|
const [imageError, setImageError] = (0, import_react6.useState)(false);
|
|
3583
3555
|
const { status: sessionStatus, data: session } = (0, import_core8.useSession)();
|
|
3584
|
-
if (!properties)
|
|
3585
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: "No properties found" });
|
|
3556
|
+
if (!properties) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: "No properties found" });
|
|
3586
3557
|
const plotId = properties["Plot_ID"];
|
|
3587
3558
|
const subPlotId = properties["SubPlot_Id"];
|
|
3588
3559
|
const network = properties["Network"];
|
|
@@ -3591,7 +3562,7 @@ var init_IfbnSitePopup = __esm({
|
|
|
3591
3562
|
const fallbackUrl = "https://cms.main.geo-wiki.org/geotrees/media/cocoa.png";
|
|
3592
3563
|
const baseImageUrl = "https://raw.githubusercontent.com/iiasa/static/refs/heads/main/geotrees/sites/";
|
|
3593
3564
|
const imageUrl = `${baseImageUrl}${plotId}.jpg?raw=true`;
|
|
3594
|
-
const fetchSiteData = () => __async(
|
|
3565
|
+
const fetchSiteData = () => __async(null, null, function* () {
|
|
3595
3566
|
setIsLoading(true);
|
|
3596
3567
|
try {
|
|
3597
3568
|
const response = yield fetch(
|
|
@@ -3602,8 +3573,7 @@ var init_IfbnSitePopup = __esm({
|
|
|
3602
3573
|
}
|
|
3603
3574
|
}
|
|
3604
3575
|
);
|
|
3605
|
-
if (!response.ok)
|
|
3606
|
-
throw new Error("Failed to fetch data");
|
|
3576
|
+
if (!response.ok) throw new Error("Failed to fetch data");
|
|
3607
3577
|
const data = yield response.json();
|
|
3608
3578
|
setSiteData(data);
|
|
3609
3579
|
} catch (error) {
|
|
@@ -3683,16 +3653,14 @@ var init_IfbnPlotPopup = __esm({
|
|
|
3683
3653
|
const [error, setError] = (0, import_react7.useState)(null);
|
|
3684
3654
|
const API_URL = process.env.NEXT_PUBLIC_GEO_TREE_API_URL;
|
|
3685
3655
|
(0, import_react7.useEffect)(() => {
|
|
3686
|
-
const fetchApiData = () => __async(
|
|
3687
|
-
if (!(properties == null ? void 0 : properties.id))
|
|
3688
|
-
return;
|
|
3656
|
+
const fetchApiData = () => __async(null, null, function* () {
|
|
3657
|
+
if (!(properties == null ? void 0 : properties.id)) return;
|
|
3689
3658
|
setIsLoading(true);
|
|
3690
3659
|
try {
|
|
3691
3660
|
const response = yield fetch(
|
|
3692
3661
|
`${API_URL}/api/plots/by-plot-id/${properties.plot_id}`
|
|
3693
3662
|
);
|
|
3694
|
-
if (!response.ok)
|
|
3695
|
-
throw new Error("Failed to fetch data");
|
|
3663
|
+
if (!response.ok) throw new Error("Failed to fetch data");
|
|
3696
3664
|
const data = yield response.json();
|
|
3697
3665
|
console.log("API Response:", data);
|
|
3698
3666
|
setApiData(data);
|
|
@@ -3893,12 +3861,9 @@ var init_GeoJsonLayer = __esm({
|
|
|
3893
3861
|
markers.forEach((marker2) => {
|
|
3894
3862
|
var _a, _b, _c;
|
|
3895
3863
|
const status = ((_c = (_b = (_a = marker2.feature) == null ? void 0 : _a.properties) == null ? void 0 : _b.Status) == null ? void 0 : _c.trim().toLowerCase()) || "default";
|
|
3896
|
-
if (status === "ongoing")
|
|
3897
|
-
|
|
3898
|
-
else
|
|
3899
|
-
statusCount.auxiliary++;
|
|
3900
|
-
else
|
|
3901
|
-
statusCount.default++;
|
|
3864
|
+
if (status === "ongoing") statusCount.ongoing++;
|
|
3865
|
+
else if (status === "auxiliary") statusCount.auxiliary++;
|
|
3866
|
+
else statusCount.default++;
|
|
3902
3867
|
});
|
|
3903
3868
|
return import_leaflet6.default.divIcon({
|
|
3904
3869
|
html: `<div style=
|
|
@@ -3924,7 +3889,7 @@ var init_GeoJsonLayer = __esm({
|
|
|
3924
3889
|
({ layer }) => {
|
|
3925
3890
|
const { isLoading, error, data } = (0, import_react_query.useQuery)({
|
|
3926
3891
|
queryKey: ["geoJson", layer.id],
|
|
3927
|
-
queryFn: () => __async(
|
|
3892
|
+
queryFn: () => __async(null, null, function* () {
|
|
3928
3893
|
const res = yield fetch(layer.url);
|
|
3929
3894
|
return yield res.json();
|
|
3930
3895
|
})
|
|
@@ -3974,8 +3939,7 @@ var init_GeoJsonLayer = __esm({
|
|
|
3974
3939
|
[layerIcon]
|
|
3975
3940
|
);
|
|
3976
3941
|
const processedData = (0, import_react8.useMemo)(() => {
|
|
3977
|
-
if (!(data == null ? void 0 : data.features))
|
|
3978
|
-
return data;
|
|
3942
|
+
if (!(data == null ? void 0 : data.features)) return data;
|
|
3979
3943
|
const processed = __spreadValues({}, data);
|
|
3980
3944
|
processed.features = data.features.map((feature) => {
|
|
3981
3945
|
var _a;
|
|
@@ -4001,10 +3965,8 @@ var init_GeoJsonLayer = __esm({
|
|
|
4001
3965
|
}),
|
|
4002
3966
|
[layer.id]
|
|
4003
3967
|
);
|
|
4004
|
-
if (error)
|
|
4005
|
-
|
|
4006
|
-
if (isLoading)
|
|
4007
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui6.LoaderFull, {});
|
|
3968
|
+
if (error) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: "error" });
|
|
3969
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui6.LoaderFull, {});
|
|
4008
3970
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4009
3971
|
MarkerClusterGroup2,
|
|
4010
3972
|
{
|
|
@@ -4082,12 +4044,9 @@ var init_IfbnPlotLayer = __esm({
|
|
|
4082
4044
|
markers.forEach((marker2) => {
|
|
4083
4045
|
var _a, _b, _c;
|
|
4084
4046
|
const status = ((_c = (_b = (_a = marker2.feature) == null ? void 0 : _a.properties) == null ? void 0 : _b.Status) == null ? void 0 : _c.trim().toLowerCase()) || "default";
|
|
4085
|
-
if (status === "ongoing")
|
|
4086
|
-
|
|
4087
|
-
else
|
|
4088
|
-
statusCount.auxiliary++;
|
|
4089
|
-
else
|
|
4090
|
-
statusCount.default++;
|
|
4047
|
+
if (status === "ongoing") statusCount.ongoing++;
|
|
4048
|
+
else if (status === "auxiliary") statusCount.auxiliary++;
|
|
4049
|
+
else statusCount.default++;
|
|
4091
4050
|
});
|
|
4092
4051
|
let clusterColor = "#2E7D32";
|
|
4093
4052
|
if (statusCount.ongoing > statusCount.auxiliary && statusCount.ongoing > statusCount.default) {
|
|
@@ -4136,7 +4095,7 @@ var init_IfbnPlotLayer = __esm({
|
|
|
4136
4095
|
});
|
|
4137
4096
|
const { isLoading, error, data } = (0, import_react_query2.useQuery)({
|
|
4138
4097
|
queryKey: ["IfbnPlotLayer", layer.id],
|
|
4139
|
-
queryFn: () => __async(
|
|
4098
|
+
queryFn: () => __async(null, null, function* () {
|
|
4140
4099
|
const res = yield fetch(`${layer.url}`);
|
|
4141
4100
|
return yield res.json();
|
|
4142
4101
|
})
|
|
@@ -4145,8 +4104,7 @@ var init_IfbnPlotLayer = __esm({
|
|
|
4145
4104
|
return currentZoom <= hideMarkersAboveZoom;
|
|
4146
4105
|
};
|
|
4147
4106
|
(0, import_react9.useEffect)(() => {
|
|
4148
|
-
if (!markerClusterGroupRef.current)
|
|
4149
|
-
return;
|
|
4107
|
+
if (!markerClusterGroupRef.current) return;
|
|
4150
4108
|
if (shouldShowMarkers()) {
|
|
4151
4109
|
markersRef.current.forEach((marker2) => {
|
|
4152
4110
|
var _a, _b;
|
|
@@ -4234,10 +4192,8 @@ var init_IfbnPlotLayer = __esm({
|
|
|
4234
4192
|
setSelectedFeature({ feature, latlng });
|
|
4235
4193
|
};
|
|
4236
4194
|
const ref = (0, import_react9.useRef)(null);
|
|
4237
|
-
if (error)
|
|
4238
|
-
|
|
4239
|
-
if (isLoading)
|
|
4240
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui8.LoaderFull, {});
|
|
4195
|
+
if (error) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: "error" });
|
|
4196
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui8.LoaderFull, {});
|
|
4241
4197
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4242
4198
|
MarkerClusterGroup2,
|
|
4243
4199
|
{
|
|
@@ -4494,8 +4450,7 @@ var init_customLayers = __esm({
|
|
|
4494
4450
|
createLayerFromTemplate: (templateId, customData) => {
|
|
4495
4451
|
var _a, _b;
|
|
4496
4452
|
const template = get().getTemplate(templateId);
|
|
4497
|
-
if (!template)
|
|
4498
|
-
return null;
|
|
4453
|
+
if (!template) return null;
|
|
4499
4454
|
const newLayer = {
|
|
4500
4455
|
id: (0, import_uuid.v4)(),
|
|
4501
4456
|
isCustom: true,
|
|
@@ -4862,16 +4817,11 @@ function getColumnStats(data, columnName) {
|
|
|
4862
4817
|
let type;
|
|
4863
4818
|
if (uniqueTypes.size === 1) {
|
|
4864
4819
|
const singleType = types[0];
|
|
4865
|
-
if (singleType === "string")
|
|
4866
|
-
|
|
4867
|
-
else if (singleType === "
|
|
4868
|
-
|
|
4869
|
-
else
|
|
4870
|
-
type = "boolean";
|
|
4871
|
-
else if (singleType === "object")
|
|
4872
|
-
type = "date";
|
|
4873
|
-
else
|
|
4874
|
-
type = "mixed";
|
|
4820
|
+
if (singleType === "string") type = "string";
|
|
4821
|
+
else if (singleType === "number") type = "number";
|
|
4822
|
+
else if (singleType === "boolean") type = "boolean";
|
|
4823
|
+
else if (singleType === "object") type = "date";
|
|
4824
|
+
else type = "mixed";
|
|
4875
4825
|
} else {
|
|
4876
4826
|
type = "mixed";
|
|
4877
4827
|
}
|
|
@@ -4896,21 +4846,15 @@ var init_GoogleSheetsPopup = __esm({
|
|
|
4896
4846
|
properties
|
|
4897
4847
|
}) => {
|
|
4898
4848
|
const isEmpty = (value) => {
|
|
4899
|
-
if (value === null || value === void 0)
|
|
4900
|
-
|
|
4901
|
-
if (typeof value === "
|
|
4902
|
-
|
|
4903
|
-
if (typeof value === "
|
|
4904
|
-
return isNaN(value);
|
|
4905
|
-
if (Array.isArray(value))
|
|
4906
|
-
return value.length === 0;
|
|
4907
|
-
if (typeof value === "object")
|
|
4908
|
-
return Object.keys(value).length === 0;
|
|
4849
|
+
if (value === null || value === void 0) return true;
|
|
4850
|
+
if (typeof value === "string") return value.trim() === "";
|
|
4851
|
+
if (typeof value === "number") return isNaN(value);
|
|
4852
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
4853
|
+
if (typeof value === "object") return Object.keys(value).length === 0;
|
|
4909
4854
|
return false;
|
|
4910
4855
|
};
|
|
4911
4856
|
const isUrl2 = (value) => {
|
|
4912
|
-
if (typeof value !== "string")
|
|
4913
|
-
return false;
|
|
4857
|
+
if (typeof value !== "string") return false;
|
|
4914
4858
|
const trimmedValue = value.trim();
|
|
4915
4859
|
const urlPatterns = [
|
|
4916
4860
|
/^https?:\/\//i,
|
|
@@ -5353,8 +5297,7 @@ function analyzeColumn(rows, columnName) {
|
|
|
5353
5297
|
};
|
|
5354
5298
|
}
|
|
5355
5299
|
function getLegendColumns(rows, excludeCoordinateColumns = []) {
|
|
5356
|
-
if (rows.length === 0)
|
|
5357
|
-
return [];
|
|
5300
|
+
if (rows.length === 0) return [];
|
|
5358
5301
|
const headers = Object.keys(rows[0]);
|
|
5359
5302
|
const legendColumns = [];
|
|
5360
5303
|
for (const header of headers) {
|
|
@@ -5551,7 +5494,7 @@ function useGenericCache({
|
|
|
5551
5494
|
const isCached = cache.has(cacheKey);
|
|
5552
5495
|
const queryOptions = {
|
|
5553
5496
|
queryKey: [cacheKey.type, cacheKey.id, cacheKey.subId, cacheKey.version],
|
|
5554
|
-
queryFn: () => __async(
|
|
5497
|
+
queryFn: () => __async(null, null, function* () {
|
|
5555
5498
|
const cachedData = cache.get(cacheKey);
|
|
5556
5499
|
if (cachedData) {
|
|
5557
5500
|
console.log(
|
|
@@ -5690,8 +5633,7 @@ var init_GenericCache = __esm({
|
|
|
5690
5633
|
getFromStorage(key) {
|
|
5691
5634
|
try {
|
|
5692
5635
|
const stored = localStorage.getItem(key);
|
|
5693
|
-
if (!stored)
|
|
5694
|
-
return null;
|
|
5636
|
+
if (!stored) return null;
|
|
5695
5637
|
const entry = JSON.parse(stored);
|
|
5696
5638
|
if (this.isValid(entry)) {
|
|
5697
5639
|
this.hitCount++;
|
|
@@ -5995,7 +5937,7 @@ function useGoogleSheetsData({
|
|
|
5995
5937
|
subId: sheetConfig.sheetId,
|
|
5996
5938
|
version: "1.0.0"
|
|
5997
5939
|
} : null;
|
|
5998
|
-
const fetchData = () => __async(
|
|
5940
|
+
const fetchData = () => __async(null, null, function* () {
|
|
5999
5941
|
if (!sheetConfig) {
|
|
6000
5942
|
throw new Error("Invalid Google Sheets configuration");
|
|
6001
5943
|
}
|
|
@@ -6289,8 +6231,7 @@ var init_GoogleSheetsLayer = __esm({
|
|
|
6289
6231
|
};
|
|
6290
6232
|
const processedData = (0, import_react10.useMemo)(() => {
|
|
6291
6233
|
var _a2;
|
|
6292
|
-
if (!data)
|
|
6293
|
-
return null;
|
|
6234
|
+
if (!data) return null;
|
|
6294
6235
|
return __spreadProps(__spreadValues({}, data), {
|
|
6295
6236
|
features: (_a2 = data.features) == null ? void 0 : _a2.map((feature) => {
|
|
6296
6237
|
var _a3;
|
|
@@ -7038,10 +6979,9 @@ var init_RasterPreview = __esm({
|
|
|
7038
6979
|
},
|
|
7039
6980
|
{ scopes: ["evoland"] }
|
|
7040
6981
|
);
|
|
7041
|
-
const onSubmit = (taskStatus) => __async(
|
|
6982
|
+
const onSubmit = (taskStatus) => __async(null, null, function* () {
|
|
7042
6983
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2;
|
|
7043
|
-
if (disableSubmit)
|
|
7044
|
-
return;
|
|
6984
|
+
if (disableSubmit) return;
|
|
7045
6985
|
setDisableSubmit(true);
|
|
7046
6986
|
var bufferData = null;
|
|
7047
6987
|
var { data: savedAnnotationBuffer, indexArr: savedAnnotationIndexArr } = evolandStore.savedAnnotations && evolandStore.isAnnualAnnotation ? { data: evolandStore.savedAnnotations.buffer, indexArr: 0 } : evolandStore.savedAnnotations ? flatten(evolandStore.savedAnnotations.buffer) : { data: void 0, indexArr: 0 };
|
|
@@ -7098,8 +7038,7 @@ var init_RasterPreview = __esm({
|
|
|
7098
7038
|
if (_props.userRole === "admin") {
|
|
7099
7039
|
if (tasks == null ? void 0 : tasks.task)
|
|
7100
7040
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_v2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _v2.location_id}&taskId=${(_w2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _w2.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
|
|
7101
|
-
else
|
|
7102
|
-
alert("No more tasks to review");
|
|
7041
|
+
else alert("No more tasks to review");
|
|
7103
7042
|
}
|
|
7104
7043
|
var res = yield evolandStore.getNextLocationDetails(
|
|
7105
7044
|
parseInt(projectId)
|
|
@@ -7123,8 +7062,7 @@ var init_RasterPreview = __esm({
|
|
|
7123
7062
|
}
|
|
7124
7063
|
});
|
|
7125
7064
|
const arrayEqual = (a, b) => {
|
|
7126
|
-
if (a.length !== b.length)
|
|
7127
|
-
return false;
|
|
7065
|
+
if (a.length !== b.length) return false;
|
|
7128
7066
|
return Buffer.compare(Buffer.from(a.buffer), Buffer.from(b.buffer)) === 0;
|
|
7129
7067
|
};
|
|
7130
7068
|
const flatten = (input, refArr) => {
|
|
@@ -7148,15 +7086,14 @@ var init_RasterPreview = __esm({
|
|
|
7148
7086
|
}
|
|
7149
7087
|
}
|
|
7150
7088
|
}
|
|
7151
|
-
if (indexArr.length == 0)
|
|
7152
|
-
result = emptyAnnotation;
|
|
7089
|
+
if (indexArr.length == 0) result = emptyAnnotation;
|
|
7153
7090
|
return { data: new Uint32Array(result), indexArr };
|
|
7154
7091
|
};
|
|
7155
7092
|
function isBase64Zeros(base64String) {
|
|
7156
7093
|
const trimmed = base64String.replace(/=+$/, "");
|
|
7157
7094
|
return /^A+$/.test(trimmed);
|
|
7158
7095
|
}
|
|
7159
|
-
const onSave = () => __async(
|
|
7096
|
+
const onSave = () => __async(null, null, function* () {
|
|
7160
7097
|
var _a2, _b2;
|
|
7161
7098
|
var bufferData = null;
|
|
7162
7099
|
const { data, indexArr } = evolandStore.isAnnualAnnotation ? { data: evolandStore.annotatedRasterAsset.buffer, indexArr: 0 } : flatten(
|
|
@@ -7204,8 +7141,7 @@ var init_RasterPreview = __esm({
|
|
|
7204
7141
|
setSubmitNotificationMessage(
|
|
7205
7142
|
"Annotation has been SAVED successfully"
|
|
7206
7143
|
);
|
|
7207
|
-
else
|
|
7208
|
-
setSubmitNotificationMessage("Please try again");
|
|
7144
|
+
else setSubmitNotificationMessage("Please try again");
|
|
7209
7145
|
setSubmitNotification(true);
|
|
7210
7146
|
}
|
|
7211
7147
|
} catch (err) {
|
|
@@ -7214,7 +7150,7 @@ var init_RasterPreview = __esm({
|
|
|
7214
7150
|
}
|
|
7215
7151
|
}
|
|
7216
7152
|
});
|
|
7217
|
-
const ClearPreview = () => __async(
|
|
7153
|
+
const ClearPreview = () => __async(null, null, function* () {
|
|
7218
7154
|
const { annotationRaster, pastValues } = yield ClearAnnotation(
|
|
7219
7155
|
evolandStore.annotatedRasterAsset,
|
|
7220
7156
|
evolandStore.isAnnualAnnotation,
|
|
@@ -7277,16 +7213,14 @@ var init_RasterPreview = __esm({
|
|
|
7277
7213
|
)] : newValue == null ? void 0 : newValue.buffer[0] : newValue == null ? void 0 : newValue.buffer
|
|
7278
7214
|
);
|
|
7279
7215
|
};
|
|
7280
|
-
if (layerStore.layerOpacity == 0)
|
|
7281
|
-
layerStore.setLayerOpacity(0.4);
|
|
7216
|
+
if (layerStore.layerOpacity == 0) layerStore.setLayerOpacity(0.4);
|
|
7282
7217
|
if (!goToNextTask && evolandStore.location !== null && evolandStore.location.locationId !== searchParams.get("locationId")) {
|
|
7283
7218
|
if (status == import_core13.TaskStatus.ACCEPTED || status == import_core13.TaskStatus.DISCARDED || status == import_core13.TaskStatus.TO_FIX) {
|
|
7284
7219
|
setGoToNextTask(true);
|
|
7285
7220
|
if (_props.userRole === "admin")
|
|
7286
7221
|
if (tasks == null ? void 0 : tasks.task)
|
|
7287
7222
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_a = tasks == null ? void 0 : tasks.task) == null ? void 0 : _a.location_id}&taskId=${(_b = tasks == null ? void 0 : tasks.task) == null ? void 0 : _b.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
|
|
7288
|
-
else
|
|
7289
|
-
alert("No more tasks to review");
|
|
7223
|
+
else alert("No more tasks to review");
|
|
7290
7224
|
} else
|
|
7291
7225
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_c = evolandStore.location) == null ? void 0 : _c.locationId}&taskId=${(_d = evolandStore.location) == null ? void 0 : _d.task[0].task_id}`;
|
|
7292
7226
|
}
|
|
@@ -7335,10 +7269,8 @@ var init_RasterPreview = __esm({
|
|
|
7335
7269
|
parseInt(projectId),
|
|
7336
7270
|
evolandStore.referenceDate
|
|
7337
7271
|
).then(({ location, currentTask, annotation_dates }) => {
|
|
7338
|
-
if (location)
|
|
7339
|
-
|
|
7340
|
-
if (currentTask)
|
|
7341
|
-
evolandStore.setCurrentTask(currentTask);
|
|
7272
|
+
if (location) evolandStore.setLocation(location);
|
|
7273
|
+
if (currentTask) evolandStore.setCurrentTask(currentTask);
|
|
7342
7274
|
evolandStore.setAnnotationDates(annotation_dates);
|
|
7343
7275
|
});
|
|
7344
7276
|
},
|
|
@@ -7374,8 +7306,7 @@ var init_RasterPreview = __esm({
|
|
|
7374
7306
|
evolandStore.setComment(
|
|
7375
7307
|
evolandStore.comment.replace(" #" + x, "")
|
|
7376
7308
|
);
|
|
7377
|
-
else
|
|
7378
|
-
evolandStore.setComment("#" + x + " ");
|
|
7309
|
+
else evolandStore.setComment("#" + x + " ");
|
|
7379
7310
|
},
|
|
7380
7311
|
children: [
|
|
7381
7312
|
"#",
|
|
@@ -7641,7 +7572,7 @@ var init_Annotation = __esm({
|
|
|
7641
7572
|
labelId: 0
|
|
7642
7573
|
});
|
|
7643
7574
|
const [currentLabelItem, setCurrentLabelItem] = (0, import_react16.useState)();
|
|
7644
|
-
const OnSubmitActiveLearning = () => __async(
|
|
7575
|
+
const OnSubmitActiveLearning = () => __async(null, null, function* () {
|
|
7645
7576
|
var _a2, _b2;
|
|
7646
7577
|
setActiveLearningLoading(true);
|
|
7647
7578
|
var bufferData = null;
|
|
@@ -8736,8 +8667,7 @@ var init_ViewAssets = __esm({
|
|
|
8736
8667
|
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
8737
8668
|
assetsByYear = (assets) => assets == null ? void 0 : assets.reduce((acc, item) => {
|
|
8738
8669
|
const year = new Date(item.reference_date).getFullYear();
|
|
8739
|
-
if (!acc[year])
|
|
8740
|
-
acc[year] = [];
|
|
8670
|
+
if (!acc[year]) acc[year] = [];
|
|
8741
8671
|
acc[year].push(item);
|
|
8742
8672
|
return acc;
|
|
8743
8673
|
}, {});
|
|
@@ -8854,14 +8784,10 @@ var init_ViewAssets = __esm({
|
|
|
8854
8784
|
);
|
|
8855
8785
|
if (props.taskId !== void 0 && IsTaskAnnotationLoading)
|
|
8856
8786
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui13.LoaderFull, {});
|
|
8857
|
-
if (maskTab && (masks == null ? void 0 : masks.length) == 0)
|
|
8858
|
-
|
|
8859
|
-
if (
|
|
8860
|
-
|
|
8861
|
-
if (compositesTab && composites.length == 0)
|
|
8862
|
-
checkCompositesAndLoad();
|
|
8863
|
-
if (annotationTab)
|
|
8864
|
-
checkAnnotationsAndLoad();
|
|
8787
|
+
if (maskTab && (masks == null ? void 0 : masks.length) == 0) setMasks(evolandStore.maskAsset);
|
|
8788
|
+
if (changeMaskTab && (changeMasks == null ? void 0 : changeMasks.length) == 0) checkChangeMasksAndLoad();
|
|
8789
|
+
if (compositesTab && composites.length == 0) checkCompositesAndLoad();
|
|
8790
|
+
if (annotationTab) checkAnnotationsAndLoad();
|
|
8865
8791
|
function checkMasksAndLoad() {
|
|
8866
8792
|
if ((masks == null ? void 0 : masks.length) === 0 && !evolandStore.maskAsset) {
|
|
8867
8793
|
evolandStore.getLocationAssets(
|
|
@@ -8872,8 +8798,7 @@ var init_ViewAssets = __esm({
|
|
|
8872
8798
|
).then((res) => {
|
|
8873
8799
|
setMasks(res);
|
|
8874
8800
|
});
|
|
8875
|
-
} else if (masks.length == 0)
|
|
8876
|
-
setMasks(evolandStore.maskAsset);
|
|
8801
|
+
} else if (masks.length == 0) setMasks(evolandStore.maskAsset);
|
|
8877
8802
|
}
|
|
8878
8803
|
function checkChangeMasksAndLoad() {
|
|
8879
8804
|
if ((changeMasks == null ? void 0 : changeMasks.length) === 0 && !evolandStore.changeMaskAsset) {
|
|
@@ -8919,8 +8844,7 @@ var init_ViewAssets = __esm({
|
|
|
8919
8844
|
}
|
|
8920
8845
|
if (props.taskId !== void 0 && IsTaskAnnotationLoading)
|
|
8921
8846
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui13.LoaderFull, {});
|
|
8922
|
-
if (maskTab && ((masks == null ? void 0 : masks.length) == 0 || masks == null))
|
|
8923
|
-
setMaskTab(false);
|
|
8847
|
+
if (maskTab && ((masks == null ? void 0 : masks.length) == 0 || masks == null)) setMaskTab(false);
|
|
8924
8848
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
8925
8849
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
8926
8850
|
"div",
|
|
@@ -9482,8 +9406,7 @@ var init_SearchAnnotation = __esm({
|
|
|
9482
9406
|
localStorage.setItem("toDate", toDate);
|
|
9483
9407
|
if (tasks == null ? void 0 : tasks.exists)
|
|
9484
9408
|
window.location.href = `/map?projectId=${tasks == null ? void 0 : tasks.task.project_id}&locationId=${tasks == null ? void 0 : tasks.task.location_id}&taskId=${tasks == null ? void 0 : tasks.task.task_id}${props.taskForReview ? "&review=true" : ""}`;
|
|
9485
|
-
else
|
|
9486
|
-
alert("No data for search parameters");
|
|
9409
|
+
else alert("No data for search parameters");
|
|
9487
9410
|
},
|
|
9488
9411
|
children: [
|
|
9489
9412
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -9824,14 +9747,11 @@ var init_EvolandLeftSideBar = __esm({
|
|
|
9824
9747
|
}
|
|
9825
9748
|
if (evolandStore.projectDetail) {
|
|
9826
9749
|
if (((_m = (_l = evolandStore.projectDetail) == null ? void 0 : _l.meta_data) == null ? void 0 : _m.default_asset_view) == "SEGMENTATION_MASK" /* SegmentationMask */) {
|
|
9827
|
-
if ((masks == null ? void 0 : masks.length) === 0)
|
|
9828
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9750
|
+
if ((masks == null ? void 0 : masks.length) === 0) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9829
9751
|
} else if (((_o = (_n = evolandStore.projectDetail) == null ? void 0 : _n.meta_data) == null ? void 0 : _o.default_asset_view) == "COMPOSITE" /* Composite */) {
|
|
9830
|
-
if ((composites == null ? void 0 : composites.length) === 0)
|
|
9831
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9752
|
+
if ((composites == null ? void 0 : composites.length) === 0) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9832
9753
|
}
|
|
9833
|
-
} else
|
|
9834
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9754
|
+
} else return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
|
|
9835
9755
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9836
9756
|
"div",
|
|
9837
9757
|
{
|
|
@@ -9998,8 +9918,7 @@ var init_EvolandLeftSideBar = __esm({
|
|
|
9998
9918
|
canDelete = confirm(
|
|
9999
9919
|
(review ? "This is a targeted review task. " : "") + "Are you sure you want to delete this task?"
|
|
10000
9920
|
);
|
|
10001
|
-
if (canDelete)
|
|
10002
|
-
setDeleteTask(true);
|
|
9921
|
+
if (canDelete) setDeleteTask(true);
|
|
10003
9922
|
},
|
|
10004
9923
|
children: [
|
|
10005
9924
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
@@ -10041,8 +9960,7 @@ var init_EvolandLeftSideBar = __esm({
|
|
|
10041
9960
|
evolandStore.setAnnotationDates(annotation_dates);
|
|
10042
9961
|
if (currentTask)
|
|
10043
9962
|
evolandStore.setCurrentTask(currentTask);
|
|
10044
|
-
if (location)
|
|
10045
|
-
evolandStore.setLocation(location);
|
|
9963
|
+
if (location) evolandStore.setLocation(location);
|
|
10046
9964
|
if (props.userRole === "admin")
|
|
10047
9965
|
window.location.href = "/map?projectId=" + projectId + "&locationId=" + (currentTask == null ? void 0 : currentTask.location_id) + "&taskId=" + (currentTask == null ? void 0 : currentTask.task_id) + (evolandStore.task_for_review ? "&review=true" : "");
|
|
10048
9966
|
}
|
|
@@ -10234,10 +10152,9 @@ var init_Questions = __esm({
|
|
|
10234
10152
|
userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
|
|
10235
10153
|
locationLocationId: null
|
|
10236
10154
|
});
|
|
10237
|
-
const onSubmit = (taskStatus) => __async(
|
|
10155
|
+
const onSubmit = (taskStatus) => __async(null, null, function* () {
|
|
10238
10156
|
var _a2, _b2, _c2, _d2, _e2;
|
|
10239
|
-
if (disableSubmit)
|
|
10240
|
-
return;
|
|
10157
|
+
if (disableSubmit) return;
|
|
10241
10158
|
setDisableSubmit(true);
|
|
10242
10159
|
setStatus(taskStatus[0]);
|
|
10243
10160
|
if (evolandStore.currentTask) {
|
|
@@ -10269,8 +10186,7 @@ var init_Questions = __esm({
|
|
|
10269
10186
|
if (props.userRole === "admin") {
|
|
10270
10187
|
if (tasks == null ? void 0 : tasks.task)
|
|
10271
10188
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_d2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _d2.location_id}&taskId=${(_e2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _e2.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
|
|
10272
|
-
else
|
|
10273
|
-
alert("No more tasks to review");
|
|
10189
|
+
else alert("No more tasks to review");
|
|
10274
10190
|
}
|
|
10275
10191
|
var res = yield evolandStore.getNextLocationDetails(
|
|
10276
10192
|
parseInt(projectId)
|
|
@@ -10293,7 +10209,7 @@ var init_Questions = __esm({
|
|
|
10293
10209
|
setSubmitNotificationMessage("");
|
|
10294
10210
|
}
|
|
10295
10211
|
});
|
|
10296
|
-
const onSave = () => __async(
|
|
10212
|
+
const onSave = () => __async(null, null, function* () {
|
|
10297
10213
|
if (evolandStore.currentTask) {
|
|
10298
10214
|
const saveQuestionnaireReq = {
|
|
10299
10215
|
task_id: evolandStore.currentTask.task_id,
|
|
@@ -10312,8 +10228,7 @@ var init_Questions = __esm({
|
|
|
10312
10228
|
setSubmitNotificationMessage(
|
|
10313
10229
|
"Questionnaire has been SAVED successfully"
|
|
10314
10230
|
);
|
|
10315
|
-
else
|
|
10316
|
-
setSubmitNotificationMessage("Please try again");
|
|
10231
|
+
else setSubmitNotificationMessage("Please try again");
|
|
10317
10232
|
setSubmitNotification(true);
|
|
10318
10233
|
}
|
|
10319
10234
|
} catch (err) {
|
|
@@ -10346,8 +10261,7 @@ var init_Questions = __esm({
|
|
|
10346
10261
|
"<" + key + ">",
|
|
10347
10262
|
"" + (label == null ? void 0 : label.labelName)
|
|
10348
10263
|
);
|
|
10349
|
-
} else
|
|
10350
|
-
y.text = y.text.replace("<" + key + ">", "" + value);
|
|
10264
|
+
} else y.text = y.text.replace("<" + key + ">", "" + value);
|
|
10351
10265
|
});
|
|
10352
10266
|
});
|
|
10353
10267
|
}
|
|
@@ -10393,8 +10307,7 @@ var init_Questions = __esm({
|
|
|
10393
10307
|
if (props.userRole === "admin")
|
|
10394
10308
|
if (tasks == null ? void 0 : tasks.task)
|
|
10395
10309
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_c = tasks == null ? void 0 : tasks.task) == null ? void 0 : _c.location_id}&taskId=${(_d = tasks == null ? void 0 : tasks.task) == null ? void 0 : _d.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
|
|
10396
|
-
else
|
|
10397
|
-
alert("No more tasks to review");
|
|
10310
|
+
else alert("No more tasks to review");
|
|
10398
10311
|
} else
|
|
10399
10312
|
window.location.href = `/map?projectId=${projectId}&locationId=${(_e = evolandStore.location) == null ? void 0 : _e.locationId}&taskId=${(_f = evolandStore.location) == null ? void 0 : _f.task[0].task_id}`;
|
|
10400
10313
|
}
|
|
@@ -10509,8 +10422,7 @@ var init_Questions = __esm({
|
|
|
10509
10422
|
evolandStore.setComment(
|
|
10510
10423
|
evolandStore.comment.replace(" #" + x, "")
|
|
10511
10424
|
);
|
|
10512
|
-
else
|
|
10513
|
-
evolandStore.setComment("#" + x + " ");
|
|
10425
|
+
else evolandStore.setComment("#" + x + " ");
|
|
10514
10426
|
},
|
|
10515
10427
|
children: [
|
|
10516
10428
|
"#",
|
|
@@ -10543,8 +10455,7 @@ var init_Questions = __esm({
|
|
|
10543
10455
|
onClick: () => {
|
|
10544
10456
|
if (import_core24.TaskState[x[0]] !== import_core24.TaskState.SKIPPED && import_core24.TaskState[x[0]] !== import_core24.TaskState.DISCARDED && import_core24.TaskState[x[0]] !== import_core24.TaskState.USER_DISCARDED && userAnswers.length !== requiredUserAnswers)
|
|
10545
10457
|
alert("Please provide all answers");
|
|
10546
|
-
else
|
|
10547
|
-
onSubmit(x);
|
|
10458
|
+
else onSubmit(x);
|
|
10548
10459
|
},
|
|
10549
10460
|
children: import_core24.TaskState[x[0]]
|
|
10550
10461
|
}
|
|
@@ -10601,7 +10512,7 @@ var init_TimeSeries = __esm({
|
|
|
10601
10512
|
const bbox4 = [bounds[1], bounds[0], bounds[3], bounds[2]];
|
|
10602
10513
|
const years = changeYears != null ? changeYears : taskChangeYears;
|
|
10603
10514
|
if (years) {
|
|
10604
|
-
years.map((year) => __async(
|
|
10515
|
+
years.map((year) => __async(null, null, function* () {
|
|
10605
10516
|
yield getTimeseries(
|
|
10606
10517
|
year + "-01-01",
|
|
10607
10518
|
year + "-12-31",
|
|
@@ -10636,8 +10547,7 @@ var init_TimeSeries = __esm({
|
|
|
10636
10547
|
})
|
|
10637
10548
|
}
|
|
10638
10549
|
);
|
|
10639
|
-
if (!appendImages)
|
|
10640
|
-
setDetailedImgUrls((yield response.json()).images);
|
|
10550
|
+
if (!appendImages) setDetailedImgUrls((yield response.json()).images);
|
|
10641
10551
|
else {
|
|
10642
10552
|
response.json().then((res) => {
|
|
10643
10553
|
setDetailedImgUrls((prevUrls) => [...prevUrls, ...res.images]);
|
|
@@ -10681,18 +10591,15 @@ var init_TimeSeries = __esm({
|
|
|
10681
10591
|
return 1;
|
|
10682
10592
|
else if (x.substring(x.split("_")[0].length, x.length) < y.substring(y.split("_")[0].length, y.length))
|
|
10683
10593
|
return -1;
|
|
10684
|
-
else
|
|
10685
|
-
return 0;
|
|
10594
|
+
else return 0;
|
|
10686
10595
|
}).map((x, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10687
10596
|
"button",
|
|
10688
10597
|
{
|
|
10689
10598
|
className: currentTab === index ? "pl-1 pr-5 border-gray-300 text-white" : "pl-1 pr-5 border-gray-300 bg-gray-200",
|
|
10690
10599
|
onClick: () => {
|
|
10691
10600
|
setDetailedImgUrls([]);
|
|
10692
|
-
if (x.includes("RGB"))
|
|
10693
|
-
|
|
10694
|
-
else if (x.includes("FCC"))
|
|
10695
|
-
fetchImages("COLOR_INFRARED" /* FCC */);
|
|
10601
|
+
if (x.includes("RGB")) fetchImages("TRUE_COLOR" /* RGB */);
|
|
10602
|
+
else if (x.includes("FCC")) fetchImages("COLOR_INFRARED" /* FCC */);
|
|
10696
10603
|
setCurrentTab(index);
|
|
10697
10604
|
},
|
|
10698
10605
|
children: x.substring(x.split("_")[0].length + 1, x.length)
|
|
@@ -10702,7 +10609,7 @@ var init_TimeSeries = __esm({
|
|
|
10702
10609
|
!evolandStore.isAnnualAnnotation && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10703
10610
|
"button",
|
|
10704
10611
|
{
|
|
10705
|
-
className: currentTab === -1 ? "pl-1 pr-5 border-gray-300 text-white" : "pl-1 pr-5 border-gray-300 bg-
|
|
10612
|
+
className: currentTab === -1 ? "pl-1 pr-5 border-gray-300 text-white" : "pl-1 pr-5 border-gray-300 bg-white text-black",
|
|
10706
10613
|
onClick: () => setCurrentTab(-1),
|
|
10707
10614
|
children: "View Annotations"
|
|
10708
10615
|
}
|
|
@@ -10710,7 +10617,7 @@ var init_TimeSeries = __esm({
|
|
|
10710
10617
|
]
|
|
10711
10618
|
}
|
|
10712
10619
|
),
|
|
10713
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "overflow-x-scroll", children: taskChangeYears == null ? void 0 : taskChangeYears.map((year) => {
|
|
10620
|
+
currentTab !== -1 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "overflow-x-scroll", children: taskChangeYears == null ? void 0 : taskChangeYears.map((year) => {
|
|
10714
10621
|
var _a;
|
|
10715
10622
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
10716
10623
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-full pt-4", children: year }),
|
|
@@ -10720,31 +10627,43 @@ var init_TimeSeries = __esm({
|
|
|
10720
10627
|
var _a2;
|
|
10721
10628
|
return (_a2 = x.minDate) == null ? void 0 : _a2.includes(year);
|
|
10722
10629
|
})) == null ? void 0 : _a.map((x, index) => {
|
|
10723
|
-
var _a2, _b;
|
|
10630
|
+
var _a2, _b, _c;
|
|
10631
|
+
let selected_ref_date = new Date(evolandStore.selectedReferenceDate);
|
|
10632
|
+
let current_date = new Date(x.date);
|
|
10633
|
+
let selected_date;
|
|
10634
|
+
if (selected_ref_date.getMonth() == current_date.getMonth())
|
|
10635
|
+
selected_date = (_a2 = evolandStore.reference_dates) == null ? void 0 : _a2.find((date) => new Date(date).getMonth() + 1 == new Date(x.date).getMonth() + 1);
|
|
10724
10636
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
|
|
10725
10637
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10726
10638
|
"img",
|
|
10727
10639
|
{
|
|
10728
|
-
className: "text-xs w-32 border-y border-x hover:border-blue-500 hover:border-2 hover:cursor-pointer pl-1 pr-1 pb-1" + (((
|
|
10640
|
+
className: "text-xs w-32 border-y border-x hover:border-blue-500 hover:border-2 hover:cursor-pointer pl-1 pr-1 pb-1" + (((_b = evolandStore.selectedCompositeRasterAsset) == null ? void 0 : _b.id) == x.id || !evolandStore.isAnnualAnnotation && evolandStore.selectedReferenceDate == selected_date ? " border-2 border-red-500" : ""),
|
|
10729
10641
|
src: x.imgUrl,
|
|
10730
10642
|
alt: x.date,
|
|
10731
10643
|
onClick: () => {
|
|
10732
|
-
var _a3, _b2,
|
|
10644
|
+
var _a3, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
10733
10645
|
evolandStore.getLegendsDetails(
|
|
10734
10646
|
!evolandStore.isAnnualAnnotation ? evolandStore.reference_dates && evolandStore.selectedReferenceDate ? (_b2 = evolandStore.annotatedRasterAsset) == null ? void 0 : _b2.buffer[(_a3 = evolandStore.reference_dates) == null ? void 0 : _a3.indexOf(
|
|
10735
10647
|
x.date
|
|
10736
|
-
)] : (
|
|
10648
|
+
)] : (_c2 = evolandStore.annotatedRasterAsset) == null ? void 0 : _c2.buffer[0] : (_d = evolandStore.annotatedRasterAsset) == null ? void 0 : _d.buffer
|
|
10737
10649
|
);
|
|
10738
10650
|
if (evolandStore.reference_dates.length > 1) {
|
|
10739
|
-
|
|
10651
|
+
let selected_date2;
|
|
10652
|
+
if (!((_e = evolandStore.reference_dates) == null ? void 0 : _e.find((date) => date == x.date))) {
|
|
10653
|
+
selected_date2 = (_f = evolandStore.reference_dates) == null ? void 0 : _f.find((date) => new Date(date).getMonth() + 1 == new Date(x.date).getMonth() + 1);
|
|
10654
|
+
evolandStore.setSelectedReferenceDate(selected_date2);
|
|
10655
|
+
} else {
|
|
10656
|
+
evolandStore.setSelectedReferenceDate(x.date);
|
|
10657
|
+
selected_date2 = x.date;
|
|
10658
|
+
}
|
|
10740
10659
|
evolandStore.setUpdateAsset(true);
|
|
10741
10660
|
insertEmptyBufferForSingleBand(
|
|
10742
|
-
(
|
|
10661
|
+
(_j = evolandStore.reference_dates && evolandStore.selectedReferenceDate ? (_h = evolandStore.annotatedRasterAsset) == null ? void 0 : _h.buffer[(_g = evolandStore.reference_dates) == null ? void 0 : _g.indexOf(
|
|
10743
10662
|
evolandStore.selectedReferenceDate
|
|
10744
|
-
)] : (
|
|
10745
|
-
(
|
|
10746
|
-
(
|
|
10747
|
-
(
|
|
10663
|
+
)] : (_i = evolandStore.annotatedRasterAsset) == null ? void 0 : _i.buffer[0]) == null ? void 0 : _j.length,
|
|
10664
|
+
(_k = evolandStore.annotatedRasterAsset) == null ? void 0 : _k.width,
|
|
10665
|
+
(_l = evolandStore.annotatedRasterAsset) == null ? void 0 : _l.height,
|
|
10666
|
+
(_m = evolandStore.reference_dates) == null ? void 0 : _m.indexOf(selected_date2),
|
|
10748
10667
|
evolandStore.annotatedRasterAsset,
|
|
10749
10668
|
evolandStore.labels,
|
|
10750
10669
|
evolandStore.isAnnualAnnotation
|
|
@@ -10777,7 +10696,7 @@ var init_TimeSeries = __esm({
|
|
|
10777
10696
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10778
10697
|
"div",
|
|
10779
10698
|
{
|
|
10780
|
-
className: "pl-8 text-xs w-32 text-white " + (((
|
|
10699
|
+
className: "pl-8 text-xs w-32 text-white " + (((_c = evolandStore.selectedCompositeRasterAsset) == null ? void 0 : _c.id) == x.id || !evolandStore.isAnnualAnnotation && evolandStore.selectedReferenceDate == selected_date ? "bg-red-400" : ""),
|
|
10781
10700
|
children: x.date
|
|
10782
10701
|
}
|
|
10783
10702
|
)
|
|
@@ -10786,7 +10705,7 @@ var init_TimeSeries = __esm({
|
|
|
10786
10705
|
] })
|
|
10787
10706
|
] });
|
|
10788
10707
|
}) }),
|
|
10789
|
-
currentTab == -1 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "overflow-x-scroll flex flex-row", children: [
|
|
10708
|
+
currentTab == -1 && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "overflow-x-scroll flex flex-row pt-4", children: [
|
|
10790
10709
|
!evolandStore.annotatedRasterAsset && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: "No annotation" }),
|
|
10791
10710
|
evolandStore.annotatedRasterAsset && evolandStore.annotation_dates && evolandStore.annotation_dates.map(
|
|
10792
10711
|
(annotationDate, index) => {
|
|
@@ -10879,8 +10798,7 @@ var init_OverlayLayer = __esm({
|
|
|
10879
10798
|
if (e.target.value !== "0") {
|
|
10880
10799
|
layerStore.setSelectedLayer(e.target.value);
|
|
10881
10800
|
setShowLayerOpacity(true);
|
|
10882
|
-
if (layerStore.layerOpacity == 0)
|
|
10883
|
-
layerStore.setLayerOpacity(0.4);
|
|
10801
|
+
if (layerStore.layerOpacity == 0) layerStore.setLayerOpacity(0.4);
|
|
10884
10802
|
} else {
|
|
10885
10803
|
setShowLayerOpacity(false);
|
|
10886
10804
|
layerStore.setSelectedLayer("");
|
|
@@ -10944,7 +10862,7 @@ var init_GeoWikiMap = __esm({
|
|
|
10944
10862
|
import_jsx_runtime77 = require("react/jsx-runtime");
|
|
10945
10863
|
GeoWikiMapComponent = ({ mapSettings, session }) => {
|
|
10946
10864
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
10947
|
-
const mapRef = (0, import_react60.useRef)();
|
|
10865
|
+
const mapRef = (0, import_react60.useRef)(void 0);
|
|
10948
10866
|
const router = (0, import_core45.useRouter)();
|
|
10949
10867
|
var projectId = router.query.projectId;
|
|
10950
10868
|
var locationId = router.query.locationId;
|
|
@@ -11331,8 +11249,8 @@ var init_GeoWikiMap = __esm({
|
|
|
11331
11249
|
});
|
|
11332
11250
|
|
|
11333
11251
|
// src/index.tsx
|
|
11334
|
-
var
|
|
11335
|
-
__export(
|
|
11252
|
+
var index_exports = {};
|
|
11253
|
+
__export(index_exports, {
|
|
11336
11254
|
Annotation: () => Annotation,
|
|
11337
11255
|
BasfMap: () => BasfMap,
|
|
11338
11256
|
BasicMap: () => BasicMap,
|
|
@@ -11374,7 +11292,7 @@ __export(src_exports, {
|
|
|
11374
11292
|
useMapLayerStore: () => useMapLayerStore,
|
|
11375
11293
|
useMapStore: () => useMapStore
|
|
11376
11294
|
});
|
|
11377
|
-
module.exports = __toCommonJS(
|
|
11295
|
+
module.exports = __toCommonJS(index_exports);
|
|
11378
11296
|
init_GenericControl();
|
|
11379
11297
|
init_EvoLandGeometry();
|
|
11380
11298
|
init_PointSelection();
|
|
@@ -11592,10 +11510,8 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
11592
11510
|
for (let i = z4; i > 0; i--) {
|
|
11593
11511
|
let digit = 0;
|
|
11594
11512
|
const mask = 1 << i - 1;
|
|
11595
|
-
if ((x & mask) !== 0)
|
|
11596
|
-
|
|
11597
|
-
if ((y & mask) !== 0)
|
|
11598
|
-
digit += 2;
|
|
11513
|
+
if ((x & mask) !== 0) digit += 1;
|
|
11514
|
+
if ((y & mask) !== 0) digit += 2;
|
|
11599
11515
|
quad = quad + digit;
|
|
11600
11516
|
}
|
|
11601
11517
|
return quad;
|
|
@@ -11609,8 +11525,7 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
11609
11525
|
}
|
|
11610
11526
|
loadMetadata() {
|
|
11611
11527
|
var _a;
|
|
11612
|
-
if (this.metaRequested)
|
|
11613
|
-
return;
|
|
11528
|
+
if (this.metaRequested) return;
|
|
11614
11529
|
this.metaRequested = true;
|
|
11615
11530
|
const _this = this;
|
|
11616
11531
|
const cbid = "_bing_metadata_" + L13.Util.stamp(this);
|
|
@@ -11618,8 +11533,7 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
11618
11533
|
var _a2;
|
|
11619
11534
|
window[cbid] = void 0;
|
|
11620
11535
|
const e = document.getElementById(cbid);
|
|
11621
|
-
if (e)
|
|
11622
|
-
(_a2 = e.parentNode) == null ? void 0 : _a2.removeChild(e);
|
|
11536
|
+
if (e) (_a2 = e.parentNode) == null ? void 0 : _a2.removeChild(e);
|
|
11623
11537
|
if (meta.errorDetails) {
|
|
11624
11538
|
console.log(meta.errorDetails);
|
|
11625
11539
|
return;
|
|
@@ -11663,8 +11577,7 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
11663
11577
|
this._update();
|
|
11664
11578
|
}
|
|
11665
11579
|
_update() {
|
|
11666
|
-
if (this._url === null || !this._map)
|
|
11667
|
-
return;
|
|
11580
|
+
if (this._url === null || !this._map) return;
|
|
11668
11581
|
this._update_attribution();
|
|
11669
11582
|
super._update();
|
|
11670
11583
|
}
|
|
@@ -11827,8 +11740,7 @@ var useMapControlStore = (0, import_zustand6.create)((set) => ({
|
|
|
11827
11740
|
})),
|
|
11828
11741
|
toggleControlOpen: (id) => set((state) => {
|
|
11829
11742
|
const targetControl = state.controls.find((c) => c.id === id);
|
|
11830
|
-
if (!targetControl)
|
|
11831
|
-
return state;
|
|
11743
|
+
if (!targetControl) return state;
|
|
11832
11744
|
const targetPosition = targetControl.position;
|
|
11833
11745
|
const shouldOpenTarget = !targetControl.isOpen;
|
|
11834
11746
|
const updatedControls = state.controls.map((control) => {
|
|
@@ -12016,7 +11928,7 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
|
12016
11928
|
var constructLegendUrl = (baseUrl, layer, format, style) => {
|
|
12017
11929
|
return `${baseUrl}?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=${format}&LAYER=${layer}&STYLE=${style}&legend_options=dpi:150`;
|
|
12018
11930
|
};
|
|
12019
|
-
var fetchLegendData = (baseUrl, layerName, format, style) => __async(
|
|
11931
|
+
var fetchLegendData = (baseUrl, layerName, format, style) => __async(null, null, function* () {
|
|
12020
11932
|
const legendGraphicUrl = constructLegendUrl(
|
|
12021
11933
|
baseUrl,
|
|
12022
11934
|
layerName,
|
|
@@ -12817,10 +12729,8 @@ var LayerSwitcher = (0, import_react27.memo)(() => {
|
|
|
12817
12729
|
},
|
|
12818
12730
|
[openHoverCardId]
|
|
12819
12731
|
);
|
|
12820
|
-
if (error)
|
|
12821
|
-
|
|
12822
|
-
if (isLoading)
|
|
12823
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: "Loading layers..." });
|
|
12732
|
+
if (error) return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: "Error loading map layers" });
|
|
12733
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: "Loading layers..." });
|
|
12824
12734
|
const mapMenus = parseMapMenuItems(mapMenuItems);
|
|
12825
12735
|
const hasRegularLayers = (mapMenus == null ? void 0 : mapMenus.length) > 0;
|
|
12826
12736
|
const hasCustomLayers = customLayers.length > 0;
|
|
@@ -13291,8 +13201,7 @@ var MapControlContainer = (0, import_react35.memo)(() => {
|
|
|
13291
13201
|
}, [controls]);
|
|
13292
13202
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_ui24.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: Object.entries(POSITION_CLASSES2).map(([position, className]) => {
|
|
13293
13203
|
const positionControls = controlsByPosition[position] || [];
|
|
13294
|
-
if (positionControls.length === 0)
|
|
13295
|
-
return null;
|
|
13204
|
+
if (positionControls.length === 0) return null;
|
|
13296
13205
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
13297
13206
|
PositionGroup,
|
|
13298
13207
|
{
|
|
@@ -13319,8 +13228,7 @@ var BasicMap = () => {
|
|
|
13319
13228
|
((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
|
|
13320
13229
|
];
|
|
13321
13230
|
(0, import_core33.useRenderInfo)("BasicMap");
|
|
13322
|
-
if (isSettingsLoading)
|
|
13323
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_ui25.LoaderFull, {});
|
|
13231
|
+
if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_ui25.LoaderFull, {});
|
|
13324
13232
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
13325
13233
|
import_react_leaflet15.MapContainer,
|
|
13326
13234
|
{
|
|
@@ -13389,8 +13297,7 @@ var useSelectedPixelStore = (0, import_zustand7.default)((set) => ({
|
|
|
13389
13297
|
set((state) => {
|
|
13390
13298
|
var _a;
|
|
13391
13299
|
const feat = (_a = geoJson.features[0]) == null ? void 0 : _a.id;
|
|
13392
|
-
if (!feat)
|
|
13393
|
-
return state;
|
|
13300
|
+
if (!feat) return state;
|
|
13394
13301
|
const existing = state.data.some(
|
|
13395
13302
|
(item) => item.features[0].id === geoJson.features[0].id
|
|
13396
13303
|
);
|
|
@@ -14056,7 +13963,7 @@ var BasfSelect = () => {
|
|
|
14056
13963
|
[selectedItems]
|
|
14057
13964
|
);
|
|
14058
13965
|
const onSubmit = (0, import_react43.useCallback)(
|
|
14059
|
-
(data) => __async(
|
|
13966
|
+
(data) => __async(null, null, function* () {
|
|
14060
13967
|
setIsSubmitting(true);
|
|
14061
13968
|
try {
|
|
14062
13969
|
if (checkIfItemExists(data)) {
|
|
@@ -14166,8 +14073,7 @@ function PolylineMeasureControl() {
|
|
|
14166
14073
|
const controlRef = (0, import_react44.useRef)(null);
|
|
14167
14074
|
const [active, setActive] = (0, import_react44.useState)(false);
|
|
14168
14075
|
(0, import_react44.useEffect)(() => {
|
|
14169
|
-
if (!map)
|
|
14170
|
-
return;
|
|
14076
|
+
if (!map) return;
|
|
14171
14077
|
controlRef.current = import_leaflet12.default.control.polylineMeasure({
|
|
14172
14078
|
position: "topright",
|
|
14173
14079
|
unit: "metres",
|
|
@@ -14188,8 +14094,7 @@ function PolylineMeasureControl() {
|
|
|
14188
14094
|
};
|
|
14189
14095
|
}, [map]);
|
|
14190
14096
|
const togglePolylineMeasure = () => {
|
|
14191
|
-
if (!controlRef.current)
|
|
14192
|
-
return;
|
|
14097
|
+
if (!controlRef.current) return;
|
|
14193
14098
|
if (!controlRef.current._measureControl) {
|
|
14194
14099
|
console.warn("Measurement control not properly initialized");
|
|
14195
14100
|
return;
|
|
@@ -14205,8 +14110,7 @@ function PolylineMeasureControl() {
|
|
|
14205
14110
|
}
|
|
14206
14111
|
};
|
|
14207
14112
|
const clearMeasurements = () => {
|
|
14208
|
-
if (!controlRef.current)
|
|
14209
|
-
return;
|
|
14113
|
+
if (!controlRef.current) return;
|
|
14210
14114
|
controlRef.current._clearAllMeasurements();
|
|
14211
14115
|
import_core38.trackMapEvent.measurementTool("clear");
|
|
14212
14116
|
};
|
|
@@ -14315,8 +14219,7 @@ var BasfMapComponent = (_a) => {
|
|
|
14315
14219
|
Number((_i = (_h = (_g = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _g.Longitude) == null ? void 0 : _h.Text) != null ? _i : 16.3738)
|
|
14316
14220
|
];
|
|
14317
14221
|
const steps = (_k = (_j = mapSettings == null ? void 0 : mapSettings.MapSettings) == null ? void 0 : _j.TourSteps) == null ? void 0 : _k.Text;
|
|
14318
|
-
if (isSettingsLoading)
|
|
14319
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_ui33.LoaderFull, {});
|
|
14222
|
+
if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_ui33.LoaderFull, {});
|
|
14320
14223
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_jsx_runtime62.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
14321
14224
|
import_react_leaflet19.MapContainer,
|
|
14322
14225
|
__spreadProps(__spreadValues({
|
|
@@ -14386,7 +14289,7 @@ var GeoTreesDownloadContent = () => {
|
|
|
14386
14289
|
}
|
|
14387
14290
|
}, [session, setValue]);
|
|
14388
14291
|
(0, import_react47.useEffect)(() => {
|
|
14389
|
-
const fetchCountries = () => __async(
|
|
14292
|
+
const fetchCountries = () => __async(null, null, function* () {
|
|
14390
14293
|
try {
|
|
14391
14294
|
const response = yield fetch(
|
|
14392
14295
|
`${baseUrl}/api/plots/get-available-countries`,
|
|
@@ -14402,7 +14305,7 @@ var GeoTreesDownloadContent = () => {
|
|
|
14402
14305
|
console.error("Error fetching countries:", error);
|
|
14403
14306
|
}
|
|
14404
14307
|
});
|
|
14405
|
-
const fetchVersions = () => __async(
|
|
14308
|
+
const fetchVersions = () => __async(null, null, function* () {
|
|
14406
14309
|
try {
|
|
14407
14310
|
const response = yield fetch(
|
|
14408
14311
|
`${baseUrl}/api/plots/available-versions`,
|
|
@@ -14656,8 +14559,7 @@ var ScaleControl3 = ({
|
|
|
14656
14559
|
const [scale, setScale] = (0, import_react48.useState)("");
|
|
14657
14560
|
(0, import_react48.useEffect)(() => {
|
|
14658
14561
|
const updateScale = () => {
|
|
14659
|
-
if (!map)
|
|
14660
|
-
return;
|
|
14562
|
+
if (!map) return;
|
|
14661
14563
|
const center4 = map.getCenter();
|
|
14662
14564
|
const zoom = map.getZoom();
|
|
14663
14565
|
const metersPerPixel = 156543.03392 * Math.cos(center4.lat * Math.PI / 180) / Math.pow(2, zoom);
|
|
@@ -14673,8 +14575,7 @@ var ScaleControl3 = ({
|
|
|
14673
14575
|
map.off("moveend", updateScale);
|
|
14674
14576
|
};
|
|
14675
14577
|
}, [map]);
|
|
14676
|
-
if (!scale)
|
|
14677
|
-
return null;
|
|
14578
|
+
if (!scale) return null;
|
|
14678
14579
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14679
14580
|
"div",
|
|
14680
14581
|
{
|
|
@@ -15273,7 +15174,7 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
|
|
|
15273
15174
|
const externalUrl = `${API_URL}/api/external/google-sheet-geojson`;
|
|
15274
15175
|
const { isLoading, error, data } = (0, import_react_query5.useQuery)({
|
|
15275
15176
|
queryKey: ["geoTreesExternal", externalUrl],
|
|
15276
|
-
queryFn: () => __async(
|
|
15177
|
+
queryFn: () => __async(null, null, function* () {
|
|
15277
15178
|
if (!API_URL) {
|
|
15278
15179
|
throw new Error("NEXT_PUBLIC_GEO_TREE_API_URL is not configured");
|
|
15279
15180
|
}
|
|
@@ -15305,8 +15206,7 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
|
|
|
15305
15206
|
);
|
|
15306
15207
|
const addGeoTreesLayer = (0, import_react51.useCallback)(() => {
|
|
15307
15208
|
var _a2;
|
|
15308
|
-
if (!data)
|
|
15309
|
-
return;
|
|
15209
|
+
if (!data) return;
|
|
15310
15210
|
const layerId = "geotrees-external-layer";
|
|
15311
15211
|
if (hasLayerBeenAdded(layerId) || existingLayer || hasAddedLayer.current) {
|
|
15312
15212
|
console.warn("GEO-TREES BRM layer already exists, skipping addition", {
|
|
@@ -15319,8 +15219,7 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
|
|
|
15319
15219
|
const filteredFeatures = ((_a2 = data.features) == null ? void 0 : _a2.filter((feature) => {
|
|
15320
15220
|
var _a3;
|
|
15321
15221
|
const status = (_a3 = feature.properties) == null ? void 0 : _a3.Status;
|
|
15322
|
-
if (!status)
|
|
15323
|
-
return true;
|
|
15222
|
+
if (!status) return true;
|
|
15324
15223
|
const statusKey = getStatusFromRaw(status);
|
|
15325
15224
|
return statusKey ? statusFilter[statusKey] : true;
|
|
15326
15225
|
})) || [];
|
|
@@ -15388,12 +15287,9 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
|
|
|
15388
15287
|
addGeoTreesLayer();
|
|
15389
15288
|
}
|
|
15390
15289
|
}, [data, autoAdd, existingLayer, addGeoTreesLayer, hasLayerBeenAdded]);
|
|
15391
|
-
if (error)
|
|
15392
|
-
|
|
15393
|
-
if (
|
|
15394
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(LoadingDisplay, {});
|
|
15395
|
-
if (!((_a = data == null ? void 0 : data.features) == null ? void 0 : _a.length))
|
|
15396
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EmptyStateDisplay, {});
|
|
15290
|
+
if (error) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ErrorDisplay, { error });
|
|
15291
|
+
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(LoadingDisplay, {});
|
|
15292
|
+
if (!((_a = data == null ? void 0 : data.features) == null ? void 0 : _a.length)) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EmptyStateDisplay, {});
|
|
15397
15293
|
return null;
|
|
15398
15294
|
}
|
|
15399
15295
|
);
|
|
@@ -15444,8 +15340,7 @@ var GeoTreesMap = () => {
|
|
|
15444
15340
|
"Error loading map settings: ",
|
|
15445
15341
|
error.message
|
|
15446
15342
|
] }) });
|
|
15447
|
-
if (isSettingsLoading)
|
|
15448
|
-
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_ui35.LoaderFull, { showInCenter: false });
|
|
15343
|
+
if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_ui35.LoaderFull, { showInCenter: false });
|
|
15449
15344
|
const zoom = (_c = (_b = (_a = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _a.Zoom) == null ? void 0 : _b.Value) != null ? _c : 12;
|
|
15450
15345
|
const center4 = [
|
|
15451
15346
|
(_f = (_e = (_d = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _d.Latitude) == null ? void 0 : _e.Text) != null ? _f : 48.2082,
|
|
@@ -15506,8 +15401,7 @@ var useAreaSelect = ({
|
|
|
15506
15401
|
const rectangleRef = (0, import_react53.useRef)(null);
|
|
15507
15402
|
(0, import_react53.useEffect)(() => {
|
|
15508
15403
|
var _a;
|
|
15509
|
-
if (!map.selectArea)
|
|
15510
|
-
return;
|
|
15404
|
+
if (!map.selectArea) return;
|
|
15511
15405
|
(_a = map.selectArea) == null ? void 0 : _a.setControlKey(false);
|
|
15512
15406
|
if (!rectangleRef.current) {
|
|
15513
15407
|
rectangleRef.current = new import_leaflet17.Rectangle(
|
|
@@ -15520,8 +15414,7 @@ var useAreaSelect = ({
|
|
|
15520
15414
|
}
|
|
15521
15415
|
const handleAreaSelected = (e) => {
|
|
15522
15416
|
var _a2, _b, _c;
|
|
15523
|
-
if (!e.bounds)
|
|
15524
|
-
return;
|
|
15417
|
+
if (!e.bounds) return;
|
|
15525
15418
|
const boundsString = e.bounds.toBBoxString();
|
|
15526
15419
|
if (onAreaSelected) {
|
|
15527
15420
|
onAreaSelected(boundsString);
|
|
@@ -15594,9 +15487,8 @@ var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
|
15594
15487
|
var CanopyAtlasDownload = () => {
|
|
15595
15488
|
const [format, setFormat] = (0, import_react54.useState)("shape-zip");
|
|
15596
15489
|
const { bbox: bbox4 } = useAreaSelectStore();
|
|
15597
|
-
const handleDownload = () => __async(
|
|
15598
|
-
if (!bbox4)
|
|
15599
|
-
return;
|
|
15490
|
+
const handleDownload = () => __async(null, null, function* () {
|
|
15491
|
+
if (!bbox4) return;
|
|
15600
15492
|
const params = {
|
|
15601
15493
|
request: "GetFeature",
|
|
15602
15494
|
service: "WFS",
|
|
@@ -15611,8 +15503,7 @@ var CanopyAtlasDownload = () => {
|
|
|
15611
15503
|
const wfsUrl = baseUrl + import_leaflet18.default.Util.getParamString(params, baseUrl, true);
|
|
15612
15504
|
try {
|
|
15613
15505
|
const response = yield fetch(wfsUrl);
|
|
15614
|
-
if (!response.ok)
|
|
15615
|
-
throw new Error("Download failed");
|
|
15506
|
+
if (!response.ok) throw new Error("Download failed");
|
|
15616
15507
|
const blob = yield response.blob();
|
|
15617
15508
|
const url = window.URL.createObjectURL(blob);
|
|
15618
15509
|
const a = document.createElement("a");
|
|
@@ -15786,20 +15677,15 @@ var CanopyFilter = (0, import_react55.memo)(({ onFilterChange }) => {
|
|
|
15786
15677
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(updatedFilters));
|
|
15787
15678
|
onFilterChange(updatedFilters);
|
|
15788
15679
|
};
|
|
15789
|
-
const handleDownload = () => __async(
|
|
15680
|
+
const handleDownload = () => __async(null, null, function* () {
|
|
15790
15681
|
const cqlFilters = [];
|
|
15791
|
-
if (filters.biome)
|
|
15792
|
-
|
|
15793
|
-
if (filters.
|
|
15794
|
-
cqlFilters.push(`realm='${filters.realm}'`);
|
|
15795
|
-
if (filters.access)
|
|
15796
|
-
cqlFilters.push(`access='${filters.access}'`);
|
|
15682
|
+
if (filters.biome) cqlFilters.push(`biome='${filters.biome}'`);
|
|
15683
|
+
if (filters.realm) cqlFilters.push(`realm='${filters.realm}'`);
|
|
15684
|
+
if (filters.access) cqlFilters.push(`access='${filters.access}'`);
|
|
15797
15685
|
if (filters.idunique)
|
|
15798
15686
|
cqlFilters.push(`IDunique LIKE '%${filters.idunique}%'`);
|
|
15799
|
-
if (filters.minyear)
|
|
15800
|
-
|
|
15801
|
-
if (filters.maxyear)
|
|
15802
|
-
cqlFilters.push(`minyear<=${filters.maxyear}`);
|
|
15687
|
+
if (filters.minyear) cqlFilters.push(`minyear>=${filters.minyear}`);
|
|
15688
|
+
if (filters.maxyear) cqlFilters.push(`minyear<=${filters.maxyear}`);
|
|
15803
15689
|
const params = __spreadValues({
|
|
15804
15690
|
request: "GetFeature",
|
|
15805
15691
|
service: "WFS",
|
|
@@ -15813,8 +15699,7 @@ var CanopyFilter = (0, import_react55.memo)(({ onFilterChange }) => {
|
|
|
15813
15699
|
const wfsUrl = baseUrl + import_leaflet19.default.Util.getParamString(params, baseUrl, true);
|
|
15814
15700
|
try {
|
|
15815
15701
|
const response = yield fetch(wfsUrl);
|
|
15816
|
-
if (!response.ok)
|
|
15817
|
-
throw new Error("Download failed");
|
|
15702
|
+
if (!response.ok) throw new Error("Download failed");
|
|
15818
15703
|
const blob = yield response.blob();
|
|
15819
15704
|
const url = window.URL.createObjectURL(blob);
|
|
15820
15705
|
const a = document.createElement("a");
|
|
@@ -16050,10 +15935,8 @@ var constructCqlFilter = (filterParams) => {
|
|
|
16050
15935
|
return "";
|
|
16051
15936
|
}
|
|
16052
15937
|
let _a = filterParams || {}, { minyear, maxyear } = _a, rest = __objRest(_a, ["minyear", "maxyear"]);
|
|
16053
|
-
if (Array.isArray(minyear))
|
|
16054
|
-
|
|
16055
|
-
if (Array.isArray(maxyear))
|
|
16056
|
-
maxyear = maxyear[0];
|
|
15938
|
+
if (Array.isArray(minyear)) minyear = minyear[0];
|
|
15939
|
+
if (Array.isArray(maxyear)) maxyear = maxyear[0];
|
|
16057
15940
|
const cqlExpressions = [];
|
|
16058
15941
|
if (minyear && maxyear) {
|
|
16059
15942
|
cqlExpressions.push(
|
|
@@ -16160,16 +16043,14 @@ var formatPropertyValue = (value, propertyName) => {
|
|
|
16160
16043
|
return value.toString();
|
|
16161
16044
|
};
|
|
16162
16045
|
var createDefaultPopupContent = (feature, propertyNames) => {
|
|
16163
|
-
if (!feature.properties)
|
|
16164
|
-
return "";
|
|
16046
|
+
if (!feature.properties) return "";
|
|
16165
16047
|
const propertiesToShow = (propertyNames == null ? void 0 : propertyNames.length) ? propertyNames : DEFAULT_POPUP_PROPERTIES;
|
|
16166
16048
|
const properties = Object.entries(feature.properties).filter(([key]) => propertiesToShow.includes(key)).sort((a, b) => {
|
|
16167
16049
|
const indexA = propertiesToShow.indexOf(a[0]);
|
|
16168
16050
|
const indexB = propertiesToShow.indexOf(b[0]);
|
|
16169
16051
|
return indexA - indexB;
|
|
16170
16052
|
});
|
|
16171
|
-
if (properties.length === 0)
|
|
16172
|
-
return "";
|
|
16053
|
+
if (properties.length === 0) return "";
|
|
16173
16054
|
return `
|
|
16174
16055
|
<div class="leaflet-popup-content-wrapper" style="background-color: #fff; padding: 0; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.15);">
|
|
16175
16056
|
<div style="width: 100%; overflow-y: auto;">
|
|
@@ -16240,7 +16121,7 @@ var openDatabase = () => {
|
|
|
16240
16121
|
};
|
|
16241
16122
|
});
|
|
16242
16123
|
};
|
|
16243
|
-
var storeInIndexedDB = (key, data) => __async(
|
|
16124
|
+
var storeInIndexedDB = (key, data) => __async(null, null, function* () {
|
|
16244
16125
|
try {
|
|
16245
16126
|
const db = yield openDatabase();
|
|
16246
16127
|
const transaction = db.transaction(STORE_NAME, "readwrite");
|
|
@@ -16259,7 +16140,7 @@ var storeInIndexedDB = (key, data) => __async(void 0, null, function* () {
|
|
|
16259
16140
|
console.warn("Failed to store data in IndexedDB:", e);
|
|
16260
16141
|
}
|
|
16261
16142
|
});
|
|
16262
|
-
var getFromIndexedDB = (key) => __async(
|
|
16143
|
+
var getFromIndexedDB = (key) => __async(null, null, function* () {
|
|
16263
16144
|
try {
|
|
16264
16145
|
const db = yield openDatabase();
|
|
16265
16146
|
const transaction = db.transaction(STORE_NAME, "readonly");
|
|
@@ -16281,7 +16162,7 @@ var getFromIndexedDB = (key) => __async(void 0, null, function* () {
|
|
|
16281
16162
|
return null;
|
|
16282
16163
|
}
|
|
16283
16164
|
});
|
|
16284
|
-
var cleanupIndexedDB = () => __async(
|
|
16165
|
+
var cleanupIndexedDB = () => __async(null, null, function* () {
|
|
16285
16166
|
try {
|
|
16286
16167
|
const db = yield openDatabase();
|
|
16287
16168
|
const transaction = db.transaction(STORE_NAME, "readwrite");
|
|
@@ -16331,8 +16212,7 @@ var WfsLayer = ({
|
|
|
16331
16212
|
}
|
|
16332
16213
|
});
|
|
16333
16214
|
const stableFilterParams = (0, import_react56.useMemo)(() => {
|
|
16334
|
-
if (!filterParams)
|
|
16335
|
-
return null;
|
|
16215
|
+
if (!filterParams) return null;
|
|
16336
16216
|
return JSON.stringify(filterParams);
|
|
16337
16217
|
}, [filterParams]);
|
|
16338
16218
|
const queryKey = (0, import_react56.useMemo)(() => {
|
|
@@ -16354,7 +16234,7 @@ var WfsLayer = ({
|
|
|
16354
16234
|
}, [url, layerName, filterParams, useServerFiltering]);
|
|
16355
16235
|
const { data: geoJsonData, error } = (0, import_react_query6.useQuery)({
|
|
16356
16236
|
queryKey,
|
|
16357
|
-
queryFn: () => __async(
|
|
16237
|
+
queryFn: () => __async(null, null, function* () {
|
|
16358
16238
|
mapStore.setIsLoading(true);
|
|
16359
16239
|
const wfsUrl = constructWfsUrl();
|
|
16360
16240
|
const storageKey = `wfs-data-${queryKey.join("-")}`;
|
|
@@ -16419,8 +16299,7 @@ var WfsLayer = ({
|
|
|
16419
16299
|
const getFeatureStyle = (0, import_react56.useCallback)(
|
|
16420
16300
|
(feature) => {
|
|
16421
16301
|
var _a2;
|
|
16422
|
-
if (!feature)
|
|
16423
|
-
return defaultStyle;
|
|
16302
|
+
if (!feature) return defaultStyle;
|
|
16424
16303
|
const featureId = ((_a2 = feature.id) == null ? void 0 : _a2.toString()) || JSON.stringify(feature.properties);
|
|
16425
16304
|
return featureId === selectedFeatureId ? highlightStyle : defaultStyle;
|
|
16426
16305
|
},
|
|
@@ -16431,8 +16310,7 @@ var WfsLayer = ({
|
|
|
16431
16310
|
var _a2;
|
|
16432
16311
|
const featureId = ((_a2 = feature.id) == null ? void 0 : _a2.toString()) || JSON.stringify(feature.properties);
|
|
16433
16312
|
layerRef.current[featureId] = layer;
|
|
16434
|
-
if (!popupOptions || !feature.properties)
|
|
16435
|
-
return;
|
|
16313
|
+
if (!popupOptions || !feature.properties) return;
|
|
16436
16314
|
let popupContent;
|
|
16437
16315
|
if (popupOptions.renderContent) {
|
|
16438
16316
|
popupContent = popupOptions.renderContent(feature);
|
|
@@ -16477,8 +16355,7 @@ var WfsLayer = ({
|
|
|
16477
16355
|
[]
|
|
16478
16356
|
);
|
|
16479
16357
|
const filteredGeoJson = (0, import_react56.useMemo)(() => {
|
|
16480
|
-
if (!geoJsonData)
|
|
16481
|
-
return null;
|
|
16358
|
+
if (!geoJsonData) return null;
|
|
16482
16359
|
if (useServerFiltering || !filterParams || Object.keys(filterParams).length === 0) {
|
|
16483
16360
|
return geoJsonData;
|
|
16484
16361
|
}
|
|
@@ -16715,15 +16592,14 @@ var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
|
16715
16592
|
var CanopyMap = () => {
|
|
16716
16593
|
var _a, _b, _c, _d, _e, _f;
|
|
16717
16594
|
const { data: mapSettings, isLoading: isSettingsLoading } = (0, import_useMapSettings4.default)();
|
|
16718
|
-
const mapRef = (0, import_react58.useRef)();
|
|
16595
|
+
const mapRef = (0, import_react58.useRef)(void 0);
|
|
16719
16596
|
const zoom = ((_b = (_a = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _a.Zoom) == null ? void 0 : _b.Value) || 5;
|
|
16720
16597
|
const center4 = [
|
|
16721
16598
|
((_d = (_c = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _c.Latitude) == null ? void 0 : _d.Text) || 48.2082,
|
|
16722
16599
|
((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
|
|
16723
16600
|
];
|
|
16724
16601
|
(0, import_core41.useRenderInfo)("BasicMap");
|
|
16725
|
-
if (isSettingsLoading)
|
|
16726
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_ui41.LoaderFull, { showInCenter: false });
|
|
16602
|
+
if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_ui41.LoaderFull, { showInCenter: false });
|
|
16727
16603
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_jsx_runtime74.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
16728
16604
|
import_react_leaflet27.MapContainer,
|
|
16729
16605
|
{
|
|
@@ -16847,7 +16723,7 @@ var BasfLeftPanel = () => {
|
|
|
16847
16723
|
[selectedItems]
|
|
16848
16724
|
);
|
|
16849
16725
|
const onSubmit = (0, import_react59.useCallback)(
|
|
16850
|
-
(data) => __async(
|
|
16726
|
+
(data) => __async(null, null, function* () {
|
|
16851
16727
|
setIsSubmitting(true);
|
|
16852
16728
|
try {
|
|
16853
16729
|
if (checkIfItemExists(data)) {
|
|
@@ -16953,8 +16829,7 @@ var WaybackTimelineMap = (props) => {
|
|
|
16953
16829
|
return null;
|
|
16954
16830
|
}
|
|
16955
16831
|
(0, import_react61.useEffect)(() => {
|
|
16956
|
-
if (props.mapping)
|
|
16957
|
-
setWAYBACK_SNAPSHOTS(props.mapping);
|
|
16832
|
+
if (props.mapping) setWAYBACK_SNAPSHOTS(props.mapping);
|
|
16958
16833
|
}, [props.mapping]);
|
|
16959
16834
|
const west = parseFloat(searchParams.get("xmin"));
|
|
16960
16835
|
const south = parseFloat(searchParams.get("ymin"));
|
|
@@ -17353,7 +17228,7 @@ var LayerItem2 = (0, import_react62.memo)(
|
|
|
17353
17228
|
}
|
|
17354
17229
|
);
|
|
17355
17230
|
LayerItem2.displayName = "LayerItem";
|
|
17356
|
-
var LayerSwitcher2 = (0, import_react62.memo)(({ mapMenuItems, customLayers }) => {
|
|
17231
|
+
var LayerSwitcher2 = (0, import_react62.memo)((({ mapMenuItems, customLayers }) => {
|
|
17357
17232
|
const store = useMapLayerStore2();
|
|
17358
17233
|
const [openHoverCardId, setOpenHoverCardId] = (0, import_react62.useState)(null);
|
|
17359
17234
|
(0, import_react62.useEffect)(() => {
|
|
@@ -17409,8 +17284,7 @@ var LayerSwitcher2 = (0, import_react62.memo)(({ mapMenuItems, customLayers }) =
|
|
|
17409
17284
|
) !== -1,
|
|
17410
17285
|
onToggle: () => {
|
|
17411
17286
|
handleToggle(layer);
|
|
17412
|
-
if (layer.ontoggle)
|
|
17413
|
-
layer.ontoggle();
|
|
17287
|
+
if (layer.ontoggle) layer.ontoggle();
|
|
17414
17288
|
},
|
|
17415
17289
|
openHoverCardId,
|
|
17416
17290
|
onInfoClick: handleInfoClick
|
|
@@ -17466,7 +17340,7 @@ var LayerSwitcher2 = (0, import_react62.memo)(({ mapMenuItems, customLayers }) =
|
|
|
17466
17340
|
] })
|
|
17467
17341
|
] }, menu.id);
|
|
17468
17342
|
}) });
|
|
17469
|
-
});
|
|
17343
|
+
}));
|
|
17470
17344
|
LayerSwitcher2.displayName = "LayerSwitcher";
|
|
17471
17345
|
|
|
17472
17346
|
// src/Components/Generic/Map/MapControlToolbar.tsx
|
|
@@ -17476,21 +17350,15 @@ var import_ui45 = require("@geowiki/ui");
|
|
|
17476
17350
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
17477
17351
|
function r(e) {
|
|
17478
17352
|
var t, f, n = "";
|
|
17479
|
-
if ("string" == typeof e || "number" == typeof e)
|
|
17480
|
-
|
|
17481
|
-
|
|
17482
|
-
|
|
17483
|
-
|
|
17484
|
-
for (t = 0; t < o; t++)
|
|
17485
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
17486
|
-
} else
|
|
17487
|
-
for (f in e)
|
|
17488
|
-
e[f] && (n && (n += " "), n += f);
|
|
17353
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
17354
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
17355
|
+
var o = e.length;
|
|
17356
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
17357
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
17489
17358
|
return n;
|
|
17490
17359
|
}
|
|
17491
17360
|
function clsx() {
|
|
17492
|
-
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++)
|
|
17493
|
-
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
17361
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
17494
17362
|
return n;
|
|
17495
17363
|
}
|
|
17496
17364
|
|
|
@@ -17871,7 +17739,7 @@ var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
|
|
|
17871
17739
|
var fractionRegex = /^\d+\/\d+$/;
|
|
17872
17740
|
var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
|
|
17873
17741
|
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
17874
|
-
var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))
|
|
17742
|
+
var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
|
|
17875
17743
|
var shadowRegex = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
17876
17744
|
function isLength(value) {
|
|
17877
17745
|
return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value) || isArbitraryLength(value);
|
|
@@ -17971,8 +17839,11 @@ function getDefaultConfig() {
|
|
|
17971
17839
|
var getOverflow = function getOverflow2() {
|
|
17972
17840
|
return ["auto", "hidden", "clip", "visible", "scroll"];
|
|
17973
17841
|
};
|
|
17974
|
-
var
|
|
17975
|
-
return ["auto", spacing];
|
|
17842
|
+
var getSpacingWithAutoAndArbitrary = function getSpacingWithAutoAndArbitrary2() {
|
|
17843
|
+
return ["auto", isArbitraryValue, spacing];
|
|
17844
|
+
};
|
|
17845
|
+
var getSpacingWithArbitrary = function getSpacingWithArbitrary2() {
|
|
17846
|
+
return [isArbitraryValue, spacing];
|
|
17976
17847
|
};
|
|
17977
17848
|
var getLengthWithEmpty = function getLengthWithEmpty2() {
|
|
17978
17849
|
return ["", isLength];
|
|
@@ -18009,29 +17880,29 @@ function getDefaultConfig() {
|
|
|
18009
17880
|
theme: {
|
|
18010
17881
|
colors: [isAny],
|
|
18011
17882
|
spacing: [isLength],
|
|
18012
|
-
blur: ["none", "", isTshirtSize,
|
|
17883
|
+
blur: ["none", "", isTshirtSize, isArbitraryValue],
|
|
18013
17884
|
brightness: getNumber(),
|
|
18014
17885
|
borderColor: [colors],
|
|
18015
|
-
borderRadius: ["none", "", "full", isTshirtSize,
|
|
18016
|
-
borderSpacing:
|
|
17886
|
+
borderRadius: ["none", "", "full", isTshirtSize, isArbitraryValue],
|
|
17887
|
+
borderSpacing: getSpacingWithArbitrary(),
|
|
18017
17888
|
borderWidth: getLengthWithEmpty(),
|
|
18018
17889
|
contrast: getNumber(),
|
|
18019
17890
|
grayscale: getZeroAndEmpty(),
|
|
18020
17891
|
hueRotate: getNumberAndArbitrary(),
|
|
18021
17892
|
invert: getZeroAndEmpty(),
|
|
18022
|
-
gap:
|
|
17893
|
+
gap: getSpacingWithArbitrary(),
|
|
18023
17894
|
gradientColorStops: [colors],
|
|
18024
17895
|
gradientColorStopPositions: [isPercent, isArbitraryLength],
|
|
18025
|
-
inset:
|
|
18026
|
-
margin:
|
|
17896
|
+
inset: getSpacingWithAutoAndArbitrary(),
|
|
17897
|
+
margin: getSpacingWithAutoAndArbitrary(),
|
|
18027
17898
|
opacity: getNumber(),
|
|
18028
|
-
padding:
|
|
17899
|
+
padding: getSpacingWithArbitrary(),
|
|
18029
17900
|
saturate: getNumber(),
|
|
18030
17901
|
scale: getNumber(),
|
|
18031
17902
|
sepia: getZeroAndEmpty(),
|
|
18032
17903
|
skew: getNumberAndArbitrary(),
|
|
18033
|
-
space:
|
|
18034
|
-
translate:
|
|
17904
|
+
space: getSpacingWithArbitrary(),
|
|
17905
|
+
translate: getSpacingWithArbitrary()
|
|
18035
17906
|
},
|
|
18036
17907
|
classGroups: {
|
|
18037
17908
|
// Layout
|
|
@@ -18255,7 +18126,7 @@ function getDefaultConfig() {
|
|
|
18255
18126
|
* @see https://tailwindcss.com/docs/flex-basis
|
|
18256
18127
|
*/
|
|
18257
18128
|
basis: [{
|
|
18258
|
-
basis:
|
|
18129
|
+
basis: getSpacingWithAutoAndArbitrary()
|
|
18259
18130
|
}],
|
|
18260
18131
|
/**
|
|
18261
18132
|
* Flex Direction
|
|
@@ -18312,7 +18183,7 @@ function getDefaultConfig() {
|
|
|
18312
18183
|
*/
|
|
18313
18184
|
"col-start-end": [{
|
|
18314
18185
|
col: ["auto", {
|
|
18315
|
-
span: [isInteger]
|
|
18186
|
+
span: ["full", isInteger]
|
|
18316
18187
|
}, isArbitraryValue]
|
|
18317
18188
|
}],
|
|
18318
18189
|
/**
|
|
@@ -18621,14 +18492,14 @@ function getDefaultConfig() {
|
|
|
18621
18492
|
* @see https://tailwindcss.com/docs/width
|
|
18622
18493
|
*/
|
|
18623
18494
|
w: [{
|
|
18624
|
-
w: ["auto", "min", "max", "fit", spacing]
|
|
18495
|
+
w: ["auto", "min", "max", "fit", isArbitraryValue, spacing]
|
|
18625
18496
|
}],
|
|
18626
18497
|
/**
|
|
18627
18498
|
* Min-Width
|
|
18628
18499
|
* @see https://tailwindcss.com/docs/min-width
|
|
18629
18500
|
*/
|
|
18630
18501
|
"min-w": [{
|
|
18631
|
-
"min-w": ["min", "max", "fit", isLength]
|
|
18502
|
+
"min-w": ["min", "max", "fit", isArbitraryValue, isLength]
|
|
18632
18503
|
}],
|
|
18633
18504
|
/**
|
|
18634
18505
|
* Max-Width
|
|
@@ -18637,28 +18508,28 @@ function getDefaultConfig() {
|
|
|
18637
18508
|
"max-w": [{
|
|
18638
18509
|
"max-w": ["0", "none", "full", "min", "max", "fit", "prose", {
|
|
18639
18510
|
screen: [isTshirtSize]
|
|
18640
|
-
}, isTshirtSize,
|
|
18511
|
+
}, isTshirtSize, isArbitraryValue]
|
|
18641
18512
|
}],
|
|
18642
18513
|
/**
|
|
18643
18514
|
* Height
|
|
18644
18515
|
* @see https://tailwindcss.com/docs/height
|
|
18645
18516
|
*/
|
|
18646
18517
|
h: [{
|
|
18647
|
-
h: [spacing, "auto", "min", "max", "fit"]
|
|
18518
|
+
h: [isArbitraryValue, spacing, "auto", "min", "max", "fit"]
|
|
18648
18519
|
}],
|
|
18649
18520
|
/**
|
|
18650
18521
|
* Min-Height
|
|
18651
18522
|
* @see https://tailwindcss.com/docs/min-height
|
|
18652
18523
|
*/
|
|
18653
18524
|
"min-h": [{
|
|
18654
|
-
"min-h": ["min", "max", "fit", isLength]
|
|
18525
|
+
"min-h": ["min", "max", "fit", isArbitraryValue, isLength]
|
|
18655
18526
|
}],
|
|
18656
18527
|
/**
|
|
18657
18528
|
* Max-Height
|
|
18658
18529
|
* @see https://tailwindcss.com/docs/max-height
|
|
18659
18530
|
*/
|
|
18660
18531
|
"max-h": [{
|
|
18661
|
-
"max-h": [spacing, "min", "max", "fit"]
|
|
18532
|
+
"max-h": [isArbitraryValue, spacing, "min", "max", "fit"]
|
|
18662
18533
|
}],
|
|
18663
18534
|
// Typography
|
|
18664
18535
|
/**
|
|
@@ -18727,7 +18598,7 @@ function getDefaultConfig() {
|
|
|
18727
18598
|
* @see https://tailwindcss.com/docs/letter-spacing
|
|
18728
18599
|
*/
|
|
18729
18600
|
tracking: [{
|
|
18730
|
-
tracking: ["tighter", "tight", "normal", "wide", "wider", "widest",
|
|
18601
|
+
tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", isArbitraryValue]
|
|
18731
18602
|
}],
|
|
18732
18603
|
/**
|
|
18733
18604
|
* Line Clamp
|
|
@@ -18741,7 +18612,7 @@ function getDefaultConfig() {
|
|
|
18741
18612
|
* @see https://tailwindcss.com/docs/line-height
|
|
18742
18613
|
*/
|
|
18743
18614
|
leading: [{
|
|
18744
|
-
leading: ["none", "tight", "snug", "normal", "relaxed", "loose", isLength]
|
|
18615
|
+
leading: ["none", "tight", "snug", "normal", "relaxed", "loose", isArbitraryValue, isLength]
|
|
18745
18616
|
}],
|
|
18746
18617
|
/**
|
|
18747
18618
|
* List Style Image
|
|
@@ -18824,7 +18695,7 @@ function getDefaultConfig() {
|
|
|
18824
18695
|
* @see https://tailwindcss.com/docs/text-underline-offset
|
|
18825
18696
|
*/
|
|
18826
18697
|
"underline-offset": [{
|
|
18827
|
-
"underline-offset": ["auto", isLength]
|
|
18698
|
+
"underline-offset": ["auto", isArbitraryValue, isLength]
|
|
18828
18699
|
}],
|
|
18829
18700
|
/**
|
|
18830
18701
|
* Text Decoration Color
|
|
@@ -18848,14 +18719,14 @@ function getDefaultConfig() {
|
|
|
18848
18719
|
* @see https://tailwindcss.com/docs/text-indent
|
|
18849
18720
|
*/
|
|
18850
18721
|
indent: [{
|
|
18851
|
-
indent:
|
|
18722
|
+
indent: getSpacingWithArbitrary()
|
|
18852
18723
|
}],
|
|
18853
18724
|
/**
|
|
18854
18725
|
* Vertical Alignment
|
|
18855
18726
|
* @see https://tailwindcss.com/docs/vertical-align
|
|
18856
18727
|
*/
|
|
18857
18728
|
"vertical-align": [{
|
|
18858
|
-
align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super",
|
|
18729
|
+
align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryValue]
|
|
18859
18730
|
}],
|
|
18860
18731
|
/**
|
|
18861
18732
|
* Whitespace
|
|
@@ -19285,7 +19156,7 @@ function getDefaultConfig() {
|
|
|
19285
19156
|
* @see https://tailwindcss.com/docs/outline-offset
|
|
19286
19157
|
*/
|
|
19287
19158
|
"outline-offset": [{
|
|
19288
|
-
"outline-offset": [isLength]
|
|
19159
|
+
"outline-offset": [isArbitraryValue, isLength]
|
|
19289
19160
|
}],
|
|
19290
19161
|
/**
|
|
19291
19162
|
* Outline Width
|
|
@@ -19364,7 +19235,7 @@ function getDefaultConfig() {
|
|
|
19364
19235
|
opacity: [opacity]
|
|
19365
19236
|
}],
|
|
19366
19237
|
/**
|
|
19367
|
-
* Mix
|
|
19238
|
+
* Mix Blend Mode
|
|
19368
19239
|
* @see https://tailwindcss.com/docs/mix-blend-mode
|
|
19369
19240
|
*/
|
|
19370
19241
|
"mix-blend": [{
|
|
@@ -19723,126 +19594,126 @@ function getDefaultConfig() {
|
|
|
19723
19594
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19724
19595
|
*/
|
|
19725
19596
|
"scroll-m": [{
|
|
19726
|
-
"scroll-m":
|
|
19597
|
+
"scroll-m": getSpacingWithArbitrary()
|
|
19727
19598
|
}],
|
|
19728
19599
|
/**
|
|
19729
19600
|
* Scroll Margin X
|
|
19730
19601
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19731
19602
|
*/
|
|
19732
19603
|
"scroll-mx": [{
|
|
19733
|
-
"scroll-mx":
|
|
19604
|
+
"scroll-mx": getSpacingWithArbitrary()
|
|
19734
19605
|
}],
|
|
19735
19606
|
/**
|
|
19736
19607
|
* Scroll Margin Y
|
|
19737
19608
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19738
19609
|
*/
|
|
19739
19610
|
"scroll-my": [{
|
|
19740
|
-
"scroll-my":
|
|
19611
|
+
"scroll-my": getSpacingWithArbitrary()
|
|
19741
19612
|
}],
|
|
19742
19613
|
/**
|
|
19743
19614
|
* Scroll Margin Start
|
|
19744
19615
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19745
19616
|
*/
|
|
19746
19617
|
"scroll-ms": [{
|
|
19747
|
-
"scroll-ms":
|
|
19618
|
+
"scroll-ms": getSpacingWithArbitrary()
|
|
19748
19619
|
}],
|
|
19749
19620
|
/**
|
|
19750
19621
|
* Scroll Margin End
|
|
19751
19622
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19752
19623
|
*/
|
|
19753
19624
|
"scroll-me": [{
|
|
19754
|
-
"scroll-me":
|
|
19625
|
+
"scroll-me": getSpacingWithArbitrary()
|
|
19755
19626
|
}],
|
|
19756
19627
|
/**
|
|
19757
19628
|
* Scroll Margin Top
|
|
19758
19629
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19759
19630
|
*/
|
|
19760
19631
|
"scroll-mt": [{
|
|
19761
|
-
"scroll-mt":
|
|
19632
|
+
"scroll-mt": getSpacingWithArbitrary()
|
|
19762
19633
|
}],
|
|
19763
19634
|
/**
|
|
19764
19635
|
* Scroll Margin Right
|
|
19765
19636
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19766
19637
|
*/
|
|
19767
19638
|
"scroll-mr": [{
|
|
19768
|
-
"scroll-mr":
|
|
19639
|
+
"scroll-mr": getSpacingWithArbitrary()
|
|
19769
19640
|
}],
|
|
19770
19641
|
/**
|
|
19771
19642
|
* Scroll Margin Bottom
|
|
19772
19643
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19773
19644
|
*/
|
|
19774
19645
|
"scroll-mb": [{
|
|
19775
|
-
"scroll-mb":
|
|
19646
|
+
"scroll-mb": getSpacingWithArbitrary()
|
|
19776
19647
|
}],
|
|
19777
19648
|
/**
|
|
19778
19649
|
* Scroll Margin Left
|
|
19779
19650
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
19780
19651
|
*/
|
|
19781
19652
|
"scroll-ml": [{
|
|
19782
|
-
"scroll-ml":
|
|
19653
|
+
"scroll-ml": getSpacingWithArbitrary()
|
|
19783
19654
|
}],
|
|
19784
19655
|
/**
|
|
19785
19656
|
* Scroll Padding
|
|
19786
19657
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19787
19658
|
*/
|
|
19788
19659
|
"scroll-p": [{
|
|
19789
|
-
"scroll-p":
|
|
19660
|
+
"scroll-p": getSpacingWithArbitrary()
|
|
19790
19661
|
}],
|
|
19791
19662
|
/**
|
|
19792
19663
|
* Scroll Padding X
|
|
19793
19664
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19794
19665
|
*/
|
|
19795
19666
|
"scroll-px": [{
|
|
19796
|
-
"scroll-px":
|
|
19667
|
+
"scroll-px": getSpacingWithArbitrary()
|
|
19797
19668
|
}],
|
|
19798
19669
|
/**
|
|
19799
19670
|
* Scroll Padding Y
|
|
19800
19671
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19801
19672
|
*/
|
|
19802
19673
|
"scroll-py": [{
|
|
19803
|
-
"scroll-py":
|
|
19674
|
+
"scroll-py": getSpacingWithArbitrary()
|
|
19804
19675
|
}],
|
|
19805
19676
|
/**
|
|
19806
19677
|
* Scroll Padding Start
|
|
19807
19678
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19808
19679
|
*/
|
|
19809
19680
|
"scroll-ps": [{
|
|
19810
|
-
"scroll-ps":
|
|
19681
|
+
"scroll-ps": getSpacingWithArbitrary()
|
|
19811
19682
|
}],
|
|
19812
19683
|
/**
|
|
19813
19684
|
* Scroll Padding End
|
|
19814
19685
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19815
19686
|
*/
|
|
19816
19687
|
"scroll-pe": [{
|
|
19817
|
-
"scroll-pe":
|
|
19688
|
+
"scroll-pe": getSpacingWithArbitrary()
|
|
19818
19689
|
}],
|
|
19819
19690
|
/**
|
|
19820
19691
|
* Scroll Padding Top
|
|
19821
19692
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19822
19693
|
*/
|
|
19823
19694
|
"scroll-pt": [{
|
|
19824
|
-
"scroll-pt":
|
|
19695
|
+
"scroll-pt": getSpacingWithArbitrary()
|
|
19825
19696
|
}],
|
|
19826
19697
|
/**
|
|
19827
19698
|
* Scroll Padding Right
|
|
19828
19699
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19829
19700
|
*/
|
|
19830
19701
|
"scroll-pr": [{
|
|
19831
|
-
"scroll-pr":
|
|
19702
|
+
"scroll-pr": getSpacingWithArbitrary()
|
|
19832
19703
|
}],
|
|
19833
19704
|
/**
|
|
19834
19705
|
* Scroll Padding Bottom
|
|
19835
19706
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19836
19707
|
*/
|
|
19837
19708
|
"scroll-pb": [{
|
|
19838
|
-
"scroll-pb":
|
|
19709
|
+
"scroll-pb": getSpacingWithArbitrary()
|
|
19839
19710
|
}],
|
|
19840
19711
|
/**
|
|
19841
19712
|
* Scroll Padding Left
|
|
19842
19713
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
19843
19714
|
*/
|
|
19844
19715
|
"scroll-pl": [{
|
|
19845
|
-
"scroll-pl":
|
|
19716
|
+
"scroll-pl": getSpacingWithArbitrary()
|
|
19846
19717
|
}],
|
|
19847
19718
|
/**
|
|
19848
19719
|
* Scroll Snap Align
|
|
@@ -20105,8 +19976,7 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20105
19976
|
const map = mapRef.current;
|
|
20106
19977
|
const changeMapProjection = () => {
|
|
20107
19978
|
var _a;
|
|
20108
|
-
if (!mapRef.current)
|
|
20109
|
-
return;
|
|
19979
|
+
if (!mapRef.current) return;
|
|
20110
19980
|
const map2 = mapRef.current;
|
|
20111
19981
|
const currentProjection = (_a = map2.getProjection()) == null ? void 0 : _a.type;
|
|
20112
19982
|
const newProjection = currentProjection === "mercator" ? "globe" : "mercator";
|
|
@@ -20115,28 +19985,24 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20115
19985
|
});
|
|
20116
19986
|
};
|
|
20117
19987
|
const zoomIn = () => {
|
|
20118
|
-
if (!mapRef.current)
|
|
20119
|
-
return;
|
|
19988
|
+
if (!mapRef.current) return;
|
|
20120
19989
|
const map2 = mapRef.current;
|
|
20121
19990
|
map2.zoomIn();
|
|
20122
19991
|
return map2.getBounds();
|
|
20123
19992
|
};
|
|
20124
19993
|
const zoomOut = () => {
|
|
20125
|
-
if (!mapRef.current)
|
|
20126
|
-
return;
|
|
19994
|
+
if (!mapRef.current) return;
|
|
20127
19995
|
const map2 = mapRef.current;
|
|
20128
19996
|
map2.zoomOut();
|
|
20129
19997
|
return map2.getBounds();
|
|
20130
19998
|
};
|
|
20131
19999
|
function getLayersByPattern(pattern) {
|
|
20132
|
-
if (!mapRef.current)
|
|
20133
|
-
return;
|
|
20000
|
+
if (!mapRef.current) return;
|
|
20134
20001
|
const map2 = mapRef.current;
|
|
20135
20002
|
return map2 == null ? void 0 : map2.getStyle().layers.filter((layer) => pattern.test(layer.id)).map((layer) => layer.id);
|
|
20136
20003
|
}
|
|
20137
20004
|
const handleToggle = (layerId) => {
|
|
20138
|
-
if (!mapRef.current)
|
|
20139
|
-
return;
|
|
20005
|
+
if (!mapRef.current) return;
|
|
20140
20006
|
const map2 = mapRef.current;
|
|
20141
20007
|
const layers = getLayersByPattern(new RegExp(layerId));
|
|
20142
20008
|
layers == null ? void 0 : layers.forEach((id) => {
|
|
@@ -20264,7 +20130,7 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20264
20130
|
return control;
|
|
20265
20131
|
}));
|
|
20266
20132
|
};
|
|
20267
|
-
const loadSvgImage = (color) => __async(
|
|
20133
|
+
const loadSvgImage = (color) => __async(null, null, function* () {
|
|
20268
20134
|
let svgText = (0, import_server8.renderToStaticMarkup)(
|
|
20269
20135
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_MapPinIcon4.default, { className: "w-6 h-6" })
|
|
20270
20136
|
);
|
|
@@ -20276,17 +20142,15 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20276
20142
|
yield img.decode();
|
|
20277
20143
|
return img;
|
|
20278
20144
|
});
|
|
20279
|
-
const updatePinImage = (source) => __async(
|
|
20145
|
+
const updatePinImage = (source) => __async(null, null, function* () {
|
|
20280
20146
|
const img = yield loadSvgImage(source.style.pin_color);
|
|
20281
20147
|
const imgName = `${source.name}-pin`;
|
|
20282
|
-
if (map == null ? void 0 : map.hasImage(imgName))
|
|
20283
|
-
map == null ? void 0 : map.removeImage(imgName);
|
|
20148
|
+
if (map == null ? void 0 : map.hasImage(imgName)) map == null ? void 0 : map.removeImage(imgName);
|
|
20284
20149
|
map == null ? void 0 : map.addImage(imgName, img);
|
|
20285
20150
|
});
|
|
20286
20151
|
const updateClusterColors = (source) => {
|
|
20287
20152
|
const layerId = `${source.name}-cluster-circles`;
|
|
20288
|
-
if (!(map == null ? void 0 : map.getLayer(layerId)))
|
|
20289
|
-
return;
|
|
20153
|
+
if (!(map == null ? void 0 : map.getLayer(layerId))) return;
|
|
20290
20154
|
const current = map == null ? void 0 : map.getPaintProperty(layerId, "circle-color");
|
|
20291
20155
|
if (current !== source.style.cluster_color) {
|
|
20292
20156
|
map == null ? void 0 : map.setPaintProperty(layerId, "circle-color", source.style.cluster_color);
|
|
@@ -20331,9 +20195,8 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20331
20195
|
}
|
|
20332
20196
|
};
|
|
20333
20197
|
const loadSourceData = () => {
|
|
20334
|
-
if ((sourceData == null ? void 0 : sourceData.length) == 0)
|
|
20335
|
-
|
|
20336
|
-
sourceData == null ? void 0 : sourceData.forEach((source) => __async(void 0, null, function* () {
|
|
20198
|
+
if ((sourceData == null ? void 0 : sourceData.length) == 0) return;
|
|
20199
|
+
sourceData == null ? void 0 : sourceData.forEach((source) => __async(null, null, function* () {
|
|
20337
20200
|
const existing_data = map == null ? void 0 : map.getSource(source.name);
|
|
20338
20201
|
if (!existing_data) {
|
|
20339
20202
|
if (source.is_cluster) {
|
|
@@ -20457,12 +20320,9 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20457
20320
|
}));
|
|
20458
20321
|
};
|
|
20459
20322
|
(0, import_react66.useEffect)(() => {
|
|
20460
|
-
if (typeof mapContainer === "function")
|
|
20461
|
-
|
|
20462
|
-
if (!
|
|
20463
|
-
return;
|
|
20464
|
-
if (!sourceData)
|
|
20465
|
-
return;
|
|
20323
|
+
if (typeof mapContainer === "function") return;
|
|
20324
|
+
if (!(mapContainer == null ? void 0 : mapContainer.current)) return;
|
|
20325
|
+
if (!sourceData) return;
|
|
20466
20326
|
const map2 = new import_maplibre_gl.default.Map({
|
|
20467
20327
|
container: mapContainer == null ? void 0 : mapContainer.current,
|
|
20468
20328
|
style: {
|
|
@@ -20495,7 +20355,7 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20495
20355
|
map2.scrollZoom.disable();
|
|
20496
20356
|
mapRef.current.getContainer().addEventListener("mouseenter", () => map2.scrollZoom.enable());
|
|
20497
20357
|
mapRef.current.getContainer().addEventListener("mouseleave", () => map2.scrollZoom.disable());
|
|
20498
|
-
map2.on("load", () => __async(
|
|
20358
|
+
map2.on("load", () => __async(null, null, function* () {
|
|
20499
20359
|
changeMapProjection();
|
|
20500
20360
|
}));
|
|
20501
20361
|
return () => {
|
|
@@ -20504,8 +20364,7 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20504
20364
|
};
|
|
20505
20365
|
}, []);
|
|
20506
20366
|
(0, import_react66.useEffect)(() => {
|
|
20507
|
-
if (!map)
|
|
20508
|
-
return;
|
|
20367
|
+
if (!map) return;
|
|
20509
20368
|
const init = () => {
|
|
20510
20369
|
loadBaseLayers();
|
|
20511
20370
|
};
|
|
@@ -20520,16 +20379,14 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20520
20379
|
if (map.isStyleLoaded()) {
|
|
20521
20380
|
init();
|
|
20522
20381
|
map.on("zoomend", zoom);
|
|
20523
|
-
} else
|
|
20524
|
-
|
|
20525
|
-
|
|
20526
|
-
|
|
20527
|
-
});
|
|
20382
|
+
} else map.once("load", () => {
|
|
20383
|
+
init();
|
|
20384
|
+
map.on("zoomend", zoom);
|
|
20385
|
+
});
|
|
20528
20386
|
}, [map]);
|
|
20529
20387
|
(0, import_react66.useEffect)(() => {
|
|
20530
20388
|
var _a, _b, _c;
|
|
20531
|
-
if (!map || !sourceData)
|
|
20532
|
-
return;
|
|
20389
|
+
if (!map || !sourceData) return;
|
|
20533
20390
|
if (map.isStyleLoaded()) {
|
|
20534
20391
|
loadSourceData();
|
|
20535
20392
|
return;
|
|
@@ -20569,16 +20426,13 @@ var MapLibre = (0, import_react67.forwardRef)(({ baseLayers, customLayers, mapCo
|
|
|
20569
20426
|
};
|
|
20570
20427
|
}, [sourceData]);
|
|
20571
20428
|
(0, import_react66.useEffect)(() => {
|
|
20572
|
-
if (!map || !sourceData)
|
|
20573
|
-
return;
|
|
20429
|
+
if (!map || !sourceData) return;
|
|
20574
20430
|
sourceData.forEach((source) => {
|
|
20575
20431
|
const source_layer = map.getSource(source.name);
|
|
20576
|
-
if (source_layer)
|
|
20577
|
-
source_layer.setData(source.data);
|
|
20432
|
+
if (source_layer) source_layer.setData(source.data);
|
|
20578
20433
|
});
|
|
20579
20434
|
}, [sourceData]);
|
|
20580
|
-
if (!sourceData)
|
|
20581
|
-
return;
|
|
20435
|
+
if (!sourceData) return;
|
|
20582
20436
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "relative", style: { width: "100%", height: "100%" }, children: [
|
|
20583
20437
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { ref: mapContainer, className: "w-full h-full" }),
|
|
20584
20438
|
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MapControlToolbar, { controls: mapControl, onToggleControl: (id) => toggleControl(id) })
|