@@ -8,13 +8,14 @@ import { Protocol } from 'pmtiles';
88import { type LatLngExpression } from 'leaflet' ;
99import type { FeatureCollection } from 'geojson' ;
1010import { MapElement } from './MapElement' ;
11- import { Box } from '@mui/material' ;
11+ import { Box , useTheme } from '@mui/material' ;
1212
1313export interface MapProps {
1414 polygon : LatLngExpression [ ] ;
1515}
1616
1717export 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 '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' ,
0 commit comments