File tree Expand file tree Collapse file tree
src/frontend/src/Components/map Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -689,6 +689,29 @@ export default function DriveBCMap(props) {
689689 } ;
690690 } , [ ] ) ;
691691
692+ // Auto-open panel from URL params on initial load
693+ useEffect ( ( ) => {
694+ if ( ! mapRendered ) return ;
695+
696+ const type = searchParams . get ( 'type' ) ;
697+ const id = searchParams . get ( 'id' ) ;
698+
699+ if ( ! type || ! id ) return ;
700+
701+ if ( type === 'advisory' ) {
702+ const advisoryData = filteredAdvisories ?. find ( a => a . id === parseInt ( id ) ) ;
703+ if ( advisoryData ) {
704+ setTimeout ( ( ) => {
705+ const olFeature = new Feature ( ) ;
706+ olFeature . set ( 'type' , 'advisory' ) ;
707+ olFeature . set ( 'id' , advisoryData . id ) ;
708+ olFeature . set ( 'data' , advisoryData ) ;
709+ updateClickedFeature ( olFeature ) ;
710+ } , 500 ) ;
711+ }
712+ }
713+ } , [ mapRendered ] ) ;
714+
692715 /* Map operations on location search */
693716 useEffect ( ( ) => {
694717 if ( searchLocationFrom && searchLocationFrom . length ) {
You can’t perform that action at this time.
0 commit comments