Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/src/components/MapControls/MapControls.jsx
rd565449 r0c6b92a 1 import React, { useState} from "react";1 import React, {useEffect, useState} from "react"; 2 2 import styles from "./MapControls.module.css"; 3 3 import plusIcon from "../../assets/plus_icon.png"; 4 4 import minusIcon from "../../assets/minus_icon.png"; 5 5 import floorIcon from "../../assets/floor_icon.png"; 6 import HttpService from "../../scripts/net/HttpService.js"; 6 7 7 export default function MapControls({ onZoomIn, onZoomOut, onFloorChange }) { 8 const [currentFloor, setCurrentFloor] = useState(1); // Starting floor 8 export default function MapControls({onFloorChange,mapName }) { 9 const [currentFloor, setCurrentFloor] = useState(0); 10 const [floors, setFloors] = useState([]); 11 12 // Starting floor 9 13 10 14 // Handle floor selection … … 20 24 {/* Zoom Controls */} 21 25 <div className={styles.zoomControls}> 22 <button onClick={onZoomIn}className={styles.zoomButton}>26 <button className={styles.zoomButton}> 23 27 <img src={plusIcon} alt="Zoom In" /> 24 28 </button> 25 <button onClick={onZoomOut}className={styles.zoomButton}>29 <button className={styles.zoomButton}> 26 30 <img src={minusIcon} alt="Zoom Out" /> 27 31 </button> … … 29 33 30 34 {/* Floor Selector */} 31 <div className={styles.floorSelector}> 32 <img src={floorIcon} alt="Floor Icon" className={styles.floorIcon} /> 33 <select 34 value={currentFloor} 35 onChange={(e) => handleFloorChange(parseInt(e.target.value, 10))} 36 className={styles.floorDropdown} 37 > 38 <option value={1}>1F</option> 39 <option value={2}>2F</option> 40 <option value={3}>3F</option> 41 <option value={4}>4F</option> 42 </select> 43 </div> 35 {/*<div className={styles.floorSelector}>*/} 36 {/* <img src={floorIcon} alt="Floor Icon" className={styles.floorIcon} />*/} 37 {/* <select*/} 38 {/* value={currentFloor}*/} 39 {/* onChange={(e) => handleFloorChange(parseInt(e.target.value, 10))}*/} 40 {/* className={styles.floorDropdown}*/} 41 {/* >*/} 42 {/* {floors?.map(floor => (*/} 43 {/* <option key={floor.floorNumber} value={floor.floorNumber}>*/} 44 {/* {floor.floorNumber}F*/} 45 {/* </option>*/} 46 47 {/* ))}*/} 48 {/* /!*<option value={1}>1F</option>*!/*/} 49 {/* /!*<option value={2}>2F</option>*!/*/} 50 {/* /!*<option value={3}>3F</option>*!/*/} 51 {/* /!*<option value={4}>4F</option>*!/*/} 52 {/* </select>*/} 53 {/*</div>*/} 44 54 </div> 45 55 );
Note:
See TracChangeset
for help on using the changeset viewer.