From 2f0645708b7cc9592ce3496c4df76871ceea8cc3 Mon Sep 17 00:00:00 2001 From: Gabriel Dehame Date: Wed, 22 Feb 2023 14:56:29 +0100 Subject: [PATCH] =?UTF-8?q?ajout=20de=20gestion=20des=20connexions=20(pas?= =?UTF-8?q?=20test=C3=A9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Map.js | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/src/Map.js b/src/Map.js index 6deb5eb..80cec2d 100644 --- a/src/Map.js +++ b/src/Map.js @@ -37,16 +37,14 @@ function Lift({position, size, body}) } -function Toilet({position, size, body}) +function Toilet({position, size}) { // React class (in function form) to represent lifts, takes the position where to put the lift logo // and the body of the popup of the lift (list of floors accessible from that lift) const map = useMap(); const [markerIcon, setMarkerIcon] = useState(new L.Icon({ iconUrl: toilet, iconSize: size })); const mmap = useMapEvent('zoomend', () => {setMarkerIcon(new L.Icon({ iconUrl: toilet, iconSize: [20*Math.pow(2, map.getZoom() - 4), 20*Math.pow(2, map.getZoom() - 4)]}))}); - return - {body} - + return } function polygonCenter(polygon) @@ -161,14 +159,9 @@ function newPolygon(element, positions, selectedRoom, callbackRoomSelected, call return callbackRoomSelected(element["id"])}}> {element["id"]} -
  • { console.log("escalier"); }}> - YAY -
  • -
  • - uéuéué -
  • - - } + {floorList(element["connexions"], callbackChangeFloor)} + + } />
    } @@ -178,14 +171,9 @@ function newPolygon(element, positions, selectedRoom, callbackRoomSelected, call return callbackRoomSelected(element["id"])}}> {element["id"]} -
  • { console.log("ascenseur"); }}> - YAY -
  • -
  • - uéuéué -
  • - - } + {floorList(element["connexions"], callbackChangeFloor)} + + } />
    } @@ -193,16 +181,7 @@ function newPolygon(element, positions, selectedRoom, callbackRoomSelected, call { return callbackRoomSelected(element["id"])}}> {element["id"]} - -
  • { console.log("toilettes"); }}> - YAY -
  • -
  • - uéuéué -
  • - - } - /> +
    } else if (element["type"] === "R")