[d565449] | 1 | import React, { useEffect, useState } from "react";
|
---|
| 2 | import SearchBar from "../../components/SearchBar/SearchBar";
|
---|
| 3 | import FilterBar from "../../components/FilterBar/FilterBar";
|
---|
| 4 | import Profile from "../../components/Profile/Profile";
|
---|
| 5 | import SideBar from "../../components/SideBar/SideBar";
|
---|
| 6 | import Draw from "../../pages/Draw/Draw";
|
---|
| 7 | import { MapDisplay } from "../../scripts/main/MapDisplay.js";
|
---|
| 8 | import MapControls from "../../components/MapControls/MapControls";
|
---|
| 9 | import styles from "./FinkiMaps.module.css";
|
---|
| 10 |
|
---|
| 11 | function FinkiMaps() {
|
---|
| 12 | const [app,setApp] = useState(null);
|
---|
| 13 |
|
---|
| 14 | useEffect(() => {
|
---|
| 15 | const app = new MapDisplay("map");
|
---|
| 16 | app.loadMap();
|
---|
| 17 | setApp(app);
|
---|
| 18 | }, []);
|
---|
| 19 |
|
---|
| 20 | const handleZoomIn = () => {
|
---|
| 21 | console.log("Zooming in");
|
---|
| 22 | };
|
---|
| 23 |
|
---|
| 24 | const handleZoomOut = () => {
|
---|
| 25 | console.log("Zooming out");
|
---|
| 26 | };
|
---|
| 27 |
|
---|
| 28 | const handleFloorChange = (floor) => {
|
---|
| 29 | console.log(`Switched to floor ${floor}`);
|
---|
| 30 | };
|
---|
| 31 |
|
---|
| 32 | return (
|
---|
| 33 | <div id="main" className={styles.main}>
|
---|
| 34 | <div id="map" className={styles.mapContainer}></div>
|
---|
| 35 | <div className={styles.toolbar}>
|
---|
| 36 | <SideBar />
|
---|
| 37 | <div className={styles.left}>
|
---|
| 38 | <SearchBar map={app}/>
|
---|
| 39 | <FilterBar />
|
---|
| 40 | </div>
|
---|
| 41 | <div className={styles.right}>
|
---|
| 42 | <Profile />
|
---|
| 43 | </div>
|
---|
| 44 | </div>
|
---|
| 45 |
|
---|
| 46 | <div className={styles.mapControlsContainer}>
|
---|
| 47 | <MapControls onZoomIn={handleZoomIn} onZoomOut={handleZoomOut} onFloorChange={handleFloorChange} />
|
---|
| 48 | </div>
|
---|
| 49 | </div>
|
---|
| 50 | );
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | export default FinkiMaps;
|
---|