@@ -1,9 +1,9 @@
.layout {
box-sizing: border-box;
- width: 1340px;
+ // width: 1340px;
height: 100%;
margin: 0 auto;
- padding: 20px;
+ padding: 20px 50px;
user-select: none;
}
@@ -109,9 +109,10 @@ const Map: React.FC<MapProps> = ({ type, selFloorId, render, mapList, mapSize })
console.log('mscale', mscale);
};
- const fixWidth = 1300;
+ //const fixWidth = 1300;
useEffect(() => {
- var scale = Number((fixWidth / mapSize.width).toFixed(4));
+ var mapWrapWidth = (mapRef.current || {}).clientWidth || 0;
+ var scale = Number((mapWrapWidth / mapSize.width).toFixed(4));
setMscale(scale);
if (scale < 0.3) {