@geowiki/map 0.16.9-dev.4 → 0.16.9-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +191 -191
- package/dist/index.mjs +13 -13
- package/dist/styles.css +1 -1
- package/package.json +8 -9
package/dist/index.js
CHANGED
|
@@ -2827,11 +2827,11 @@ var import_react4 = require("react");
|
|
|
2827
2827
|
var import_react_leaflet4 = require("react-leaflet");
|
|
2828
2828
|
var import_leaflet_draw = require("leaflet-draw");
|
|
2829
2829
|
var import_core = require("@geowiki/core");
|
|
2830
|
-
var
|
|
2830
|
+
var import_core2 = require("@geowiki/core");
|
|
2831
2831
|
var PointSelection = (_props) => {
|
|
2832
2832
|
var _a, _b, _c, _d, _e, _f;
|
|
2833
2833
|
const map = (0, import_react_leaflet4.useMap)();
|
|
2834
|
-
const router = (0,
|
|
2834
|
+
const router = (0, import_core2.useRouter)();
|
|
2835
2835
|
const evolandStore = useEvolandStore();
|
|
2836
2836
|
var mapStore = map_default();
|
|
2837
2837
|
var panelStore = (0, import_core.usePanelStore)();
|
|
@@ -2959,7 +2959,7 @@ var SelectedPoint = () => {
|
|
|
2959
2959
|
};
|
|
2960
2960
|
|
|
2961
2961
|
// src/Components/LayerStoreList.tsx
|
|
2962
|
-
var
|
|
2962
|
+
var import_core10 = require("@geowiki/core");
|
|
2963
2963
|
|
|
2964
2964
|
// src/store/mapLayers.ts
|
|
2965
2965
|
var import_zustand3 = require("zustand");
|
|
@@ -3091,7 +3091,7 @@ var useMapLayerStore = (0, import_zustand3.create)()((set, get) => ({
|
|
|
3091
3091
|
var mapLayers_default = useMapLayerStore;
|
|
3092
3092
|
|
|
3093
3093
|
// src/Components/CustomWMS.tsx
|
|
3094
|
-
var
|
|
3094
|
+
var import_core3 = require("@react-leaflet/core");
|
|
3095
3095
|
|
|
3096
3096
|
// src/utils/BetterWMS.ts
|
|
3097
3097
|
var import_leaflet4 = __toESM(require("leaflet"));
|
|
@@ -3472,19 +3472,19 @@ var BetterWMS = class extends import_leaflet4.default.TileLayer.WMS {
|
|
|
3472
3472
|
};
|
|
3473
3473
|
|
|
3474
3474
|
// src/Components/CustomWMS.tsx
|
|
3475
|
-
var CustomWMSTileLayer = (0,
|
|
3475
|
+
var CustomWMSTileLayer = (0, import_core3.createTileLayerComponent)(
|
|
3476
3476
|
function createWMSTileLayer(_a, context) {
|
|
3477
3477
|
var _b = _a, { params = {}, url } = _b, options = __objRest(_b, ["params", "url"]);
|
|
3478
3478
|
var instance = new BetterWMS(url, __spreadValues(__spreadProps(__spreadValues({}, params), {
|
|
3479
3479
|
url
|
|
3480
|
-
}), (0,
|
|
3480
|
+
}), (0, import_core3.withPane)(options, context)));
|
|
3481
3481
|
return {
|
|
3482
3482
|
instance,
|
|
3483
3483
|
context
|
|
3484
3484
|
};
|
|
3485
3485
|
},
|
|
3486
3486
|
function updateWMSTileLayer(layer, props, prevProps) {
|
|
3487
|
-
(0,
|
|
3487
|
+
(0, import_core3.updateGridLayer)(layer, props, prevProps);
|
|
3488
3488
|
if (props.params != null && props.params !== prevProps.params) {
|
|
3489
3489
|
layer.setParams(props.params);
|
|
3490
3490
|
}
|
|
@@ -3499,7 +3499,7 @@ var ReactDOMServer = __toESM(require("react-dom/server"));
|
|
|
3499
3499
|
var import_ui6 = require("@geowiki/ui");
|
|
3500
3500
|
|
|
3501
3501
|
// src/Components/MarkerClusterGroup.tsx
|
|
3502
|
-
var
|
|
3502
|
+
var import_core4 = require("@react-leaflet/core");
|
|
3503
3503
|
var L7 = __toESM(require("leaflet"));
|
|
3504
3504
|
var import_leaflet5 = require("leaflet.markercluster");
|
|
3505
3505
|
function getPropsAndEvents(props) {
|
|
@@ -3522,20 +3522,20 @@ function createMarkerClusterGroup(props, context) {
|
|
|
3522
3522
|
const clusterEvent = `cluster${eventAsProp.substring(2).toLowerCase()}`;
|
|
3523
3523
|
markerClusterGroup.on(clusterEvent, callback);
|
|
3524
3524
|
});
|
|
3525
|
-
return (0,
|
|
3525
|
+
return (0, import_core4.createElementObject)(
|
|
3526
3526
|
markerClusterGroup,
|
|
3527
|
-
(0,
|
|
3527
|
+
(0, import_core4.extendContext)(context, { layerContainer: markerClusterGroup })
|
|
3528
3528
|
);
|
|
3529
3529
|
}
|
|
3530
3530
|
var updateMarkerCluster = () => {
|
|
3531
3531
|
};
|
|
3532
|
-
var MarkerClusterGroup2 = (0,
|
|
3532
|
+
var MarkerClusterGroup2 = (0, import_core4.createPathComponent)(
|
|
3533
3533
|
createMarkerClusterGroup,
|
|
3534
3534
|
updateMarkerCluster
|
|
3535
3535
|
);
|
|
3536
3536
|
|
|
3537
3537
|
// src/Components/GeoJsonProperties.tsx
|
|
3538
|
-
var
|
|
3538
|
+
var import_core5 = require("@geowiki/core");
|
|
3539
3539
|
var import_react5 = require("react");
|
|
3540
3540
|
|
|
3541
3541
|
// src/Components/PropsContent.tsx
|
|
@@ -3549,7 +3549,7 @@ var PropsContent = ({ content }) => {
|
|
|
3549
3549
|
var PropsContent_default = PropsContent;
|
|
3550
3550
|
|
|
3551
3551
|
// src/Components/GeoJsonProperties.tsx
|
|
3552
|
-
var
|
|
3552
|
+
var import_core6 = require("@geowiki/core");
|
|
3553
3553
|
var import_ui2 = require("@geowiki/ui");
|
|
3554
3554
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
3555
3555
|
var parseProperties = (properties, serverProperties) => {
|
|
@@ -3571,7 +3571,7 @@ var GeoJsonPropertiesWidget = ({
|
|
|
3571
3571
|
className
|
|
3572
3572
|
}) => {
|
|
3573
3573
|
var _a, _b, _c, _d;
|
|
3574
|
-
const fileUrl = (0,
|
|
3574
|
+
const fileUrl = (0, import_core5.useFileUrl)();
|
|
3575
3575
|
const serverProperties = (0, import_react5.useMemo)(
|
|
3576
3576
|
() => {
|
|
3577
3577
|
var _a2, _b2, _c2, _d2;
|
|
@@ -3597,7 +3597,7 @@ var GeoJsonPropertiesWidget = ({
|
|
|
3597
3597
|
const isFarmerCluster = properties ? "farmingSystem" in properties : false;
|
|
3598
3598
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_ui2.cn)("bg-white rounded-sm", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-4", children: [
|
|
3599
3599
|
canShowImage && imageUri && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "relative h-64 w-full overflow-hidden rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3600
|
-
|
|
3600
|
+
import_core6.Image,
|
|
3601
3601
|
{
|
|
3602
3602
|
src: imageUri,
|
|
3603
3603
|
alt: "Property Image",
|
|
@@ -3625,11 +3625,11 @@ var GeoJsonPropertiesWidget = ({
|
|
|
3625
3625
|
var GeoJsonProperties_default = GeoJsonPropertiesWidget;
|
|
3626
3626
|
|
|
3627
3627
|
// src/Components/Recodo/FarmerClusterPopup.tsx
|
|
3628
|
-
var
|
|
3628
|
+
var import_core7 = require("@geowiki/core");
|
|
3629
3629
|
var import_ui3 = require("@geowiki/ui");
|
|
3630
3630
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3631
3631
|
var FarmerClusterPopup = ({ properties }) => {
|
|
3632
|
-
const fileUrl = (0,
|
|
3632
|
+
const fileUrl = (0, import_core7.useFileUrl)();
|
|
3633
3633
|
if (!properties)
|
|
3634
3634
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "No properties found" });
|
|
3635
3635
|
const name = properties["name"];
|
|
@@ -3682,9 +3682,9 @@ var BiodiversityObservationPopup = ({
|
|
|
3682
3682
|
|
|
3683
3683
|
// src/Components/Ifbn/IfbnSitePopup.tsx
|
|
3684
3684
|
var import_react6 = require("react");
|
|
3685
|
-
var
|
|
3685
|
+
var import_core8 = require("@geowiki/core");
|
|
3686
3686
|
var import_ui5 = require("@geowiki/ui");
|
|
3687
|
-
var
|
|
3687
|
+
var import_core9 = require("@geowiki/core");
|
|
3688
3688
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3689
3689
|
var SiteInformation = ({ data }) => {
|
|
3690
3690
|
if (!data)
|
|
@@ -3862,7 +3862,7 @@ var IfbnSitePopup = ({ properties }) => {
|
|
|
3862
3862
|
const [siteData, setSiteData] = (0, import_react6.useState)(null);
|
|
3863
3863
|
const [isLoading, setIsLoading] = (0, import_react6.useState)(false);
|
|
3864
3864
|
const [imageError, setImageError] = (0, import_react6.useState)(false);
|
|
3865
|
-
const { status: sessionStatus, data: session } = (0,
|
|
3865
|
+
const { status: sessionStatus, data: session } = (0, import_core8.useSession)();
|
|
3866
3866
|
if (!properties)
|
|
3867
3867
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: "No properties found" });
|
|
3868
3868
|
const plotId = properties["Plot_ID"];
|
|
@@ -3936,7 +3936,7 @@ var IfbnSitePopup = ({ properties }) => {
|
|
|
3936
3936
|
)
|
|
3937
3937
|
] }),
|
|
3938
3938
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3939
|
-
|
|
3939
|
+
import_core9.Image,
|
|
3940
3940
|
{
|
|
3941
3941
|
alt: "",
|
|
3942
3942
|
src: imageError ? fallbackUrl : imageUrl,
|
|
@@ -6639,7 +6639,7 @@ var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
|
6639
6639
|
var LayerStoreList = () => {
|
|
6640
6640
|
const layerStore = useMapLayerStore();
|
|
6641
6641
|
const mapStore = map_default();
|
|
6642
|
-
const { data: mapMenuItems, isLoading } = (0,
|
|
6642
|
+
const { data: mapMenuItems, isLoading } = (0, import_core10.useMapMenuItems)();
|
|
6643
6643
|
const parsedMenuItems = parseMapMenuItems(mapMenuItems);
|
|
6644
6644
|
const layerItems = parsedMenuItems == null ? void 0 : parsedMenuItems.map((menu) => menu.subMenus);
|
|
6645
6645
|
(0, import_react12.useEffect)(() => {
|
|
@@ -6782,7 +6782,7 @@ var LabelButtonView = ({}) => {
|
|
|
6782
6782
|
};
|
|
6783
6783
|
|
|
6784
6784
|
// src/Components/MapSidebar.tsx
|
|
6785
|
-
var
|
|
6785
|
+
var import_core11 = require("@geowiki/core");
|
|
6786
6786
|
|
|
6787
6787
|
// src/Components/MiniMapElement.tsx
|
|
6788
6788
|
var import_react_leaflet11 = require("react-leaflet");
|
|
@@ -6850,7 +6850,7 @@ var MiniMapElement_default = (0, import_react14.memo)(MiniMapElement);
|
|
|
6850
6850
|
// src/Components/MapSidebar.tsx
|
|
6851
6851
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
6852
6852
|
var MapSidebar = ({}) => {
|
|
6853
|
-
const { data: wmsLayerNames } = (0,
|
|
6853
|
+
const { data: wmsLayerNames } = (0, import_core11.useEvolandWmsLayers)();
|
|
6854
6854
|
const layerStore = useMapLayerStore();
|
|
6855
6855
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "grid gap-1 p-2 grid-cols-1 overflow-y-scroll 3xl:grid-cols-2 h-[92.5vh] driver-left-panel", children: wmsLayerNames == null ? void 0 : wmsLayerNames.layers.map((layer) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "px-2", children: [
|
|
6856
6856
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { className: "w-60 lx:w-80 line-clamp-1", children: layer.layerDescription }),
|
|
@@ -6860,17 +6860,17 @@ var MapSidebar = ({}) => {
|
|
|
6860
6860
|
|
|
6861
6861
|
// src/Components/Evoland/RasterPreview.tsx
|
|
6862
6862
|
var import_evoland_api_proxy3 = require("@geowiki/evoland-api-proxy");
|
|
6863
|
-
var
|
|
6863
|
+
var import_core12 = require("@geowiki/core");
|
|
6864
6864
|
var import_react15 = require("react");
|
|
6865
|
-
var
|
|
6865
|
+
var import_core13 = require("@geowiki/core");
|
|
6866
6866
|
var import_ui10 = require("@geowiki/ui");
|
|
6867
6867
|
var import_react_hotkeys_hook = require("react-hotkeys-hook");
|
|
6868
6868
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
6869
6869
|
var RasterPreview = (_props) => {
|
|
6870
6870
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E;
|
|
6871
6871
|
const evolandStore = useEvolandStore();
|
|
6872
|
-
const router = (0,
|
|
6873
|
-
const searchParams = (0,
|
|
6872
|
+
const router = (0, import_core12.useNavigationRouter)();
|
|
6873
|
+
const searchParams = (0, import_core12.useSearchParams)();
|
|
6874
6874
|
const layerStore = useMapLayerStore();
|
|
6875
6875
|
const [noNextLocation, setNoNextLocation] = (0, import_react15.useState)(false);
|
|
6876
6876
|
const [status, setStatus] = (0, import_react15.useState)();
|
|
@@ -6880,14 +6880,14 @@ var RasterPreview = (_props) => {
|
|
|
6880
6880
|
const [disableSubmit, setDisableSubmit] = (0, import_react15.useState)(false);
|
|
6881
6881
|
var projectId = searchParams.get("projectId");
|
|
6882
6882
|
var locationId = searchParams.get("locationId");
|
|
6883
|
-
const { data: tasks } = (0,
|
|
6883
|
+
const { data: tasks } = (0, import_core13.useRandomTasksPerLocation)({
|
|
6884
6884
|
taskForReview: evolandStore.task_for_review,
|
|
6885
6885
|
pageIdx: 0,
|
|
6886
6886
|
pageSize: 1,
|
|
6887
6887
|
locationProjectId: parseInt(projectId),
|
|
6888
6888
|
groupName: !localStorage.getItem("searchGroup") ? null : localStorage.getItem("searchGroup"),
|
|
6889
6889
|
search: null,
|
|
6890
|
-
statusIn: !localStorage.getItem("searchStatus") ?
|
|
6890
|
+
statusIn: !localStorage.getItem("searchStatus") ? import_core13.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus"),
|
|
6891
6891
|
dateGte: localStorage.getItem("fromDate") !== null ? localStorage.getItem("fromDate") : void 0,
|
|
6892
6892
|
dateLte: !localStorage.getItem("toDate") ? void 0 : localStorage.getItem("toDate"),
|
|
6893
6893
|
userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
|
|
@@ -6916,20 +6916,20 @@ var RasterPreview = (_props) => {
|
|
|
6916
6916
|
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 };
|
|
6917
6917
|
var { data: annotationBuffer, indexArr: annotationBufferIndexArr } = evolandStore.annotatedRasterAsset && evolandStore.isAnnualAnnotation ? { data: evolandStore.annotatedRasterAsset.buffer, indexArr: 0 } : evolandStore.annotatedRasterAsset ? flatten(evolandStore.annotatedRasterAsset.buffer) : { data: void 0, indexArr: 0 };
|
|
6918
6918
|
setStatus(taskStatus[0]);
|
|
6919
|
-
bufferData = taskStatus[1] ===
|
|
6920
|
-
var annotation_dates = evolandStore.isAnnualAnnotation ? void 0 : taskStatus[1] ===
|
|
6919
|
+
bufferData = taskStatus[1] === import_core13.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core13.AnnotationRequired.OPTIONAL && ((_b2 = (_a2 = evolandStore.annotationUndoRedo) == null ? void 0 : _a2.past) == null ? void 0 : _b2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core13.AnnotationRequired.OPTIONAL && ((_d2 = (_c2 = evolandStore.annotationUndoRedo) == null ? void 0 : _c2.past) == null ? void 0 : _d2.length) == 0 && evolandStore.savedAnnotations ? Buffer.from(savedAnnotationBuffer == null ? void 0 : savedAnnotationBuffer.buffer).toString("base64") : Buffer.from(annotationBuffer == null ? void 0 : annotationBuffer.buffer).toString("base64");
|
|
6920
|
+
var annotation_dates = evolandStore.isAnnualAnnotation ? void 0 : taskStatus[1] === import_core13.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core13.AnnotationRequired.OPTIONAL && ((_f2 = (_e2 = evolandStore.annotationUndoRedo) == null ? void 0 : _e2.past) == null ? void 0 : _f2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core13.AnnotationRequired.OPTIONAL && ((_h2 = (_g2 = evolandStore.annotationUndoRedo) == null ? void 0 : _g2.past) == null ? void 0 : _h2.length) == 0 && evolandStore.savedAnnotations ? savedAnnotationIndexArr.map(
|
|
6921
6921
|
(item) => evolandStore.reference_dates[item]
|
|
6922
6922
|
) : annotationBufferIndexArr.map(
|
|
6923
6923
|
(item) => evolandStore.reference_dates[item]
|
|
6924
6924
|
);
|
|
6925
|
-
if (!evolandStore.isAnnualAnnotation && annotation_dates && annotation_dates.length < ((_i2 = evolandStore.projectDetail) == null ? void 0 : _i2.minimum_annotation) && taskStatus[1] ===
|
|
6925
|
+
if (!evolandStore.isAnnualAnnotation && annotation_dates && annotation_dates.length < ((_i2 = evolandStore.projectDetail) == null ? void 0 : _i2.minimum_annotation) && taskStatus[1] === import_core13.AnnotationRequired.REQUIRED) {
|
|
6926
6926
|
alert(
|
|
6927
6927
|
"Task should have minimum " + ((_j2 = evolandStore.projectDetail) == null ? void 0 : _j2.minimum_annotation) + " annotations"
|
|
6928
6928
|
);
|
|
6929
6929
|
return;
|
|
6930
6930
|
}
|
|
6931
6931
|
if (evolandStore.annotatedRasterAsset && evolandStore.currentTask) {
|
|
6932
|
-
if (taskStatus[1] ===
|
|
6932
|
+
if (taskStatus[1] === import_core13.AnnotationRequired.REQUIRED) {
|
|
6933
6933
|
if (evolandStore.isAnnualAnnotation && isBase64Zeros(bufferData)) {
|
|
6934
6934
|
alert("Please provide annotation");
|
|
6935
6935
|
return;
|
|
@@ -6941,16 +6941,16 @@ var RasterPreview = (_props) => {
|
|
|
6941
6941
|
task_type: ((_k2 = evolandStore.projectDetail) == null ? void 0 : _k2.meta_data.ANNOTATION) ? [import_evoland_api_proxy3.TaskType.ANNOTATION] : [],
|
|
6942
6942
|
target_status: taskStatus[0],
|
|
6943
6943
|
base64_array: bufferData,
|
|
6944
|
-
array_height: taskStatus[1] ===
|
|
6945
|
-
array_width: taskStatus[1] ===
|
|
6946
|
-
annotation_time: taskStatus[1] === (
|
|
6944
|
+
array_height: taskStatus[1] === import_core13.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core13.AnnotationRequired.OPTIONAL && ((_m2 = (_l2 = evolandStore.annotationUndoRedo) == null ? void 0 : _l2.past) == null ? void 0 : _m2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core13.AnnotationRequired.OPTIONAL && ((_o2 = (_n2 = evolandStore.annotationUndoRedo) == null ? void 0 : _n2.past) == null ? void 0 : _o2.length) == 0 && evolandStore.savedAnnotations ? evolandStore.savedAnnotations.height : evolandStore.annotatedRasterAsset.height,
|
|
6945
|
+
array_width: taskStatus[1] === import_core13.AnnotationRequired.NOT_REQUIRED ? void 0 : taskStatus[1] === import_core13.AnnotationRequired.OPTIONAL && ((_q2 = (_p2 = evolandStore.annotationUndoRedo) == null ? void 0 : _p2.past) == null ? void 0 : _q2.length) == 0 && !evolandStore.savedAnnotations ? void 0 : taskStatus[1] === import_core13.AnnotationRequired.OPTIONAL && ((_s2 = (_r2 = evolandStore.annotationUndoRedo) == null ? void 0 : _r2.past) == null ? void 0 : _s2.length) == 0 && evolandStore.savedAnnotations ? evolandStore.savedAnnotations.width : evolandStore.annotatedRasterAsset.width,
|
|
6946
|
+
annotation_time: taskStatus[1] === (import_core13.AnnotationRequired.NOT_REQUIRED || import_core13.AnnotationRequired.OPTIONAL) ? void 0 : evolandStore.annotationTime,
|
|
6947
6947
|
annotation_dates: !evolandStore.isAnnualAnnotation && (annotation_dates == null ? void 0 : annotation_dates.length) > 0 ? annotation_dates : null,
|
|
6948
6948
|
comment: evolandStore.comment === "" ? void 0 : evolandStore.comment
|
|
6949
6949
|
};
|
|
6950
6950
|
try {
|
|
6951
6951
|
var response = yield import_evoland_api_proxy3.TaskService.updateTaskUpdatetaskPost(submitReq);
|
|
6952
6952
|
if (response !== void 0) {
|
|
6953
|
-
response ? taskStatus[1] ==
|
|
6953
|
+
response ? taskStatus[1] == import_core13.AnnotationRequired.REQUIRED || taskStatus[1] === import_core13.AnnotationRequired.OPTIONAL && ((_u2 = (_t2 = evolandStore.annotationUndoRedo) == null ? void 0 : _t2.past) == null ? void 0 : _u2.pop()) !== void 0 ? setSubmitNotificationMessage(
|
|
6954
6954
|
"Annotation has been moved to " + taskStatus[0].toUpperCase() + " state successfully with a new annotation. Moving to next location, please wait."
|
|
6955
6955
|
) : setSubmitNotificationMessage(
|
|
6956
6956
|
"Annotation has been moved to " + taskStatus[0].toUpperCase() + " successfully. Moving to next location, please wait."
|
|
@@ -7149,7 +7149,7 @@ var RasterPreview = (_props) => {
|
|
|
7149
7149
|
if (layerStore.layerOpacity == 0)
|
|
7150
7150
|
layerStore.setLayerOpacity(0.4);
|
|
7151
7151
|
if (!goToNextTask && evolandStore.location !== null && evolandStore.location.locationId !== searchParams.get("locationId")) {
|
|
7152
|
-
if (status ==
|
|
7152
|
+
if (status == import_core13.TaskStatus.ACCEPTED || status == import_core13.TaskStatus.DISCARDED || status == import_core13.TaskStatus.TO_FIX) {
|
|
7153
7153
|
setGoToNextTask(true);
|
|
7154
7154
|
if (_props.userRole === "admin")
|
|
7155
7155
|
if (tasks == null ? void 0 : tasks.task)
|
|
@@ -7215,7 +7215,7 @@ var RasterPreview = (_props) => {
|
|
|
7215
7215
|
}
|
|
7216
7216
|
) }),
|
|
7217
7217
|
evolandStore.currentTask !== null && ((_h = (_g = evolandStore.currentTask) == null ? void 0 : _g.transition_states) == null ? void 0 : _h.length) > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-center", children: [
|
|
7218
|
-
((_i = evolandStore.currentTask) == null ? void 0 : _i.status) !==
|
|
7218
|
+
((_i = evolandStore.currentTask) == null ? void 0 : _i.status) !== import_core13.TaskStatus.SUBMITTED && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7219
7219
|
import_ui10.Button,
|
|
7220
7220
|
{
|
|
7221
7221
|
className: "mb-2 mt-2 mr-2 text-xs -flex-col",
|
|
@@ -7271,13 +7271,13 @@ var RasterPreview = (_props) => {
|
|
|
7271
7271
|
{
|
|
7272
7272
|
disabled: disableSubmit,
|
|
7273
7273
|
style: {
|
|
7274
|
-
backgroundColor:
|
|
7274
|
+
backgroundColor: import_core13.TaskStatusColor[x[0]]
|
|
7275
7275
|
},
|
|
7276
7276
|
className: "h-6 text-xs p-1 m-1 text-forground-black -px-4 -py-2 w-full",
|
|
7277
7277
|
onClick: () => {
|
|
7278
7278
|
onSubmit(x);
|
|
7279
7279
|
},
|
|
7280
|
-
children:
|
|
7280
|
+
children: import_core13.TaskState[x[0]]
|
|
7281
7281
|
}
|
|
7282
7282
|
) });
|
|
7283
7283
|
}
|
|
@@ -7406,7 +7406,7 @@ var RasterPreview = (_props) => {
|
|
|
7406
7406
|
);
|
|
7407
7407
|
},
|
|
7408
7408
|
alt: "annotation",
|
|
7409
|
-
className: (0,
|
|
7409
|
+
className: (0, import_core13.classNames)(
|
|
7410
7410
|
"text-xs w-48 border-y border-x border-gray-100 hover:border-gray-400",
|
|
7411
7411
|
((_q = evolandStore.selectedRasterAsset) == null ? void 0 : _q.id) === ((_r = evolandStore.annotatedRasterAsset) == null ? void 0 : _r.id) && " border-2 border-red-600 ",
|
|
7412
7412
|
evolandStore.selectedRasterAsset === null || ((_s = evolandStore.selectedRasterAsset) == null ? void 0 : _s.id) !== ((_t = evolandStore.annotatedRasterAsset) == null ? void 0 : _t.id) && " border-gray-50"
|
|
@@ -7469,14 +7469,14 @@ var RasterPreview = (_props) => {
|
|
|
7469
7469
|
// src/Components/Evoland/Annotation.tsx
|
|
7470
7470
|
var import_ui11 = require("@geowiki/ui");
|
|
7471
7471
|
var import_react16 = require("react");
|
|
7472
|
-
var
|
|
7473
|
-
var
|
|
7472
|
+
var import_core14 = require("@geowiki/core");
|
|
7473
|
+
var import_core15 = require("@geowiki/core");
|
|
7474
7474
|
var import_evoland_api_proxy4 = require("@geowiki/evoland-api-proxy");
|
|
7475
7475
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
7476
7476
|
var Annotation = (props) => {
|
|
7477
7477
|
var _a, _b, _c, _d;
|
|
7478
7478
|
const evolandStore = evoland_default();
|
|
7479
|
-
const router = (0,
|
|
7479
|
+
const router = (0, import_core15.useRouter)();
|
|
7480
7480
|
var projectId = router.query.projectId;
|
|
7481
7481
|
var locationId = router.query.locationId;
|
|
7482
7482
|
const [activeLearningLoading, setActiveLearningLoading] = (0, import_react16.useState)(false);
|
|
@@ -7931,7 +7931,7 @@ var Annotation = (props) => {
|
|
|
7931
7931
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "font-semibold text-xs inline-flex flex-row", children: [
|
|
7932
7932
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: "Currently selected label" }),
|
|
7933
7933
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
7934
|
-
|
|
7934
|
+
import_core14.Link,
|
|
7935
7935
|
{
|
|
7936
7936
|
className: "w-5",
|
|
7937
7937
|
href: "https://wirehaired-enquiry-b72.notion.site/Evoland-Annotation-System-Pilot-Manual-4ab47f880f944efebd2832861669bf1f",
|
|
@@ -8083,12 +8083,12 @@ var Annotation = (props) => {
|
|
|
8083
8083
|
};
|
|
8084
8084
|
|
|
8085
8085
|
// src/Components/Evoland/EvolandLeftSideBar.tsx
|
|
8086
|
-
var
|
|
8087
|
-
var
|
|
8086
|
+
var import_core20 = require("@geowiki/core");
|
|
8087
|
+
var import_core21 = require("@geowiki/core");
|
|
8088
8088
|
var import_react20 = require("react");
|
|
8089
8089
|
var import_ui15 = require("@geowiki/ui");
|
|
8090
8090
|
var import_react_hotkeys_hook2 = require("react-hotkeys-hook");
|
|
8091
|
-
var
|
|
8091
|
+
var import_core22 = require("@geowiki/core");
|
|
8092
8092
|
|
|
8093
8093
|
// src/Components/Evoland/GeoWikiTools.tsx
|
|
8094
8094
|
var turf5 = __toESM(require("@turf/turf"));
|
|
@@ -8522,10 +8522,10 @@ var AssetOpacity = (props) => {
|
|
|
8522
8522
|
|
|
8523
8523
|
// src/Components/ViewAssets.tsx
|
|
8524
8524
|
var import_react18 = require("react");
|
|
8525
|
-
var
|
|
8525
|
+
var import_core17 = require("@geowiki/core");
|
|
8526
8526
|
|
|
8527
8527
|
// src/Components/Evoland/RasterImage.tsx
|
|
8528
|
-
var
|
|
8528
|
+
var import_core16 = require("@geowiki/core");
|
|
8529
8529
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
8530
8530
|
var RasterImageWithColorMap = (props) => {
|
|
8531
8531
|
var _a, _b, _c, _d, _e;
|
|
@@ -8534,7 +8534,7 @@ var RasterImageWithColorMap = (props) => {
|
|
|
8534
8534
|
imgUri && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
8535
8535
|
"div",
|
|
8536
8536
|
{
|
|
8537
|
-
className: (0,
|
|
8537
|
+
className: (0, import_core16.classNames)(
|
|
8538
8538
|
"relative text-xs border-y border-x hover:border-gray-600",
|
|
8539
8539
|
((_a = props.selectedItem) == null ? void 0 : _a.id) === ((_b = props.rasterAssetItem) == null ? void 0 : _b.id) && " border-blue-600 bg-primary",
|
|
8540
8540
|
props.selectedItem === null || ((_c = props.selectedItem) == null ? void 0 : _c.id) !== ((_d = props.rasterAssetItem) == null ? void 0 : _d.id) && "border-gray-300"
|
|
@@ -8611,13 +8611,13 @@ var ViewAssets = (props) => {
|
|
|
8611
8611
|
data: taskAnnotation,
|
|
8612
8612
|
isLoading: IsTaskAnnotationLoading,
|
|
8613
8613
|
error
|
|
8614
|
-
} = (0,
|
|
8614
|
+
} = (0, import_core17.useTaskMultipleAnnotations)(
|
|
8615
8615
|
props.taskId !== void 0 && props.taskId !== 0 && submittedAnnotations.length == 0 ? props.taskId : submittedAnnotations.length == 0 && evolandStore.currentTask != null && ((_a = evolandStore.currentTask) == null ? void 0 : _a.task_id) !== void 0 ? evolandStore.currentTask.task_id : null
|
|
8616
8616
|
);
|
|
8617
|
-
const { data: taskSavedAnnotation } = (0,
|
|
8617
|
+
const { data: taskSavedAnnotation } = (0, import_core17.useTaskSavedAnnotations)(
|
|
8618
8618
|
props.taskId !== void 0 && props.taskId !== 0 && savedAnnotations == null ? props.taskId : savedAnnotations == null && evolandStore.currentTask != null && ((_b = evolandStore.currentTask) == null ? void 0 : _b.task_id) !== void 0 && evolandStore.currentTask.saved_annotation !== null ? evolandStore.currentTask.task_id : null
|
|
8619
8619
|
);
|
|
8620
|
-
const { data: latestTaskOnLocation } = (0,
|
|
8620
|
+
const { data: latestTaskOnLocation } = (0, import_core17.useLatestTaskOnLocation)(
|
|
8621
8621
|
props.locationId,
|
|
8622
8622
|
props.projectId,
|
|
8623
8623
|
evolandStore.referenceDate
|
|
@@ -8764,7 +8764,7 @@ var ViewAssets = (props) => {
|
|
|
8764
8764
|
(masks == null ? void 0 : masks.length) > 0 && evolandStore.maskAsset && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8765
8765
|
"button",
|
|
8766
8766
|
{
|
|
8767
|
-
className: (0,
|
|
8767
|
+
className: (0, import_core17.classNames)(
|
|
8768
8768
|
"border-r border-t border-gray-300",
|
|
8769
8769
|
!maskTab && "bg-primary"
|
|
8770
8770
|
),
|
|
@@ -8781,7 +8781,7 @@ var ViewAssets = (props) => {
|
|
|
8781
8781
|
((_d = evolandStore.changeMaskAsset) == null ? void 0 : _d.length) > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8782
8782
|
"button",
|
|
8783
8783
|
{
|
|
8784
|
-
className: (0,
|
|
8784
|
+
className: (0, import_core17.classNames)(
|
|
8785
8785
|
"border-r border-t border-gray-300",
|
|
8786
8786
|
!changeMaskTab && "bg-primary"
|
|
8787
8787
|
),
|
|
@@ -8798,7 +8798,7 @@ var ViewAssets = (props) => {
|
|
|
8798
8798
|
showAnnotationTab && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8799
8799
|
"button",
|
|
8800
8800
|
{
|
|
8801
|
-
className: (0,
|
|
8801
|
+
className: (0, import_core17.classNames)(
|
|
8802
8802
|
"border-r border-t border-gray-300 px-1",
|
|
8803
8803
|
!annotationTab && "bg-primary"
|
|
8804
8804
|
),
|
|
@@ -8815,7 +8815,7 @@ var ViewAssets = (props) => {
|
|
|
8815
8815
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8816
8816
|
"button",
|
|
8817
8817
|
{
|
|
8818
|
-
className: (0,
|
|
8818
|
+
className: (0, import_core17.classNames)(
|
|
8819
8819
|
"border-r border-t border-gray-300 px-1",
|
|
8820
8820
|
!compositesTab && "bg-primary"
|
|
8821
8821
|
),
|
|
@@ -9117,15 +9117,15 @@ var ViewAssets = (props) => {
|
|
|
9117
9117
|
|
|
9118
9118
|
// src/Components/Evoland/SearchAnnotation.tsx
|
|
9119
9119
|
var import_react19 = require("react");
|
|
9120
|
-
var
|
|
9120
|
+
var import_core18 = require("@geowiki/core");
|
|
9121
9121
|
var import_ui14 = require("@geowiki/ui");
|
|
9122
9122
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
9123
9123
|
var SearchAnnotation = (props) => {
|
|
9124
|
-
const { data: users, isLoading: IsUsersLoading } = (0,
|
|
9124
|
+
const { data: users, isLoading: IsUsersLoading } = (0, import_core18.useProjectUsers)(
|
|
9125
9125
|
props.projectId
|
|
9126
9126
|
);
|
|
9127
|
-
const { data: taskStatusList, isLoading: IsTaskStatusLoading } = (0,
|
|
9128
|
-
const { data: groups, isLoading: IsGroupsLoading } = (0,
|
|
9127
|
+
const { data: taskStatusList, isLoading: IsTaskStatusLoading } = (0, import_core18.useTaskStatusList)();
|
|
9128
|
+
const { data: groups, isLoading: IsGroupsLoading } = (0, import_core18.useGroupsInProject)(
|
|
9129
9129
|
props.projectId
|
|
9130
9130
|
);
|
|
9131
9131
|
const [searchUser, setSearchUser] = (0, import_react19.useState)(
|
|
@@ -9135,7 +9135,7 @@ var SearchAnnotation = (props) => {
|
|
|
9135
9135
|
!localStorage.getItem("searchGroup") ? "" : localStorage.getItem("searchGroup")
|
|
9136
9136
|
);
|
|
9137
9137
|
const [searchStatus, setSearchStatus] = (0, import_react19.useState)(
|
|
9138
|
-
!localStorage.getItem("searchStatus") ?
|
|
9138
|
+
!localStorage.getItem("searchStatus") ? import_core18.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus")
|
|
9139
9139
|
);
|
|
9140
9140
|
const [fromDate, setFromDate] = (0, import_react19.useState)(
|
|
9141
9141
|
localStorage.getItem("fromDate") !== null ? localStorage.getItem("fromDate") : ""
|
|
@@ -9143,13 +9143,13 @@ var SearchAnnotation = (props) => {
|
|
|
9143
9143
|
const [toDate, setToDate] = (0, import_react19.useState)(
|
|
9144
9144
|
!localStorage.getItem("toDate") ? "" : localStorage.getItem("toDate")
|
|
9145
9145
|
);
|
|
9146
|
-
const { data: tasks } = (0,
|
|
9146
|
+
const { data: tasks } = (0, import_core18.useRandomTasksPerLocation)({
|
|
9147
9147
|
taskForReview: props.taskForReview,
|
|
9148
9148
|
pageIdx: 0,
|
|
9149
9149
|
pageSize: searchUser == void 0 && searchGroup == void 0 ? 1 : 10,
|
|
9150
9150
|
locationProjectId: props.projectId,
|
|
9151
9151
|
groupName: searchGroup || null,
|
|
9152
|
-
statusIn: searchUser == void 0 && searchStatus == void 0 ?
|
|
9152
|
+
statusIn: searchUser == void 0 && searchStatus == void 0 ? import_core18.TaskStatus.SUBMITTED : searchStatus,
|
|
9153
9153
|
dateGte: fromDate,
|
|
9154
9154
|
dateLte: toDate,
|
|
9155
9155
|
userUserAlias: searchUser || null
|
|
@@ -9250,7 +9250,7 @@ var SearchAnnotation = (props) => {
|
|
|
9250
9250
|
"option",
|
|
9251
9251
|
{
|
|
9252
9252
|
value: x,
|
|
9253
|
-
selected: searchStatus === void 0 ? x ===
|
|
9253
|
+
selected: searchStatus === void 0 ? x === import_core18.TaskStatus.SUBMITTED : searchStatus == x,
|
|
9254
9254
|
children: x
|
|
9255
9255
|
},
|
|
9256
9256
|
index
|
|
@@ -9338,12 +9338,12 @@ var SearchAnnotation = (props) => {
|
|
|
9338
9338
|
onClick: () => {
|
|
9339
9339
|
setSearchUser("");
|
|
9340
9340
|
setsearchGroup("");
|
|
9341
|
-
setSearchStatus(
|
|
9341
|
+
setSearchStatus(import_core18.TaskStatus.SUBMITTED);
|
|
9342
9342
|
setFromDate("");
|
|
9343
9343
|
setToDate("");
|
|
9344
9344
|
localStorage.removeItem("searchUser");
|
|
9345
9345
|
localStorage.removeItem("searchGroup");
|
|
9346
|
-
localStorage.setItem("searchStatus",
|
|
9346
|
+
localStorage.setItem("searchStatus", import_core18.TaskStatus.SUBMITTED);
|
|
9347
9347
|
localStorage.removeItem("fromDate");
|
|
9348
9348
|
localStorage.removeItem("toDate");
|
|
9349
9349
|
},
|
|
@@ -9364,7 +9364,7 @@ var SearchAnnotation = (props) => {
|
|
|
9364
9364
|
};
|
|
9365
9365
|
|
|
9366
9366
|
// src/Components/Evoland/TaskEventLog.tsx
|
|
9367
|
-
var
|
|
9367
|
+
var import_core19 = require("@geowiki/core");
|
|
9368
9368
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
9369
9369
|
var TaskEventLog = (props) => {
|
|
9370
9370
|
return Object.entries(props.taskEventsGrouped).map(
|
|
@@ -9372,12 +9372,12 @@ var TaskEventLog = (props) => {
|
|
|
9372
9372
|
var _a, _b, _c, _d;
|
|
9373
9373
|
let tempAnnotationId = "";
|
|
9374
9374
|
let tempComment = "";
|
|
9375
|
-
if (x[1][0].event_type ==
|
|
9375
|
+
if (x[1][0].event_type == import_core19.TaskEventType.NEW_ANNOTATION)
|
|
9376
9376
|
tempAnnotationId = x[1][0].content;
|
|
9377
|
-
if (x[1][0].event_type ==
|
|
9377
|
+
if (x[1][0].event_type == import_core19.TaskEventType.COMMENT)
|
|
9378
9378
|
tempComment = x[1][0].content;
|
|
9379
9379
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
9380
|
-
x[1].length == 1 && (x[1][0].event_type ==
|
|
9380
|
+
x[1].length == 1 && (x[1][0].event_type == import_core19.TaskEventType.CREATED ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
9381
9381
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-primary leading-5", children: [
|
|
9382
9382
|
"System - ",
|
|
9383
9383
|
(_a = x[1][0]) == null ? void 0 : _a.event_time
|
|
@@ -9388,13 +9388,13 @@ var TaskEventLog = (props) => {
|
|
|
9388
9388
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", { children: (_b = x[1][0]) == null ? void 0 : _b.actor_alias })
|
|
9389
9389
|
] })
|
|
9390
9390
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-white", children: [
|
|
9391
|
-
x[1][0].event_type !==
|
|
9391
|
+
x[1][0].event_type !== import_core19.TaskEventType.NEW_ANNOTATION && x[1][0].event_type !== import_core19.TaskEventType.COMMENT && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-primary leading-5 mt-2", children: [
|
|
9392
9392
|
(_c = x[1][0]) == null ? void 0 : _c.actor_alias,
|
|
9393
9393
|
" - ",
|
|
9394
9394
|
(_d = x[1][0]) == null ? void 0 : _d.event_time
|
|
9395
9395
|
] }),
|
|
9396
|
-
x[1][0].event_type ==
|
|
9397
|
-
(x[1][0].event_type ==
|
|
9396
|
+
x[1][0].event_type == import_core19.TaskEventType.REVIEW && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-black text-xs leading-5", children: x[1][0].content }),
|
|
9397
|
+
(x[1][0].event_type == import_core19.TaskEventType.STATUS_UPDATED || x[1][0].event_type == import_core19.TaskEventType.COMMENT) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-black text-xs leading-5", children: [
|
|
9398
9398
|
tempAnnotationId !== "" && tempComment == "" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
9399
9399
|
" ",
|
|
9400
9400
|
"Status changed to : ",
|
|
@@ -9432,17 +9432,17 @@ var TaskEventLog = (props) => {
|
|
|
9432
9432
|
] })
|
|
9433
9433
|
] }, index)),
|
|
9434
9434
|
x[1].length > 1 && x[1].map((y, yIndex) => {
|
|
9435
|
-
if (y.event_type ==
|
|
9435
|
+
if (y.event_type == import_core19.TaskEventType.NEW_ANNOTATION)
|
|
9436
9436
|
tempAnnotationId = y.content;
|
|
9437
|
-
if (y.event_type ==
|
|
9437
|
+
if (y.event_type == import_core19.TaskEventType.COMMENT)
|
|
9438
9438
|
tempComment = y.content;
|
|
9439
9439
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-white", children: [
|
|
9440
|
-
y.event_type !==
|
|
9440
|
+
y.event_type !== import_core19.TaskEventType.NEW_ANNOTATION && y.event_type !== import_core19.TaskEventType.COMMENT && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-primary leading-5 mt-2", children: [
|
|
9441
9441
|
y == null ? void 0 : y.actor_alias,
|
|
9442
9442
|
" - ",
|
|
9443
9443
|
y == null ? void 0 : y.event_time
|
|
9444
9444
|
] }),
|
|
9445
|
-
(y.event_type ==
|
|
9445
|
+
(y.event_type == import_core19.TaskEventType.STATUS_UPDATED || y.event_type == import_core19.TaskEventType.COMMENT || y.event_type == import_core19.TaskEventType.QUESTIONNAIRE || y.event_type == import_core19.TaskEventType.REVIEW) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "text-black text-xs leading-5", children: [
|
|
9446
9446
|
tempAnnotationId !== "" && tempComment == "" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
9447
9447
|
" ",
|
|
9448
9448
|
"Status changed to : ",
|
|
@@ -9450,12 +9450,12 @@ var TaskEventLog = (props) => {
|
|
|
9450
9450
|
" with new Annotation :",
|
|
9451
9451
|
tempAnnotationId
|
|
9452
9452
|
] }),
|
|
9453
|
-
tempAnnotationId == "" && tempComment == "" && y.event_type !==
|
|
9453
|
+
tempAnnotationId == "" && tempComment == "" && y.event_type !== import_core19.TaskEventType.QUESTIONNAIRE && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
9454
9454
|
" ",
|
|
9455
9455
|
"Status changed to : ",
|
|
9456
9456
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", { children: y.content })
|
|
9457
9457
|
] }),
|
|
9458
|
-
tempAnnotationId == "" && tempComment == "" && y.event_type ==
|
|
9458
|
+
tempAnnotationId == "" && tempComment == "" && y.event_type == import_core19.TaskEventType.QUESTIONNAIRE && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: "Questionnaire filled" }),
|
|
9459
9459
|
tempComment !== "" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex", children: [
|
|
9460
9460
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
9461
9461
|
"svg",
|
|
@@ -9490,7 +9490,7 @@ var TaskEventLog = (props) => {
|
|
|
9490
9490
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
9491
9491
|
var EvolandLeftSideBar = (props) => {
|
|
9492
9492
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
|
|
9493
|
-
const router = (0,
|
|
9493
|
+
const router = (0, import_core20.useRouter)();
|
|
9494
9494
|
var locationId = router.query.locationId;
|
|
9495
9495
|
const projectId = parseInt(router.query.projectId);
|
|
9496
9496
|
const review = router.query.review;
|
|
@@ -9507,7 +9507,7 @@ var EvolandLeftSideBar = (props) => {
|
|
|
9507
9507
|
const [annotations, setAnnotations] = (0, import_react20.useState)([]);
|
|
9508
9508
|
const [fetchMasks, setFetchMasks] = (0, import_react20.useState)(false);
|
|
9509
9509
|
const [fetchChangeMasks, setFetchChangeMasks] = (0, import_react20.useState)(false);
|
|
9510
|
-
const { data: latestTaskOnLocation } = (0,
|
|
9510
|
+
const { data: latestTaskOnLocation } = (0, import_core21.useLatestTaskOnLocation)(
|
|
9511
9511
|
locationId,
|
|
9512
9512
|
projectId,
|
|
9513
9513
|
evolandStore.referenceDate
|
|
@@ -9520,22 +9520,22 @@ var EvolandLeftSideBar = (props) => {
|
|
|
9520
9520
|
const [adminTasks, setAdminTasks] = (0, import_react20.useState)();
|
|
9521
9521
|
const [deleteTask, setDeleteTask] = (0, import_react20.useState)(false);
|
|
9522
9522
|
var taskId = router.query.taskId == void 0 ? (_a = evolandStore.currentTask) == null ? void 0 : _a.task_id : router.query.taskId;
|
|
9523
|
-
const { data: taskSavedAnnotation } = (0,
|
|
9523
|
+
const { data: taskSavedAnnotation } = (0, import_core21.useTaskSavedAnnotations)(
|
|
9524
9524
|
taskId !== void 0 && parseInt(taskId) !== 0 && savedAnnotations == null ? parseInt(taskId) : savedAnnotations == null && evolandStore.currentTask != null && ((_b = evolandStore.currentTask) == null ? void 0 : _b.task_id) !== void 0 && evolandStore.currentTask.saved_annotation !== null ? evolandStore.currentTask.task_id : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? latestTaskOnLocation.task_id : null
|
|
9525
9525
|
);
|
|
9526
|
-
const { data: TaskDeleted, isLoading: IsTaskDeletedLoading } = (0,
|
|
9526
|
+
const { data: TaskDeleted, isLoading: IsTaskDeletedLoading } = (0, import_core21.useTaskDelete)(
|
|
9527
9527
|
taskId !== void 0 && parseInt(taskId) !== 0 ? parseInt(taskId) : (_c = evolandStore.currentTask) == null ? void 0 : _c.task_id,
|
|
9528
9528
|
projectId,
|
|
9529
9529
|
deleteTask
|
|
9530
9530
|
);
|
|
9531
|
-
const { data: tasks } = (0,
|
|
9531
|
+
const { data: tasks } = (0, import_core21.useRandomTasksPerLocation)({
|
|
9532
9532
|
taskForReview: evolandStore.task_for_review,
|
|
9533
9533
|
pageIdx: 0,
|
|
9534
9534
|
pageSize: 1,
|
|
9535
9535
|
locationProjectId: projectId,
|
|
9536
9536
|
groupName: !localStorage.getItem("searchGroup") ? null : localStorage.getItem("searchGroup"),
|
|
9537
9537
|
search: null,
|
|
9538
|
-
statusIn: !localStorage.getItem("searchStatus") ?
|
|
9538
|
+
statusIn: !localStorage.getItem("searchStatus") ? import_core21.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus"),
|
|
9539
9539
|
dateGte: localStorage.getItem("fromDate") !== null ? localStorage.getItem("fromDate") : void 0,
|
|
9540
9540
|
dateLte: !localStorage.getItem("toDate") ? void 0 : localStorage.getItem("toDate"),
|
|
9541
9541
|
userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
|
|
@@ -9682,10 +9682,10 @@ var EvolandLeftSideBar = (props) => {
|
|
|
9682
9682
|
"div",
|
|
9683
9683
|
{
|
|
9684
9684
|
style: {
|
|
9685
|
-
backgroundColor: ((_p = evolandStore.currentTask) == null ? void 0 : _p.status) !== null && ((_q = evolandStore.currentTask) == null ? void 0 : _q.status) !== void 0 ?
|
|
9685
|
+
backgroundColor: ((_p = evolandStore.currentTask) == null ? void 0 : _p.status) !== null && ((_q = evolandStore.currentTask) == null ? void 0 : _q.status) !== void 0 ? import_core21.TaskStatusColor[(_r = evolandStore.currentTask) == null ? void 0 : _r.status] : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? import_core21.TaskStatusColor[latestTaskOnLocation.task_status] : !evolandStore.currentTask && !(latestTaskOnLocation == null ? void 0 : latestTaskOnLocation.exists) ? "bg-primary text-primary-foreground" : "white"
|
|
9686
9686
|
},
|
|
9687
|
-
className: "pl-2 pr-2 flex rounded-lg text-center " + (((_s = evolandStore.currentTask) == null ? void 0 : _s.status) !== null && ((_t = evolandStore.currentTask) == null ? void 0 : _t.status) !== void 0 ? "bg-" +
|
|
9688
|
-
children: ((_v = evolandStore.currentTask) == null ? void 0 : _v.status) !== null && ((_w = evolandStore.currentTask) == null ? void 0 : _w.status) !== void 0 ?
|
|
9687
|
+
className: "pl-2 pr-2 flex rounded-lg text-center " + (((_s = evolandStore.currentTask) == null ? void 0 : _s.status) !== null && ((_t = evolandStore.currentTask) == null ? void 0 : _t.status) !== void 0 ? "bg-" + import_core21.TaskStatusColor[(_u = evolandStore.currentTask) == null ? void 0 : _u.status] + "-500" : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? "bg-" + import_core21.TaskStatusColor[latestTaskOnLocation.task_status] + "-500" : !evolandStore.currentTask && !(latestTaskOnLocation == null ? void 0 : latestTaskOnLocation.exists) ? "bg-primary text-primary-foreground" : "bg-white-500"),
|
|
9688
|
+
children: ((_v = evolandStore.currentTask) == null ? void 0 : _v.status) !== null && ((_w = evolandStore.currentTask) == null ? void 0 : _w.status) !== void 0 ? import_core21.TaskStatus[(_x = evolandStore.currentTask) == null ? void 0 : _x.status] : !evolandStore.currentTask && latestTaskOnLocation && latestTaskOnLocation.exists ? import_core21.TaskStatus[latestTaskOnLocation.task_status] : !evolandStore.currentTask && !(latestTaskOnLocation == null ? void 0 : latestTaskOnLocation.task_id) ? "Not started" : ""
|
|
9689
9689
|
}
|
|
9690
9690
|
) }),
|
|
9691
9691
|
locationId && projectId && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_ui15.Popover, { children: [
|
|
@@ -9728,7 +9728,7 @@ var EvolandLeftSideBar = (props) => {
|
|
|
9728
9728
|
!taskEventsGrouped && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.PopoverContent, { className: "bg-white text-xs flex", children: "No history yet" })
|
|
9729
9729
|
] }) }),
|
|
9730
9730
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9731
|
-
|
|
9731
|
+
import_core22.Link,
|
|
9732
9732
|
{
|
|
9733
9733
|
href: "/evoland/tasks?projectId=" + projectId,
|
|
9734
9734
|
target: "_blank",
|
|
@@ -9757,7 +9757,7 @@ var EvolandLeftSideBar = (props) => {
|
|
|
9757
9757
|
}
|
|
9758
9758
|
) }),
|
|
9759
9759
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
9760
|
-
|
|
9760
|
+
import_core22.Link,
|
|
9761
9761
|
{
|
|
9762
9762
|
href: "/evoland/projects?projectId=" + projectId,
|
|
9763
9763
|
target: "_blank",
|
|
@@ -9856,10 +9856,10 @@ var EvolandLeftSideBar = (props) => {
|
|
|
9856
9856
|
"div",
|
|
9857
9857
|
{
|
|
9858
9858
|
style: {
|
|
9859
|
-
backgroundColor:
|
|
9859
|
+
backgroundColor: import_core21.TaskStatusColor[x.status]
|
|
9860
9860
|
},
|
|
9861
9861
|
className: "pl-2 pr-2 flex rounded-lg text-center",
|
|
9862
|
-
children:
|
|
9862
|
+
children: import_core21.TaskStatus[x.status]
|
|
9863
9863
|
}
|
|
9864
9864
|
)
|
|
9865
9865
|
] }, index)) })
|
|
@@ -9933,22 +9933,22 @@ var EvolandLeftSideBar = (props) => {
|
|
|
9933
9933
|
|
|
9934
9934
|
// src/Components/Evoland/Questions.tsx
|
|
9935
9935
|
var import_ui16 = require("@geowiki/ui");
|
|
9936
|
-
var
|
|
9937
|
-
var
|
|
9936
|
+
var import_core23 = require("@geowiki/core");
|
|
9937
|
+
var import_core24 = require("@geowiki/core");
|
|
9938
9938
|
var import_react21 = require("react");
|
|
9939
9939
|
var import_evoland_api_proxy5 = require("@geowiki/evoland-api-proxy");
|
|
9940
|
-
var
|
|
9940
|
+
var import_core25 = require("@geowiki/core");
|
|
9941
9941
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
9942
9942
|
var Questions = (props) => {
|
|
9943
9943
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
9944
9944
|
const evolandStore = evoland_default();
|
|
9945
|
-
const router = (0,
|
|
9946
|
-
const searchParams = (0,
|
|
9945
|
+
const router = (0, import_core23.useRouter)();
|
|
9946
|
+
const searchParams = (0, import_core25.useSearchParams)();
|
|
9947
9947
|
const projectId = searchParams.get("projectId");
|
|
9948
9948
|
const taskId = searchParams.get("taskId");
|
|
9949
|
-
const { data: labels } = (0,
|
|
9949
|
+
const { data: labels } = (0, import_core24.useEvolandLabels)(parseInt(projectId));
|
|
9950
9950
|
const [taskChangeDetail, setTaskChangeDetail] = (0, import_react21.useState)(null);
|
|
9951
|
-
var { data: questionnaire, isLoading: IsQuestionnaireLoading } = (0,
|
|
9951
|
+
var { data: questionnaire, isLoading: IsQuestionnaireLoading } = (0, import_core24.useQuestionnaire)(parseInt(projectId));
|
|
9952
9952
|
const [context, setContext] = (0, import_react21.useState)();
|
|
9953
9953
|
const [singleChoice, setSingleChoice] = (0, import_react21.useState)();
|
|
9954
9954
|
const [status, setStatus] = (0, import_react21.useState)();
|
|
@@ -9959,7 +9959,7 @@ var Questions = (props) => {
|
|
|
9959
9959
|
const [disableSubmit, setDisableSubmit] = (0, import_react21.useState)(false);
|
|
9960
9960
|
const [userAnswers, setUserAnswers] = (0, import_react21.useState)([]);
|
|
9961
9961
|
let requiredUserAnswers = 0;
|
|
9962
|
-
const { data: taskAnswers, isLoading: IsTaskAnswerLoading } = (0,
|
|
9962
|
+
const { data: taskAnswers, isLoading: IsTaskAnswerLoading } = (0, import_core24.useTaskAnswers)(
|
|
9963
9963
|
taskId ? parseInt(taskId) : ((_a = evolandStore.currentTask) == null ? void 0 : _a.task_id) ? (_b = evolandStore.currentTask) == null ? void 0 : _b.task_id : 0
|
|
9964
9964
|
);
|
|
9965
9965
|
(0, import_react21.useEffect)(() => {
|
|
@@ -10013,14 +10013,14 @@ var Questions = (props) => {
|
|
|
10013
10013
|
});
|
|
10014
10014
|
}
|
|
10015
10015
|
};
|
|
10016
|
-
const { data: tasks } = (0,
|
|
10016
|
+
const { data: tasks } = (0, import_core24.useRandomTasksPerLocation)({
|
|
10017
10017
|
taskForReview: evolandStore.task_for_review,
|
|
10018
10018
|
pageIdx: 0,
|
|
10019
10019
|
pageSize: 1,
|
|
10020
10020
|
locationProjectId: parseInt(projectId),
|
|
10021
10021
|
groupName: !localStorage.getItem("searchGroup") ? null : localStorage.getItem("searchGroup"),
|
|
10022
10022
|
search: null,
|
|
10023
|
-
statusIn: !localStorage.getItem("searchStatus") ?
|
|
10023
|
+
statusIn: !localStorage.getItem("searchStatus") ? import_core24.TaskStatus.SUBMITTED : localStorage.getItem("searchStatus"),
|
|
10024
10024
|
dateGte: localStorage.getItem("fromDate") !== null ? localStorage.getItem("fromDate") : void 0,
|
|
10025
10025
|
dateLte: !localStorage.getItem("toDate") ? void 0 : localStorage.getItem("toDate"),
|
|
10026
10026
|
userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
|
|
@@ -10038,7 +10038,7 @@ var Questions = (props) => {
|
|
|
10038
10038
|
project_id: parseInt(projectId),
|
|
10039
10039
|
target_status: taskStatus[0],
|
|
10040
10040
|
task_type: ((_a2 = evolandStore.projectDetail) == null ? void 0 : _a2.meta_data.QUESTIONNAIRE) ? [import_evoland_api_proxy5.TaskType.QUESTIONNAIRE] : [],
|
|
10041
|
-
annotation_time: taskStatus[1] === (
|
|
10041
|
+
annotation_time: taskStatus[1] === (import_core24.AnnotationRequired.NOT_REQUIRED || import_core24.AnnotationRequired.OPTIONAL) ? void 0 : evolandStore.annotationTime,
|
|
10042
10042
|
questionnaire: userAnswers.map((item) => [
|
|
10043
10043
|
item.question_id,
|
|
10044
10044
|
item.answer_text
|
|
@@ -10048,7 +10048,7 @@ var Questions = (props) => {
|
|
|
10048
10048
|
try {
|
|
10049
10049
|
var response = yield import_evoland_api_proxy5.TaskService.updateTaskUpdatetaskPost(submitReq);
|
|
10050
10050
|
if (response !== void 0) {
|
|
10051
|
-
response ? taskStatus[1] ==
|
|
10051
|
+
response ? taskStatus[1] == import_core24.AnnotationRequired.REQUIRED || taskStatus[1] === import_core24.AnnotationRequired.OPTIONAL && ((_c2 = (_b2 = evolandStore.annotationUndoRedo) == null ? void 0 : _b2.past) == null ? void 0 : _c2.pop()) !== void 0 ? setSubmitNotificationMessage(
|
|
10052
10052
|
"Task has been moved to " + taskStatus[0].toUpperCase() + " state successfully with selected answers. Moving to next location, please wait."
|
|
10053
10053
|
) : setSubmitNotificationMessage(
|
|
10054
10054
|
"Task has been moved to " + taskStatus[0].toUpperCase() + " successfully. Moving to next location, please wait."
|
|
@@ -10120,11 +10120,11 @@ var Questions = (props) => {
|
|
|
10120
10120
|
});
|
|
10121
10121
|
if (questionnaire && !context)
|
|
10122
10122
|
setContext(
|
|
10123
|
-
questionnaire.filter((x) => x.type ==
|
|
10123
|
+
questionnaire.filter((x) => x.type == import_core24.QuestionnaireType.CONTEXT).sort((x, y) => x.order_id - y.order_id)
|
|
10124
10124
|
);
|
|
10125
10125
|
if (questionnaire && !singleChoice)
|
|
10126
10126
|
setSingleChoice(
|
|
10127
|
-
questionnaire.filter((x) => x.type ==
|
|
10127
|
+
questionnaire.filter((x) => x.type == import_core24.QuestionnaireType.SINGLE_CHOICE).sort((x, y) => x.order_id - y.order_id)
|
|
10128
10128
|
);
|
|
10129
10129
|
if (context && taskChangeDetail) {
|
|
10130
10130
|
context.filter((x) => x.has_dynamic_answers).map((y) => {
|
|
@@ -10180,7 +10180,7 @@ var Questions = (props) => {
|
|
|
10180
10180
|
});
|
|
10181
10181
|
}
|
|
10182
10182
|
if (!goToNextTask && evolandStore.location !== null && evolandStore.location.locationId !== searchParams.get("locationId")) {
|
|
10183
|
-
if (status ==
|
|
10183
|
+
if (status == import_core24.TaskStatus.ACCEPTED || status == import_core24.TaskStatus.DISCARDED || status == import_core24.TaskStatus.TO_FIX) {
|
|
10184
10184
|
setGoToNextTask(true);
|
|
10185
10185
|
if (props.userRole === "admin")
|
|
10186
10186
|
if (tasks == null ? void 0 : tasks.task)
|
|
@@ -10273,7 +10273,7 @@ var Questions = (props) => {
|
|
|
10273
10273
|
}
|
|
10274
10274
|
),
|
|
10275
10275
|
evolandStore.currentTask !== null && ((_k = (_j = evolandStore.currentTask) == null ? void 0 : _j.transition_states) == null ? void 0 : _k.length) > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-center", children: [
|
|
10276
|
-
((_l = evolandStore.currentTask) == null ? void 0 : _l.status) !==
|
|
10276
|
+
((_l = evolandStore.currentTask) == null ? void 0 : _l.status) !== import_core24.TaskStatus.SUBMITTED && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
10277
10277
|
import_ui16.Button,
|
|
10278
10278
|
{
|
|
10279
10279
|
className: "mb-2 mt-2 mr-2 text-xs -flex-col",
|
|
@@ -10329,16 +10329,16 @@ var Questions = (props) => {
|
|
|
10329
10329
|
{
|
|
10330
10330
|
disabled: disableSubmit,
|
|
10331
10331
|
style: {
|
|
10332
|
-
backgroundColor:
|
|
10332
|
+
backgroundColor: import_core24.TaskStatusColor[x[0]]
|
|
10333
10333
|
},
|
|
10334
10334
|
className: "h-6 text-xs p-1 m-1 text-forground-black -px-4 -py-2 w-full",
|
|
10335
10335
|
onClick: () => {
|
|
10336
|
-
if (
|
|
10336
|
+
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)
|
|
10337
10337
|
alert("Please provide all answers");
|
|
10338
10338
|
else
|
|
10339
10339
|
onSubmit(x);
|
|
10340
10340
|
},
|
|
10341
|
-
children:
|
|
10341
|
+
children: import_core24.TaskState[x[0]]
|
|
10342
10342
|
}
|
|
10343
10343
|
) });
|
|
10344
10344
|
}
|
|
@@ -10616,12 +10616,12 @@ var TimeSeries = () => {
|
|
|
10616
10616
|
};
|
|
10617
10617
|
|
|
10618
10618
|
// src/Components/OverlayLayer.tsx
|
|
10619
|
-
var
|
|
10619
|
+
var import_core26 = require("@geowiki/core");
|
|
10620
10620
|
var import_react23 = require("react");
|
|
10621
10621
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
10622
10622
|
var OverlayLayer = () => {
|
|
10623
10623
|
const layerStore = useMapLayerStore();
|
|
10624
|
-
const { data: wmsLayerNames } = (0,
|
|
10624
|
+
const { data: wmsLayerNames } = (0, import_core26.useEvolandWmsLayers)();
|
|
10625
10625
|
const [showLayerOpacity, setShowLayerOpacity] = (0, import_react23.useState)(false);
|
|
10626
10626
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "w-full items-center mt-2 justify-center text-xs", children: [
|
|
10627
10627
|
showLayerOpacity && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mt-2", children: [
|
|
@@ -10682,7 +10682,7 @@ var OverlayLayer = () => {
|
|
|
10682
10682
|
var import_leaflet10 = require("leaflet/dist/leaflet.css");
|
|
10683
10683
|
var import_react36 = require("react");
|
|
10684
10684
|
var import_react_leaflet15 = require("react-leaflet");
|
|
10685
|
-
var
|
|
10685
|
+
var import_core33 = require("@geowiki/core");
|
|
10686
10686
|
|
|
10687
10687
|
// src/Components/Map/LayerList.tsx
|
|
10688
10688
|
var import_react24 = require("react");
|
|
@@ -10698,7 +10698,7 @@ var useBaseLayerStore = (0, import_zustand5.create)((set) => ({
|
|
|
10698
10698
|
var import_react_leaflet12 = require("react-leaflet");
|
|
10699
10699
|
|
|
10700
10700
|
// src/utils/BingLayer.ts
|
|
10701
|
-
var
|
|
10701
|
+
var import_core27 = require("@react-leaflet/core");
|
|
10702
10702
|
|
|
10703
10703
|
// src/utils/LeafletBing.ts
|
|
10704
10704
|
var L13 = __toESM(require("leaflet"));
|
|
@@ -10825,7 +10825,7 @@ var BingLayer = class extends L13.TileLayer {
|
|
|
10825
10825
|
};
|
|
10826
10826
|
|
|
10827
10827
|
// src/utils/BingLayer.ts
|
|
10828
|
-
var BingLeafletLayer = (0,
|
|
10828
|
+
var BingLeafletLayer = (0, import_core27.createLayerComponent)(function createBingLayer(_a, context) {
|
|
10829
10829
|
var _b = _a, { apiKey } = _b, options = __objRest(_b, ["apiKey"]);
|
|
10830
10830
|
const instance = new BingLayer(apiKey, options);
|
|
10831
10831
|
return {
|
|
@@ -11316,7 +11316,7 @@ var CustomLegend = ({ layer }) => {
|
|
|
11316
11316
|
};
|
|
11317
11317
|
|
|
11318
11318
|
// src/Components/Controls/Legend.tsx
|
|
11319
|
-
var
|
|
11319
|
+
var import_core28 = require("@dnd-kit/core");
|
|
11320
11320
|
var import_sortable2 = require("@dnd-kit/sortable");
|
|
11321
11321
|
var import_utilities = require("@dnd-kit/utilities");
|
|
11322
11322
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
@@ -11531,12 +11531,12 @@ var Legend = () => {
|
|
|
11531
11531
|
const { layers, reorderLayers } = mapLayers_default();
|
|
11532
11532
|
const [isLoading, setIsLoading] = (0, import_react25.useState)(true);
|
|
11533
11533
|
const [isOneLegend, setIsOneLegend] = (0, import_react25.useState)(false);
|
|
11534
|
-
const sensors = (0,
|
|
11535
|
-
(0,
|
|
11536
|
-
(0,
|
|
11534
|
+
const sensors = (0, import_core28.useSensors)(
|
|
11535
|
+
(0, import_core28.useSensor)(import_core28.PointerSensor),
|
|
11536
|
+
(0, import_core28.useSensor)(import_core28.KeyboardSensor, {
|
|
11537
11537
|
coordinateGetter: import_sortable2.sortableKeyboardCoordinates
|
|
11538
11538
|
}),
|
|
11539
|
-
(0,
|
|
11539
|
+
(0, import_core28.useSensor)(import_core28.TouchSensor, {
|
|
11540
11540
|
activationConstraint: {
|
|
11541
11541
|
delay: 250,
|
|
11542
11542
|
tolerance: 10
|
|
@@ -11577,10 +11577,10 @@ var Legend = () => {
|
|
|
11577
11577
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: " text-base font-medium leading-[120%] max-w-[280px]", children: "There are currently no active layers." });
|
|
11578
11578
|
}
|
|
11579
11579
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "max-h-[60vh] overflow-y-auto space-y-3", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11580
|
-
|
|
11580
|
+
import_core28.DndContext,
|
|
11581
11581
|
{
|
|
11582
11582
|
sensors,
|
|
11583
|
-
collisionDetection:
|
|
11583
|
+
collisionDetection: import_core28.closestCenter,
|
|
11584
11584
|
onDragEnd: isOneLegend ? void 0 : handleDragEnd,
|
|
11585
11585
|
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11586
11586
|
import_sortable2.SortableContext,
|
|
@@ -11604,8 +11604,8 @@ var Legend = () => {
|
|
|
11604
11604
|
|
|
11605
11605
|
// src/Components/Controls/CustomBaseLayerControl.tsx
|
|
11606
11606
|
var import_react26 = require("react");
|
|
11607
|
-
var
|
|
11608
|
-
var
|
|
11607
|
+
var import_core29 = require("@geowiki/core");
|
|
11608
|
+
var import_core30 = require("@geowiki/core");
|
|
11609
11609
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
11610
11610
|
var BASE_LAYERS = [
|
|
11611
11611
|
{
|
|
@@ -11644,7 +11644,7 @@ var LayerButton = ({
|
|
|
11644
11644
|
onClick,
|
|
11645
11645
|
children: [
|
|
11646
11646
|
svg ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "relative", children: svg }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
11647
|
-
|
|
11647
|
+
import_core29.Image,
|
|
11648
11648
|
{
|
|
11649
11649
|
alt: "Base Layer",
|
|
11650
11650
|
src: link,
|
|
@@ -11663,7 +11663,7 @@ var CustomBaseLayerControl = () => {
|
|
|
11663
11663
|
const visibleLayers = showAll ? BASE_LAYERS : BASE_LAYERS.slice(0, 3);
|
|
11664
11664
|
const handleLayerChange = (layerName) => {
|
|
11665
11665
|
setSelectedLayer(layerName);
|
|
11666
|
-
|
|
11666
|
+
import_core30.trackMapEvent.baseLayerChange(layerName);
|
|
11667
11667
|
};
|
|
11668
11668
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { children: [
|
|
11669
11669
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "hidden lg:grid lg:grid-cols-4 lg:gap-x-1 lg:gap-y-2", children: [
|
|
@@ -11722,7 +11722,7 @@ var CustomBaseLayerControl = () => {
|
|
|
11722
11722
|
|
|
11723
11723
|
// src/Components/Controls/LayerSwitcher.tsx
|
|
11724
11724
|
var import_react27 = require("react");
|
|
11725
|
-
var
|
|
11725
|
+
var import_core31 = require("@geowiki/core");
|
|
11726
11726
|
var import_ui21 = require("@geowiki/ui");
|
|
11727
11727
|
var import_react28 = require("@headlessui/react");
|
|
11728
11728
|
var import_react29 = require("react");
|
|
@@ -11917,7 +11917,7 @@ var LayerItem = (0, import_react27.memo)(
|
|
|
11917
11917
|
);
|
|
11918
11918
|
LayerItem.displayName = "LayerItem";
|
|
11919
11919
|
var LayerSwitcher = (0, import_react27.memo)(() => {
|
|
11920
|
-
const { data: mapMenuItems, error, isLoading } = (0,
|
|
11920
|
+
const { data: mapMenuItems, error, isLoading } = (0, import_core31.useMapMenuItems)();
|
|
11921
11921
|
const store = mapLayers_default();
|
|
11922
11922
|
const { customLayers } = useCustomLayerStore();
|
|
11923
11923
|
console.log("customLayers from layerSwitcher", customLayers);
|
|
@@ -12100,7 +12100,7 @@ var Popover5 = __toESM(require("@radix-ui/react-popover"));
|
|
|
12100
12100
|
// src/Components/Controls/ControlComponents.tsx
|
|
12101
12101
|
var import_react32 = __toESM(require("react"));
|
|
12102
12102
|
var Popover4 = __toESM(require("@radix-ui/react-popover"));
|
|
12103
|
-
var
|
|
12103
|
+
var import_core32 = require("@geowiki/core");
|
|
12104
12104
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12105
12105
|
var ControlPanel = ({
|
|
12106
12106
|
title,
|
|
@@ -12132,7 +12132,7 @@ var SimpleControlButton = import_react32.default.forwardRef(
|
|
|
12132
12132
|
buttonName = "unknown_simple_button"
|
|
12133
12133
|
}, ref) => {
|
|
12134
12134
|
const handleClick = (event) => {
|
|
12135
|
-
|
|
12135
|
+
import_core32.trackUserEvent.mapControlClick(
|
|
12136
12136
|
buttonName,
|
|
12137
12137
|
isActive ? "active" : "inactive"
|
|
12138
12138
|
);
|
|
@@ -12435,7 +12435,7 @@ var BasicMap = () => {
|
|
|
12435
12435
|
((_d = (_c = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _c.Latitude) == null ? void 0 : _d.Text) || 48.2082,
|
|
12436
12436
|
((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
|
|
12437
12437
|
];
|
|
12438
|
-
(0,
|
|
12438
|
+
(0, import_core33.useRenderInfo)("BasicMap");
|
|
12439
12439
|
if (isSettingsLoading)
|
|
12440
12440
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_ui25.LoaderFull, {});
|
|
12441
12441
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
@@ -12473,20 +12473,20 @@ var import_useMapSettings2 = __toESM(require("@geowiki/core/src/hooks/useMapSett
|
|
|
12473
12473
|
var import_ui33 = require("@geowiki/ui");
|
|
12474
12474
|
|
|
12475
12475
|
// src/Components/Basf/BasfLayerList.tsx
|
|
12476
|
-
var
|
|
12476
|
+
var import_core35 = require("@geowiki/core");
|
|
12477
12477
|
|
|
12478
12478
|
// src/utils/WmsWithFilter.ts
|
|
12479
|
-
var
|
|
12480
|
-
var WMSWithFilterTileLayer = (0,
|
|
12479
|
+
var import_core34 = require("@react-leaflet/core");
|
|
12480
|
+
var WMSWithFilterTileLayer = (0, import_core34.createTileLayerComponent)(
|
|
12481
12481
|
function createWMSTileLayer2(_a, context) {
|
|
12482
12482
|
var _b = _a, { eventHandlers: _eh, params = {}, url } = _b, props = __objRest(_b, ["eventHandlers", "params", "url"]);
|
|
12483
12483
|
const layer = new BetterWMS(url, __spreadValues(__spreadProps(__spreadValues({}, params), {
|
|
12484
12484
|
url
|
|
12485
12485
|
}), props));
|
|
12486
|
-
return (0,
|
|
12486
|
+
return (0, import_core34.createElementObject)(layer, context);
|
|
12487
12487
|
},
|
|
12488
12488
|
function updateWMSTileLayer2(layer, props, prevProps) {
|
|
12489
|
-
(0,
|
|
12489
|
+
(0, import_core34.updateGridLayer)(layer, props, prevProps);
|
|
12490
12490
|
if (props.params && props.params !== prevProps.params) {
|
|
12491
12491
|
layer.setParams(props.params);
|
|
12492
12492
|
}
|
|
@@ -12581,7 +12581,7 @@ var BasfMapLayer = (layerInfo) => {
|
|
|
12581
12581
|
// src/Components/Basf/BasfLayerList.tsx
|
|
12582
12582
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12583
12583
|
var BasfLayerList = () => {
|
|
12584
|
-
const basfStore = (0,
|
|
12584
|
+
const basfStore = (0, import_core35.useBasfStore)();
|
|
12585
12585
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { children: basfStore.selectedItems.map((mapItem) => {
|
|
12586
12586
|
return mapItem.enabled ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BasfMapLayer, __spreadValues({}, mapItem), mapItem.id) : null;
|
|
12587
12587
|
}) });
|
|
@@ -12626,7 +12626,7 @@ var import_lucide_react4 = require("lucide-react");
|
|
|
12626
12626
|
var import_react45 = require("react");
|
|
12627
12627
|
|
|
12628
12628
|
// src/Components/Basf/BasfLegend.tsx
|
|
12629
|
-
var
|
|
12629
|
+
var import_core36 = require("@geowiki/core");
|
|
12630
12630
|
|
|
12631
12631
|
// src/Components/Basf/BasfItemCard.tsx
|
|
12632
12632
|
var import_ui26 = require("@geowiki/ui");
|
|
@@ -12787,10 +12787,10 @@ var formatDisplayValue = (value) => value.replace(/[_-]/g, " ").replace(
|
|
|
12787
12787
|
(txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
|
|
12788
12788
|
);
|
|
12789
12789
|
var BasfLegend = () => {
|
|
12790
|
-
const removeItem = (0,
|
|
12791
|
-
const updateItemOpacity = (0,
|
|
12792
|
-
const updateItemEnabled = (0,
|
|
12793
|
-
const selectedItems = (0,
|
|
12790
|
+
const removeItem = (0, import_core36.useBasfStore)((state) => state.removeItem);
|
|
12791
|
+
const updateItemOpacity = (0, import_core36.useBasfStore)((state) => state.updateItemOpacity);
|
|
12792
|
+
const updateItemEnabled = (0, import_core36.useBasfStore)((state) => state.updateItemEnabled);
|
|
12793
|
+
const selectedItems = (0, import_core36.useBasfStore)((state) => state.selectedItems);
|
|
12794
12794
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12795
12795
|
"div",
|
|
12796
12796
|
{
|
|
@@ -12819,7 +12819,7 @@ var import_react_hook_form3 = require("react-hook-form");
|
|
|
12819
12819
|
var z = __toESM(require("zod"));
|
|
12820
12820
|
var import_uuid3 = require("uuid");
|
|
12821
12821
|
var import_zod = require("@hookform/resolvers/zod");
|
|
12822
|
-
var
|
|
12822
|
+
var import_core37 = require("@geowiki/core");
|
|
12823
12823
|
|
|
12824
12824
|
// src/Components/Basf/basf-form.tsx
|
|
12825
12825
|
var import_react42 = require("react");
|
|
@@ -13122,8 +13122,8 @@ var BasfSelect = () => {
|
|
|
13122
13122
|
const [isSubmitting, setIsSubmitting] = (0, import_react43.useState)(false);
|
|
13123
13123
|
const { clearData } = useSelectedPixelStore();
|
|
13124
13124
|
const [isReset, setIsReset] = (0, import_react43.useState)(false);
|
|
13125
|
-
const addItem = (0,
|
|
13126
|
-
const selectedItems = (0,
|
|
13125
|
+
const addItem = (0, import_core37.useBasfStore)((0, import_react43.useCallback)((state) => state.addItem, []));
|
|
13126
|
+
const selectedItems = (0, import_core37.useBasfStore)(
|
|
13127
13127
|
(0, import_react43.useCallback)((state) => state.selectedItems, [])
|
|
13128
13128
|
);
|
|
13129
13129
|
const {
|
|
@@ -13269,7 +13269,7 @@ var import_react_leaflet17 = require("react-leaflet");
|
|
|
13269
13269
|
var import_leaflet12 = __toESM(require("leaflet"));
|
|
13270
13270
|
var import_leaflet13 = require("leaflet.polylinemeasure");
|
|
13271
13271
|
var import_ui31 = require("@geowiki/ui");
|
|
13272
|
-
var
|
|
13272
|
+
var import_core38 = require("@geowiki/core");
|
|
13273
13273
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13274
13274
|
function PolylineMeasureControl() {
|
|
13275
13275
|
const map = (0, import_react_leaflet17.useMap)();
|
|
@@ -13307,18 +13307,18 @@ function PolylineMeasureControl() {
|
|
|
13307
13307
|
if (active) {
|
|
13308
13308
|
controlRef.current._toggleMeasure();
|
|
13309
13309
|
setActive(false);
|
|
13310
|
-
|
|
13310
|
+
import_core38.trackMapEvent.measurementTool("stop");
|
|
13311
13311
|
} else {
|
|
13312
13312
|
controlRef.current._toggleMeasure();
|
|
13313
13313
|
setActive(true);
|
|
13314
|
-
|
|
13314
|
+
import_core38.trackMapEvent.measurementTool("start");
|
|
13315
13315
|
}
|
|
13316
13316
|
};
|
|
13317
13317
|
const clearMeasurements = () => {
|
|
13318
13318
|
if (!controlRef.current)
|
|
13319
13319
|
return;
|
|
13320
13320
|
controlRef.current._clearAllMeasurements();
|
|
13321
|
-
|
|
13321
|
+
import_core38.trackMapEvent.measurementTool("clear");
|
|
13322
13322
|
};
|
|
13323
13323
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex gap-2", children: [
|
|
13324
13324
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_ui31.Button, { onClick: togglePolylineMeasure, children: active ? "Stop" : "Start" }),
|
|
@@ -13463,15 +13463,15 @@ var import_react49 = require("react");
|
|
|
13463
13463
|
// src/Components/Controls/GeoTreesDownloadContent.tsx
|
|
13464
13464
|
var import_react47 = require("react");
|
|
13465
13465
|
var import_react_hook_form4 = require("react-hook-form");
|
|
13466
|
-
var
|
|
13467
|
-
var
|
|
13466
|
+
var import_core39 = require("@geowiki/core");
|
|
13467
|
+
var import_core40 = require("@geowiki/core");
|
|
13468
13468
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
13469
13469
|
var GeoTreesDownloadContent = () => {
|
|
13470
13470
|
var _a, _b;
|
|
13471
13471
|
const [countries, setCountries] = (0, import_react47.useState)([]);
|
|
13472
13472
|
const [versions, setVersions] = (0, import_react47.useState)([]);
|
|
13473
13473
|
const baseUrl = process.env.NEXT_PUBLIC_GEO_TREE_API_URL;
|
|
13474
|
-
const { data: session } = (0,
|
|
13474
|
+
const { data: session } = (0, import_core39.useSession)();
|
|
13475
13475
|
const {
|
|
13476
13476
|
register,
|
|
13477
13477
|
handleSubmit,
|
|
@@ -13553,7 +13553,7 @@ var GeoTreesDownloadContent = () => {
|
|
|
13553
13553
|
}, [baseUrl, session == null ? void 0 : session.accessToken]);
|
|
13554
13554
|
const onSubmit = (data) => {
|
|
13555
13555
|
const { format, purpose, email, name, country, version } = data;
|
|
13556
|
-
|
|
13556
|
+
import_core40.trackDownloadEvent.attempt(
|
|
13557
13557
|
format,
|
|
13558
13558
|
country,
|
|
13559
13559
|
version,
|
|
@@ -13598,10 +13598,10 @@ var GeoTreesDownloadContent = () => {
|
|
|
13598
13598
|
link.click();
|
|
13599
13599
|
document.body.removeChild(link);
|
|
13600
13600
|
window.URL.revokeObjectURL(url);
|
|
13601
|
-
|
|
13601
|
+
import_core40.trackDownloadEvent.success(filename, purpose, session || void 0);
|
|
13602
13602
|
}).catch((error) => {
|
|
13603
13603
|
console.error("Error downloading file:", error);
|
|
13604
|
-
|
|
13604
|
+
import_core40.trackDownloadEvent.failure(
|
|
13605
13605
|
error.message,
|
|
13606
13606
|
purpose,
|
|
13607
13607
|
session || void 0
|
|
@@ -13615,8 +13615,8 @@ var GeoTreesDownloadContent = () => {
|
|
|
13615
13615
|
"button",
|
|
13616
13616
|
{
|
|
13617
13617
|
onClick: () => {
|
|
13618
|
-
|
|
13619
|
-
(0,
|
|
13618
|
+
import_core40.trackDownloadEvent.loginAttempt(session || void 0);
|
|
13619
|
+
(0, import_core39.signIn)();
|
|
13620
13620
|
},
|
|
13621
13621
|
className: "w-full py-2 px-4 bg-blue-500 text-white rounded-md hover:bg-blue-600 transition-colors",
|
|
13622
13622
|
children: "Login"
|
|
@@ -14559,7 +14559,7 @@ var GeoTreesMap = () => {
|
|
|
14559
14559
|
var import_leaflet21 = require("leaflet/dist/leaflet.css");
|
|
14560
14560
|
var import_react58 = require("react");
|
|
14561
14561
|
var import_react_leaflet27 = require("react-leaflet");
|
|
14562
|
-
var
|
|
14562
|
+
var import_core41 = require("@geowiki/core");
|
|
14563
14563
|
var import_useMapSettings4 = __toESM(require("@geowiki/core/src/hooks/useMapSettings"));
|
|
14564
14564
|
var import_ui41 = require("@geowiki/ui");
|
|
14565
14565
|
|
|
@@ -15819,7 +15819,7 @@ var CanopyMap = () => {
|
|
|
15819
15819
|
((_d = (_c = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _c.Latitude) == null ? void 0 : _d.Text) || 48.2082,
|
|
15820
15820
|
((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
|
|
15821
15821
|
];
|
|
15822
|
-
(0,
|
|
15822
|
+
(0, import_core41.useRenderInfo)("BasicMap");
|
|
15823
15823
|
if (isSettingsLoading)
|
|
15824
15824
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_ui41.LoaderFull, { showInCenter: false });
|
|
15825
15825
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_jsx_runtime74.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
@@ -15856,7 +15856,7 @@ var import_react_hook_form6 = require("react-hook-form");
|
|
|
15856
15856
|
var z3 = __toESM(require("zod"));
|
|
15857
15857
|
var import_uuid4 = require("uuid");
|
|
15858
15858
|
var import_zod2 = require("@hookform/resolvers/zod");
|
|
15859
|
-
var
|
|
15859
|
+
var import_core42 = require("@geowiki/core");
|
|
15860
15860
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15861
15861
|
var formSchema2 = z3.object({
|
|
15862
15862
|
formType: z3.enum(["Biomass", "CropProduction"], {
|
|
@@ -15913,14 +15913,14 @@ ForwardedSelect3.displayName = "ForwardedSelect";
|
|
|
15913
15913
|
var BasfLeftPanel = () => {
|
|
15914
15914
|
const [isSubmitting, setIsSubmitting] = (0, import_react59.useState)(false);
|
|
15915
15915
|
const { clearData } = useSelectedPixelStore();
|
|
15916
|
-
const isLeftOverlayOpen = (0,
|
|
15916
|
+
const isLeftOverlayOpen = (0, import_core42.useBasfStore)(
|
|
15917
15917
|
(0, import_react59.useCallback)((state) => state.leftPanelOpen, [])
|
|
15918
15918
|
);
|
|
15919
|
-
const setIsLeftOverlayOpen = (0,
|
|
15919
|
+
const setIsLeftOverlayOpen = (0, import_core42.useBasfStore)(
|
|
15920
15920
|
(0, import_react59.useCallback)((state) => state.updateLeftPanelOpen, [])
|
|
15921
15921
|
);
|
|
15922
|
-
const addItem = (0,
|
|
15923
|
-
const selectedItems = (0,
|
|
15922
|
+
const addItem = (0, import_core42.useBasfStore)((0, import_react59.useCallback)((state) => state.addItem, []));
|
|
15923
|
+
const selectedItems = (0, import_core42.useBasfStore)(
|
|
15924
15924
|
(0, import_react59.useCallback)((state) => state.selectedItems, [])
|
|
15925
15925
|
);
|
|
15926
15926
|
const {
|
|
@@ -16023,7 +16023,7 @@ var BasfLeftPanel = () => {
|
|
|
16023
16023
|
var basf_left_panel_default = (0, import_react59.memo)(BasfLeftPanel);
|
|
16024
16024
|
|
|
16025
16025
|
// src/Components/Basf/basf-right-panel.tsx
|
|
16026
|
-
var
|
|
16026
|
+
var import_core43 = require("@geowiki/core");
|
|
16027
16027
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
16028
16028
|
|
|
16029
16029
|
// src/Components/Map/GeoWikiMap.tsx
|
|
@@ -16031,11 +16031,11 @@ var import_react60 = require("react");
|
|
|
16031
16031
|
var import_react_leaflet28 = require("react-leaflet");
|
|
16032
16032
|
var import_leaflet23 = require("leaflet/dist/leaflet.css");
|
|
16033
16033
|
var import_dist = require("@bopen/leaflet-area-selection/dist/index.css");
|
|
16034
|
-
var
|
|
16034
|
+
var import_core45 = require("@geowiki/core");
|
|
16035
16035
|
var import_ui43 = require("@geowiki/ui");
|
|
16036
16036
|
|
|
16037
16037
|
// ../../apps/geowiki/components/Map/CustomWMS.tsx
|
|
16038
|
-
var
|
|
16038
|
+
var import_core44 = require("@react-leaflet/core");
|
|
16039
16039
|
|
|
16040
16040
|
// ../../apps/geowiki/lib/utils/BetterWMS.ts
|
|
16041
16041
|
var import_leaflet22 = __toESM(require("leaflet"));
|
|
@@ -16164,19 +16164,19 @@ var BetterWMS2 = class extends import_leaflet22.default.TileLayer.WMS {
|
|
|
16164
16164
|
};
|
|
16165
16165
|
|
|
16166
16166
|
// ../../apps/geowiki/components/Map/CustomWMS.tsx
|
|
16167
|
-
var CustomWMSTileLayer2 = (0,
|
|
16167
|
+
var CustomWMSTileLayer2 = (0, import_core44.createTileLayerComponent)(
|
|
16168
16168
|
function createWMSTileLayer3(_a, context) {
|
|
16169
16169
|
var _b = _a, { params = {}, url } = _b, options = __objRest(_b, ["params", "url"]);
|
|
16170
16170
|
var instance = new BetterWMS2(url, __spreadValues(__spreadProps(__spreadValues({}, params), {
|
|
16171
16171
|
url
|
|
16172
|
-
}), (0,
|
|
16172
|
+
}), (0, import_core44.withPane)(options, context)));
|
|
16173
16173
|
return {
|
|
16174
16174
|
instance,
|
|
16175
16175
|
context
|
|
16176
16176
|
};
|
|
16177
16177
|
},
|
|
16178
16178
|
function updateWMSTileLayer3(layer, props, prevProps) {
|
|
16179
|
-
(0,
|
|
16179
|
+
(0, import_core44.updateGridLayer)(layer, props, prevProps);
|
|
16180
16180
|
if (props.params != null && props.params !== prevProps.params) {
|
|
16181
16181
|
layer.setParams(props.params);
|
|
16182
16182
|
}
|
|
@@ -16184,26 +16184,26 @@ var CustomWMSTileLayer2 = (0, import_core33.createTileLayerComponent)(
|
|
|
16184
16184
|
);
|
|
16185
16185
|
|
|
16186
16186
|
// src/Components/Map/GeoWikiMap.tsx
|
|
16187
|
-
var
|
|
16187
|
+
var import_core46 = require("@geowiki/core");
|
|
16188
16188
|
var import_react_hotkeys_hook3 = require("react-hotkeys-hook");
|
|
16189
16189
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
16190
16190
|
var GeoWikiMapComponent = ({ mapSettings, session }) => {
|
|
16191
16191
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
16192
16192
|
const mapRef = (0, import_react60.useRef)();
|
|
16193
|
-
const router = (0,
|
|
16193
|
+
const router = (0, import_core46.useRouter)();
|
|
16194
16194
|
var projectId = router.query.projectId;
|
|
16195
16195
|
var locationId = router.query.locationId;
|
|
16196
16196
|
var taskId = router.query.taskId !== void 0 ? parseInt(router.query.taskId) : 0;
|
|
16197
16197
|
const layerStore = useMapLayerStore();
|
|
16198
16198
|
const mapStore = useMapStore();
|
|
16199
16199
|
const evolandStore = useEvolandStore();
|
|
16200
|
-
const panelStore = (0,
|
|
16201
|
-
const evolandFeature = (0,
|
|
16202
|
-
var userRole = (0,
|
|
16203
|
-
var userId = (0,
|
|
16204
|
-
const { data: wmsLayerNames } = (0,
|
|
16205
|
-
const { data: geoWikiSettings } = (0,
|
|
16206
|
-
const { data: introTourSteps } = (0,
|
|
16200
|
+
const panelStore = (0, import_core45.usePanelStore)();
|
|
16201
|
+
const evolandFeature = (0, import_core45.useFeature)("GeoWiki.EvoLand");
|
|
16202
|
+
var userRole = (0, import_core45.tokenData)((_a = session.data) == null ? void 0 : _a.accessToken, "role");
|
|
16203
|
+
var userId = (0, import_core45.tokenData)((_b = session.data) == null ? void 0 : _b.accessToken, "sub");
|
|
16204
|
+
const { data: wmsLayerNames } = (0, import_core45.useEvolandWmsLayers)();
|
|
16205
|
+
const { data: geoWikiSettings } = (0, import_core45.useGeoWikiSettings)();
|
|
16206
|
+
const { data: introTourSteps } = (0, import_core45.useIntroTourSettings)();
|
|
16207
16207
|
const [showAsset, setShowAsset] = (0, import_react60.useState)(false);
|
|
16208
16208
|
const [fetchLocationMetaData, setFetchLocationMetaData] = (0, import_react60.useState)(false);
|
|
16209
16209
|
const [defaultActivityView, setDefaultActivityView] = (0, import_react60.useState)("");
|
|
@@ -16213,7 +16213,7 @@ var GeoWikiMapComponent = ({ mapSettings, session }) => {
|
|
|
16213
16213
|
((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Latitude) == null ? void 0 : _f.Text) || 48.2082,
|
|
16214
16214
|
((_h = (_g = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _g.Longitude) == null ? void 0 : _h.Text) || 16.3738
|
|
16215
16215
|
];
|
|
16216
|
-
(0,
|
|
16216
|
+
(0, import_core45.useRenderInfo)("GeoWikiMap");
|
|
16217
16217
|
if (!fetchLocationMetaData && (evolandStore.referenceDate || evolandStore.reference_dates)) {
|
|
16218
16218
|
evolandStore.getLocationMetaData(locationId, parseInt(projectId), taskId);
|
|
16219
16219
|
setFetchLocationMetaData(true);
|
|
@@ -16269,7 +16269,7 @@ var GeoWikiMapComponent = ({ mapSettings, session }) => {
|
|
|
16269
16269
|
};
|
|
16270
16270
|
(0, import_react60.useEffect)(() => {
|
|
16271
16271
|
var _a2;
|
|
16272
|
-
if ((0,
|
|
16272
|
+
if ((0, import_core45.IsTokenExpired)((_a2 = session.data) == null ? void 0 : _a2.expires)) {
|
|
16273
16273
|
evolandStore.setSessionTimeOut(true);
|
|
16274
16274
|
}
|
|
16275
16275
|
}, [evolandStore.sessionTimeOut, (_l = session.data) == null ? void 0 : _l.expires]);
|
|
@@ -16292,7 +16292,7 @@ var GeoWikiMapComponent = ({ mapSettings, session }) => {
|
|
|
16292
16292
|
{
|
|
16293
16293
|
variant: "outline",
|
|
16294
16294
|
className: "flex ml-20",
|
|
16295
|
-
onClick: () => (0,
|
|
16295
|
+
onClick: () => (0, import_core45.showIntroTour)(selectIntroTourSteps()),
|
|
16296
16296
|
children: "Guide"
|
|
16297
16297
|
}
|
|
16298
16298
|
) }),
|
|
@@ -16576,15 +16576,15 @@ var GeoWikiMap = (0, import_react60.memo)(GeoWikiMapComponent);
|
|
|
16576
16576
|
// src/Components/Map/WaybackTimelineMap.tsx
|
|
16577
16577
|
var import_react61 = require("react");
|
|
16578
16578
|
var import_react_leaflet29 = require("react-leaflet");
|
|
16579
|
-
var
|
|
16580
|
-
var
|
|
16579
|
+
var import_core47 = require("@geowiki/core");
|
|
16580
|
+
var import_core48 = require("@geowiki/core");
|
|
16581
16581
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
16582
16582
|
var WaybackTimelineMap = (props) => {
|
|
16583
16583
|
var _a;
|
|
16584
16584
|
const mapRef = (0, import_react61.useRef)(null);
|
|
16585
|
-
const searchParams = (0,
|
|
16585
|
+
const searchParams = (0, import_core48.useSearchParams)();
|
|
16586
16586
|
var center4 = [48.2082, 16.3738];
|
|
16587
|
-
(0,
|
|
16587
|
+
(0, import_core47.useRenderInfo)("WaybackTimelineMap");
|
|
16588
16588
|
const [WAYBACK_SNAPSHOTS, setWAYBACK_SNAPSHOTS] = (0, import_react61.useState)(null);
|
|
16589
16589
|
function MapZoomEvents() {
|
|
16590
16590
|
const mapEvents = (0, import_react_leaflet29.useMapEvents)({
|