Added full screen button

This commit is contained in:
Mitchell McCaffrey
2020-09-06 15:18:05 +10:00
parent 24a3387b51
commit 58cb92d432
7 changed files with 138 additions and 56 deletions

View File

@@ -16,6 +16,10 @@ import BrushToolIcon from "../../icons/BrushToolIcon";
import MeasureToolIcon from "../../icons/MeasureToolIcon";
import ExpandMoreIcon from "../../icons/ExpandMoreIcon";
import PointerToolIcon from "../../icons/PointerToolIcon";
import FullScreenIcon from "../../icons/FullScreenIcon";
import FullScreenExitIcon from "../../icons/FullScreenExitIcon";
import useSetting from "../../helpers/useSetting";
function MapContols({
onMapChange,
@@ -31,6 +35,7 @@ function MapContols({
disabledSettings,
}) {
const [isExpanded, setIsExpanded] = useState(true);
const [fullScreen, setFullScreen] = useSetting("map.fullScreen");
const toolsById = {
pan: {
@@ -190,6 +195,24 @@ function MapContols({
{controls}
</Flex>
{getToolSettings()}
<Box
sx={{
position: "absolute",
right: 0,
bottom: 0,
backgroundColor: "overlay",
borderRadius: "50%",
}}
m={2}
>
<IconButton
onClick={() => setFullScreen(!fullScreen)}
aria-label={fullScreen ? "Exit Full Screen" : "Enter Full Screen"}
title={fullScreen ? "Exit Full Screen" : "Enter Full Screen"}
>
{fullScreen ? <FullScreenExitIcon /> : <FullScreenIcon />}
</IconButton>
</Box>
</>
);
}