diff --git a/src/components/button/BottomButton.tsx b/src/components/button/BottomButton.tsx
index cebf0ea..2b38937 100644
--- a/src/components/button/BottomButton.tsx
+++ b/src/components/button/BottomButton.tsx
@@ -1,12 +1,15 @@
import { css } from "@emotion/react";
import { ButtonHTMLAttributes, DetailedHTMLProps } from "react";
-type ButtonProps = DetailedHTMLProps<
- ButtonHTMLAttributes,
- HTMLButtonElement
->;
+interface ButtonProps
+ extends DetailedHTMLProps<
+ ButtonHTMLAttributes,
+ HTMLButtonElement
+ > {
+ isShow?: boolean;
+}
-export function BottomButton(props: ButtonProps) {
+export function NextButton(props: ButtonProps) {
return (
+ {props.children}
+
+ );
+}
+
+export function PrevButton(props: ButtonProps) {
+ return (
+ processing
;
+import { css } from "@emotion/react";
+import React, { useState } from "react";
+
+interface Building {
+ id: number;
+ tags: { [key: string]: string | undefined };
+ geometry?: { lat: number; lng: number }[];
+}
+
+export function BuildingHeights({ area }: { area: any }) {
+ const [buildings, setBuildings] = useState([]);
+
+ const requestBuildings = () => {
+ console.log(area);
+ const south = area[1].lat;
+ const west = area[1].lng;
+ const north = area[0].lat;
+ const east = area[0].lng;
+ console.log(south, west, north, east);
+ const query = `[out:json][timeout:25];(way["building"]( ${south},${west},${north},${east} );relation["building"]( ${south},${west},${north},${east} ););out body geom;`;
+ fetch("https://overpass-api.de/api/interpreter", {
+ method: "POST",
+ body: query,
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
+ })
+ .then((response) => response.json())
+ .then((data) => {
+ const blds: Building[] = data.elements.map((element) => ({
+ id: element.id,
+ tags: element.tags,
+ geometry: element.geometry
+ ? element.geometry.map((pt) => ({ lat: pt.lat, lng: pt.lon }))
+ : undefined,
+ }));
+ setBuildings(blds);
+ console.log("Building Data:", blds);
+ })
+ .catch((error) => {
+ console.error("Error fetching building data:", error);
+ });
+ };
+
+ return (
+
+ );
}
diff --git a/src/components/map/SelectMap.tsx b/src/components/map/SelectMap.tsx
index c7b882f..6b472a9 100644
--- a/src/components/map/SelectMap.tsx
+++ b/src/components/map/SelectMap.tsx
@@ -11,12 +11,13 @@ import { css } from "@emotion/react";
function RectangleSelector({
isDrag = true,
+ bounds,
onChange,
}: {
isDrag: boolean;
+ bounds: LatLngBounds | null;
onChange: (LatLngBounds: LatLngBounds) => void;
}) {
- const [bounds, setBounds] = useState(null);
const [firstPoint, setFirstPoint] = useState(null);
useEffect(() => {
@@ -35,12 +36,11 @@ function RectangleSelector({
},
mousemove(e) {
if (firstPoint) {
- setBounds(new L.LatLngBounds(firstPoint, e.latlng));
+ onChange(new L.LatLngBounds(firstPoint, e.latlng));
}
},
mouseup(e) {
if (firstPoint) {
- setBounds(new L.LatLngBounds(firstPoint, e.latlng));
onChange(new L.LatLngBounds(firstPoint, e.latlng));
setFirstPoint(null);
}
@@ -51,14 +51,28 @@ function RectangleSelector({
) : null;
}
-export function MapComponent({ onDone }: { onDone: (e) => void }) {
+export function MapComponent({
+ onDone,
+ onRemove,
+}: {
+ onDone: (e) => void;
+ onRemove: () => void;
+}) {
const [isDrag, setIsDrag] = useState(true);
+ const [bounds, setBounds] = useState(null);
const handleClickSwitchDrag = () => {
setIsDrag(!isDrag);
};
+ const handleClickRemoveBox = () => {
+ onRemove();
+ setBounds(null);
+ setIsDrag(true);
+ };
+
const handleChangeDone = (e) => {
+ setBounds(e);
onDone([e._northEast, e._southWest]);
};
@@ -68,40 +82,80 @@ export function MapComponent({ onDone }: { onDone: (e) => void }) {
position: "relative",
})}
>
-
- {isDrag ? "Disable" : "Enable"} Drag
-
+
+ Remove Box
+
+
+
+ {isDrag ? "Select Box" : "Back to Drag"}
+
+
-
+
);
diff --git a/src/index.css b/src/index.css
index 6db4745..e1deaab 100644
--- a/src/index.css
+++ b/src/index.css
@@ -14,6 +14,11 @@ body,
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
+ -ms-overflow-style: none;
+}
+
+::-webkit-scrollbar {
+ display: none;
}
* {
diff --git a/src/ui/App.tsx b/src/ui/App.tsx
index 4244bd1..f3b0d6f 100644
--- a/src/ui/App.tsx
+++ b/src/ui/App.tsx
@@ -6,20 +6,36 @@ import { Description } from "@/components/text/Description";
import { Column } from "@/components/flex/Column";
import { MapComponent } from "@/components/map/SelectMap";
import { useState } from "react";
-import { BottomButton } from "@/components/button/BottomButton";
+import { NextButton, PrevButton } from "@/components/button/BottomButton";
+import { BuildingHeights } from "@/components/map/Processing";
function App() {
const [isNextButtonDisabled, setIsNextButtonDisabled] = useState(true);
- const handleDone = (e) => {
- console.log(e);
+ const [areaData, setAreaData] = useState([]);
+ const [steps, setSteps] = useState(["front", "processing"]);
+ const [step, setStep] = useState(0);
+
+ const handleDone = (data) => {
+ setAreaData(data);
setIsNextButtonDisabled(false);
};
- const handleClickNextStep = () => {};
+ const handleRemove = () => {
+ setAreaData([]);
+ setIsNextButtonDisabled(true);
+ };
+
+ const handleClickNextStep = () => {
+ setStep(step + 1);
+ };
+
+ const handleClickPrevStep = () => {
+ setStep(step - 1);
+ };
return (
-
+
Generate 3d map
@@ -27,16 +43,37 @@ function App() {
Tools to create 3D maps based on maps and export them in 3D format
-
+
-
+
+
+ Processing
+
+ Tools to create 3D maps based on maps and export them in 3D format
+
+
+
+
+
+
+
+
+ Prev Step
+
+
+
Next Step
-
+