Skip to content

Commit

Permalink
- Fixed Menu Text and Tick/Cross in MapLayerSelector
Browse files Browse the repository at this point in the history
  • Loading branch information
nbarrett committed Jan 19, 2024
1 parent 6b109f0 commit 48749f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/components/MapLayerSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect } from 'react';
import MenuItem from '@mui/material/MenuItem';
import { enumValues } from "../util/enums";
import { MappingProvider } from "../models/route-models";
import { TextField } from "@mui/material";
import { Stack, TextField } from "@mui/material";
import { useRecoilState, useRecoilValue } from "recoil";
import { log } from "../util/logging-config";
import { mapLayerState, mappingProviderState } from "../atoms/os-maps-atoms";
Expand Down Expand Up @@ -38,8 +38,11 @@ export default function MapLayerSelector() {
onChange={handleChange}>
{enumValues(MapLayer).map((value, index) => {
const attribute: MapLayerAttributes = MapLayers[value];
return <MenuItem key={attribute.name} value={attribute.name}>{attribute.style}
<TickCrossIcon isTick={attribute.renders}/>
return <MenuItem key={attribute.name} value={attribute.name}>
<Stack direction={"row"} alignItems={"center"} spacing={1}>
<div>{attribute.displayName}</div>
<TickCrossIcon isTick={attribute.renders}/>
</Stack>
</MenuItem>;
})}
</TextField>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tick.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import CheckIcon from '@mui/icons-material/Check';
import ClearIcon from '@mui/icons-material/Clear';

const TickCrossIcon = ({isTick}) => {
return isTick ? <CheckIcon sx={{ml: 2}} color="success"/> : <ClearIcon sx={{ml: 2}} color="error"/>;
return isTick ? <CheckIcon color="success"/> : <ClearIcon color="error"/>;
};

export default TickCrossIcon;
2 changes: 1 addition & 1 deletion src/models/os-maps-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const MapLayers: { [key in MapLayer]: MapLayerAttributes } = {
tileMatrixSet: "EPSG:27700",
minZoom: 0,
maxZoom: 13,
renders: true
renders: false
},
LIGHT_3857: {
name: MapLayer.LIGHT_3857,
Expand Down

0 comments on commit 48749f5

Please sign in to comment.