feat: Add scale on group click, add cache for map entities, fix map preview loading

This commit is contained in:
2025-07-15 05:29:27 +03:00
parent 97f95fc394
commit 89d7fc2748
7 changed files with 547 additions and 299 deletions

View File

@@ -1,3 +1,4 @@
import React from "react";
import { Stage, useGLTF } from "@react-three/drei";
import { Canvas } from "@react-three/fiber";
import { OrbitControls } from "@react-three/drei";
@@ -5,12 +6,21 @@ import { OrbitControls } from "@react-three/drei";
export const ModelViewer3D = ({
fileUrl,
height = "100%",
onLoad,
}: {
fileUrl: string;
height: string;
onLoad?: () => void;
}) => {
const { scene } = useGLTF(fileUrl);
// Вызываем onLoad когда модель загружена
React.useEffect(() => {
if (onLoad) {
onLoad();
}
}, [scene, onLoad]);
return (
<Canvas style={{ width: "100%", height: height }}>
<ambientLight />