Skip to content

feat: navigation on the map#104

Draft
kingazm wants to merge 2 commits intomainfrom
map-navigation
Draft

feat: navigation on the map#104
kingazm wants to merge 2 commits intomainfrom
map-navigation

Conversation

@kingazm
Copy link
Copy Markdown
Collaborator

@kingazm kingazm commented Apr 10, 2026

📄 Pull Request Description

Be sure to add in your .env.development

VITE_GOOGLE_MAPS_API_KEY=<key>

Without the key, changes from this PR will not work.

🧩 What was changed?

This PR adds user-location marking and in-map navigation routing to the map feature.

Main changes:

  • Added user geolocation handling on the map page (available / outside-campus / unavailable states).
  • Added a “show where I am” action in the map header.
  • Added route rendering from user location to selected facility using Google Maps directions.
  • Added a navigate action in the facility modal (disabled when routing is not possible (no location or user outside campus bounds).

💡 Why was it changed?

The changes address a nice-to-have feature from our MLP.

The previous map allowed users to view facilities but not easily answer:

  • “Where am I?”
  • “How do I get there from my current position?”

This change improves UX by:

  • giving clear location, with state feedback,
  • enabling direct route preview to a selected destination,

It was needed now to make the map actionable (not only browseable) and align with core way-finding expectations.


⚙️ How was it implemented?

  • Added browser geolocation tracking in map logic to maintain current user position.
  • Integrated Google Maps DirectionsService + DirectionsRenderer to calculate and draw walking routes.
  • Added back navigate button, now with actual functionality.

⚠️ Side Effects or Risks

  • Feature depends on Google Maps key + enabled APIs + billing; without that, routing fails.
  • Geolocation permission denial or browser restrictions reduce functionality (but this is handled in the PR).
  • Campus-bound logic depends on current bounds strategy and may require tuning for edge locations in the future.

✅ Checklist

  • All 4 sections above are clearly filled out
  • Tests and documentation updated (N/A, tested manually)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant