File tree 2 files changed +12
-6
lines changed 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 16
16
17
17
/* Side panel styling */
18
18
.side-panel {
19
- width : 30 % ;
19
+ width : 400 px ;
20
20
height : 100% ;
21
21
background-color : var (--darker );
22
22
color : var (--text-color );
138
138
/* Map controls styling */
139
139
.controls {
140
140
position : absolute;
141
- top : 20px ;
141
+ bottom : 20px ;
142
142
left : 20px ;
143
143
z-index : 1000 ;
144
+ background-color : var (--darkest );
144
145
}
145
146
146
147
.controls input [type = "text" ] {
147
148
padding : 10px ;
148
149
font-size : 14px ;
149
150
border-radius : 5px ;
150
- border : 1px solid var (--border-color );
151
- background-color : var (--input-background );
151
+ border : 1px solid var (--darker );
152
+ background-color : var (--dark );
152
153
color : var (--text-color );
153
154
}
154
155
Original file line number Diff line number Diff line change 1
- import React , { useState } from "react" ;
1
+ import React , { useState , useEffect } from "react" ;
2
2
import { MapContainer , TileLayer , Marker , Tooltip } from "react-leaflet" ;
3
3
import MarkerClusterGroup from "react-leaflet-markercluster" ;
4
4
import "leaflet/dist/leaflet.css" ;
@@ -155,6 +155,11 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
155
155
const [ searchTerm , setSearchTerm ] = useState ( "" ) ;
156
156
const [ selectedData , setSelectedData ] = useState ( null ) ;
157
157
158
+ // Set initial position once when parentRef becomes available
159
+ useEffect ( ( ) => {
160
+ setSelectedData ( null ) ;
161
+ } , [ selectedKPI ] ) ;
162
+
158
163
const interpolateColor = ( score ) => {
159
164
const startColor = [ 247 , 118 , 142 ] ;
160
165
const endColor = [ 115 , 218 , 202 ] ;
@@ -221,7 +226,7 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
221
226
center = { [ 52.378 , 4.9 ] }
222
227
maxZoom = { 10 }
223
228
minZoom = { 2 }
224
- style = { { height : "100%" , width : selectedData ? "70%" : " 100%" } } // Adjust width based on side panel
229
+ style = { { height : "100%" , width : " 100%" } }
225
230
>
226
231
{ /* Dark Theme Tiles */ }
227
232
< TileLayer
You can’t perform that action at this time.
0 commit comments