@@ -8,13 +8,14 @@ import { Protocol } from 'pmtiles';
8
8
import { type LatLngExpression } from 'leaflet' ;
9
9
import type { FeatureCollection } from 'geojson' ;
10
10
import { MapElement } from './MapElement' ;
11
- import { Box } from '@mui/material' ;
11
+ import { Box , useTheme } from '@mui/material' ;
12
12
13
13
export interface MapProps {
14
14
polygon : LatLngExpression [ ] ;
15
15
}
16
16
17
17
export const Map2 = ( props : React . PropsWithChildren < MapProps > ) : JSX . Element => {
18
+ const theme = useTheme ( ) ;
18
19
const [ hoverInfo , setHoverInfo ] = useState < string [ ] > ( [ ] ) ;
19
20
const [ hoverData , setHoverData ] = useState < string > ( '' ) ;
20
21
const [ mapElement , setMapElement ] = useState < MapElement [ ] > ( [ ] ) ;
@@ -53,14 +54,14 @@ export const Map2 = (props: React.PropsWithChildren<MapProps>): JSX.Element => {
53
54
54
55
setMapElement ( mapElements ) ;
55
56
56
- const elementIds : string [ ] = [ ]
57
+ const elementIds : string [ ] = [ ] ;
57
58
features . forEach ( ( feature ) => {
58
59
if ( feature . properties . route_id != undefined ) {
59
60
elementIds . push ( feature . properties . route_id ) ;
60
61
} else {
61
62
elementIds . push ( feature . properties . stop_id ) ;
62
63
}
63
- } )
64
+ } ) ;
64
65
setHoverInfo ( elementIds ) ;
65
66
} else {
66
67
setHoverInfo ( [ ] ) ;
@@ -126,7 +127,16 @@ export const Map2 = (props: React.PropsWithChildren<MapProps>): JSX.Element => {
126
127
127
128
return (
128
129
< 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
+ >
130
140
< MapElement mapElements = { mapElement } > </ MapElement >
131
141
< Map
132
142
onClick = { handleMouseMove }
@@ -142,7 +152,9 @@ export const Map2 = (props: React.PropsWithChildren<MapProps>): JSX.Element => {
142
152
sources : {
143
153
'raster-tiles' : {
144
154
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
+ ] ,
146
158
tileSize : 256 ,
147
159
attribution :
148
160
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' ,
0 commit comments