Skip to content

Commit 55dfd51

Browse files
committed
border
1 parent 05df8a2 commit 55dfd51

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

web-app/src/app/components/Map2.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ import { Protocol } from 'pmtiles';
88
import { type LatLngExpression } from 'leaflet';
99
import type { FeatureCollection } from 'geojson';
1010
import { MapElement } from './MapElement';
11-
import { Box } from '@mui/material';
11+
import { Box, useTheme } from '@mui/material';
1212

1313
export interface MapProps {
1414
polygon: LatLngExpression[];
1515
}
1616

1717
export const Map2 = (props: React.PropsWithChildren<MapProps>): JSX.Element => {
18+
const theme = useTheme();
1819
const [hoverInfo, setHoverInfo] = useState<string[]>([]);
1920
const [hoverData, setHoverData] = useState<string>('');
2021
const [mapElement, setMapElement] = useState<MapElement[]>([]);
@@ -53,14 +54,14 @@ export const Map2 = (props: React.PropsWithChildren<MapProps>): JSX.Element => {
5354

5455
setMapElement(mapElements);
5556

56-
const elementIds: string[] = []
57+
const elementIds: string[] = [];
5758
features.forEach((feature) => {
5859
if (feature.properties.route_id != undefined) {
5960
elementIds.push(feature.properties.route_id);
6061
} else {
6162
elementIds.push(feature.properties.stop_id);
6263
}
63-
})
64+
});
6465
setHoverInfo(elementIds);
6566
} else {
6667
setHoverInfo([]);
@@ -126,7 +127,16 @@ export const Map2 = (props: React.PropsWithChildren<MapProps>): JSX.Element => {
126127

127128
return (
128129
<MapProvider>
129-
<Box sx={{ width: '100%', height: '100%', position: 'relative' }}>
130+
<Box
131+
sx={{
132+
width: '100%',
133+
height: '100%',
134+
position: 'relative',
135+
border: '2px solid',
136+
borderColor: theme.palette.primary.main,
137+
borderRadius: '5px',
138+
}}
139+
>
130140
<MapElement mapElements={mapElement}></MapElement>
131141
<Map
132142
onClick={handleMouseMove}
@@ -142,7 +152,9 @@ export const Map2 = (props: React.PropsWithChildren<MapProps>): JSX.Element => {
142152
sources: {
143153
'raster-tiles': {
144154
type: 'raster',
145-
tiles: ['https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png'],
155+
tiles: [
156+
'https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png',
157+
],
146158
tileSize: 256,
147159
attribution:
148160
'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',

0 commit comments

Comments
 (0)