diff --git a/src/components/map/Processing.tsx b/src/components/map/Processing.tsx
index b6c96a4..605e5da 100644
--- a/src/components/map/Processing.tsx
+++ b/src/components/map/Processing.tsx
@@ -13,7 +13,6 @@ export function BuildingHeights({ area }: { area: any }) {
const appendAreas = useAreaStore((state) => state.appendAreas);
const requestBuildings = () => {
- console.log(area);
const south = area[1].lat;
const west = area[1].lng;
const north = area[0].lat;
@@ -50,7 +49,29 @@ export function BuildingHeights({ area }: { area: any }) {
position: "relative",
})}
>
-
+
(null);
+
+ return (
+ {
+ setHovered(true);
+ e.stopPropagation();
+ }}
+ onPointerOut={(e) => {
+ setHovered(false);
+ e.stopPropagation();
+ }}
+ onPointerMove={(e) => {
+ setHoverPos(e.point.clone());
+ e.stopPropagation();
+ }}
+ onClick={(e) => {
+ setClicked(!clicked);
+ e.stopPropagation();
+ }}
+ rotation={[-Math.PI / 2, 0, 0]}
+ >
+
+
+ {(hovered || clicked) && hoverPos && (
+
+
+
{JSON.stringify(tags)}
+
+
+ )}
+
+ );
+}
+
export function Space() {
const areas = useAreaStore((state) => state.areas);
const center = useAreaStore((state) => state.center);
@@ -18,8 +85,12 @@ export function Space() {
return new THREE.Vector2(x, y);
}
- const areaMap = () => {
- const result = [];
+ const areaData = () => {
+ const result: Array<{
+ shape: THREE.Shape;
+ extrudeSettings: any;
+ tags: any;
+ }> = [];
areas.forEach((bld: any) => {
if (!bld.geometry || bld.geometry.length < 3) return;
const shapePoints = bld.geometry.map((pt: any) =>
@@ -30,20 +101,25 @@ export function Space() {
}
const shape = new THREE.Shape(shapePoints);
let heightValue = parseFloat(bld.tags.height || "");
+ const heightLevels = parseFloat(bld.tags["building:levels"] || "");
if (isNaN(heightValue)) {
heightValue = 10;
}
+ if (!isNaN(heightLevels)) {
+ heightValue = heightLevels * 2.2;
+ }
const extrudeSettings = {
steps: 1,
depth: heightValue,
bevelEnabled: false,
};
- result.push([shape, extrudeSettings]);
+ result.push({ shape, extrudeSettings, tags: bld.tags });
});
- console.log(result);
return result;
};
+ const buildingsData = areaData();
+
return (