feat: Add scale on group click, add cache for map entities, fix map preview loading
This commit is contained in:
@@ -51,7 +51,7 @@ export const LanguageSwitcher = observer(() => {
|
||||
key={lang}
|
||||
onClick={() => handleLanguageChange(lang)}
|
||||
variant={"contained"} // Highlight the active language
|
||||
color={language === lang ? "primary" : "secondary"}
|
||||
color={language === lang ? "primary" : "inherit"}
|
||||
sx={{ minWidth: "60px" }} // Give buttons a consistent width
|
||||
>
|
||||
{getLanguageLabel(lang)}
|
||||
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user