App Behavior & Event Logic
User Stories
- As a user, I want to search for a campus by name, service, day, or time so I can quickly find relevant locations.
- As a user, I want to click a campus on the map or navigation list and see detailed info about it (services, times, address, phone).
- As a user, I want the map to pan and zoom to the selected location automatically for easy orientation.
- As a user on mobile, I want the layout to adapt so navigation and map are usable on small screens.
- As a user, I want to reset the map view and clear filters easily using a dedicated "Center Map" button.
- As a user, I want to close the info window and clear active states without refreshing the page.
- As a user, I want clicking outside any marker (on map background) to reset the map and clear selections.
Map Initialization:
- Map centered at
{ lat: 30.25, lng: -95.60 }
(desktop) or{ lat: 30.26, lng: -95.565 }
(mobile). - Custom marker icons per location.
Core Functions:
createInfoWindowContent(location)
: Renders HTML string for info window.handleLocationClick()
: Pans map, opens info window, highlights nav button.filterAndRenderList()
: Filters locations via search and redraws buttons/markers.fullReset()
: Clears search, shows all markers, resets map view.renderNavButtons()
: Creates nav button elements for each location.
Map Event Listeners:
- Clicking map background: resets view.
- Marker click: opens corresponding info window.
- Info window close: clears active state.
- Center Map button: triggers
fullReset()