diff --git a/frontend/src/components/Layout/TrainingDS/DatasetEditor/DatasetEditor.js b/frontend/src/components/Layout/TrainingDS/DatasetEditor/DatasetEditor.js index 7968727c..99fe203d 100644 --- a/frontend/src/components/Layout/TrainingDS/DatasetEditor/DatasetEditor.js +++ b/frontend/src/components/Layout/TrainingDS/DatasetEditor/DatasetEditor.js @@ -9,6 +9,7 @@ import MapActions from "./MapActions"; import axios from "../../../../axios"; import { useMutation } from "react-query"; import { useParams } from "react-router-dom"; +import DatasetEditorHeader from "./DatasetEditorHeader"; function DatasetEditor() { const [mapLayers, setMapLayers] = useState([]); @@ -54,7 +55,7 @@ function DatasetEditor() { return () => {}; }, []); - + const [zoom, setZoom] = useState(15); return ( <> {isLoading && "Loading ............"} @@ -77,9 +78,20 @@ function DatasetEditor() { setgeoJSON(null); }} dataset={dataset} + setZoom={setZoom} > - + + + { return ( <> - - - - - Dataset {props.dsId} : {props.dsName} - - + + + Dataset {props.dsId} : {props.dsName} + - - - Zoom: {props.zoom && +props.zoom.toFixed(1)} -
- {"Editing " + props.editMode} -
-
- - - { - console.log("changed", e); - props.setEditMode(e.target.value); - if (e.target.value === "aoi") { - // console.log("leaflet-bar a",document.querySelectorAll(".leaflet-bar a")) + + Zoom: {props.zoom && +props.zoom.toFixed(1)} + + {/* + + { + console.log("changed", e); + props.setEditMode(e.target.value); + if (e.target.value === "aoi") { + // console.log("leaflet-bar a",document.querySelectorAll(".leaflet-bar a")) - document.querySelectorAll(".leaflet-bar a").forEach((e) => { - e.style.backgroundColor = "rgb(51, 136, 255)"; - console.log("leaflet-bar a", e.style); - }); - } else { - console.log( - "leaflet-bar a", - document.querySelectorAll(".leaflet-bar a") - ); + document.querySelectorAll(".leaflet-bar a").forEach((e) => { + e.style.backgroundColor = "rgb(51, 136, 255)"; + console.log("leaflet-bar a", e.style); + }); + } else { + console.log( + "leaflet-bar a", + document.querySelectorAll(".leaflet-bar a") + ); - document.querySelectorAll(".leaflet-bar a").forEach((e) => { - e.style.backgroundColor = "#D73434"; - console.log("leaflet-bar a", e.style); - }); - } - }} - > - - } - label="AOIs" - labelPlacement="top" - /> - {/* - } - label="Labels" - labelPlacement="top" - /> */} - - + document.querySelectorAll(".leaflet-bar a").forEach((e) => { + e.style.backgroundColor = "#D73434"; + console.log("leaflet-bar a", e.style); + }); + } + }} + > + + + + */} - {/* */} -
- - - -
-
+ +
); }; diff --git a/frontend/src/components/Layout/TrainingDS/DatasetEditor/DatasetMap.js b/frontend/src/components/Layout/TrainingDS/DatasetEditor/DatasetMap.js index 11ce4017..01eb0db8 100644 --- a/frontend/src/components/Layout/TrainingDS/DatasetEditor/DatasetMap.js +++ b/frontend/src/components/Layout/TrainingDS/DatasetEditor/DatasetMap.js @@ -564,6 +564,7 @@ const DatasetMap = (props) => { const { _animateToZoom } = e.target; console.log("zoomend", e, _animateToZoom); setZoom(_animateToZoom); + props.setZoom(_animateToZoom); }, moveend: (e) => { const { _animateToZoom, _layers } = e.target; @@ -597,16 +598,6 @@ const DatasetMap = (props) => { return ( <> - - {mapError && Error: {mapError} } { style={{ height: "800px", width: "100%", - marginTop: "75px", }} zoom={zoom} + zoomDelta={0.25} + wheelPxPerZoomLevel={Math.round(36 / 0.5)} + zoomSnap={0} + scrollWheelZoom={true} + // inertia={true} whenCreated={setMap} > @@ -683,16 +678,12 @@ const DatasetMap = (props) => { { - console.log( - "selectedLayer", - document.querySelector('input[name="selectedLayer"]:checked') - .value - ); - _onCreate( - e, - document.querySelector('input[name="selectedLayer"]:checked') - .value - ); + // console.log( + // "selectedLayer", + // document.querySelector('input[name="selectedLayer"]:checked') + // .value + // ); + _onCreate(e, "aoi"); }} onEdited={_onEdited} onDeleted={_onDeleted}