Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interactive map for building locations #532

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

Winkel515
Copy link

@Winkel515 Winkel515 commented Apr 24, 2024

Here's a draft of how I envisioned the building location to look like. Only the UI has been implemented. Next step would be to implement the logic for determining the buildings for a given course.

image

@Winkel515
Copy link
Author

Accidentally leaked my Google API key lol. I deleted it and made a new one. Using client .env for the key as VITE_GOOGLE_API_KEY

@39bytes
Copy link
Collaborator

39bytes commented Apr 25, 2024

Accidentally leaked my Google API key lol. I deleted it and made a new one. Using client .env for the key as VITE_GOOGLE_API_KEY

is it safe to leak google api key on the client? any client environment variables are automatically public

@Winkel515
Copy link
Author

Accidentally leaked my Google API key lol. I deleted it and made a new one. Using client .env for the key as VITE_GOOGLE_API_KEY

is it safe to leak google api key on the client? any client environment variables are automatically public

You have a point. How do we get around this?

@39bytes
Copy link
Collaborator

39bytes commented Apr 25, 2024

Accidentally leaked my Google API key lol. I deleted it and made a new one. Using client .env for the key as VITE_GOOGLE_API_KEY

is it safe to leak google api key on the client? any client environment variables are automatically public

You have a point. How do we get around this?

Apparently it's fine to expose it to the client, as long as you setup restrictions on the allowed referers for requests (https://developers.google.com/maps/documentation/javascript/get-api-key)

Regarding the UX of this feature, I think it would be better if you could just click on the building in the schedule and have it the map pop up in a dialog/modal, since the schedule can have sections in completely different buildings.

@terror terror changed the title Building Location Component Add interactive map for building locations Apr 27, 2024
@terror
Copy link
Owner

terror commented Apr 28, 2024

Hey Winkel, I think we want to go toward making this a modal popup when a location is clicked on the schedule. I made a patch with some rough changes this should follow

0001-Make-it-a-popup.patch

@Winkel515
Copy link
Author

Hey Winkel, I think we want to go toward making this a modal popup when a location is clicked on the schedule. I made a patch with some rough changes this should follow

0001-Make-it-a-popup.patch

I applied your patch file, just changed the defaultCenter to be set to the coordinate of the selected building instead of the placeholder it was. Is there anything else to be done for this issue?

@terror terror marked this pull request as ready for review April 29, 2024 13:02
@SamZhang02
Copy link
Collaborator

SamZhang02 commented May 4, 2024

Can you add a close button on the popup dialog? (just like an X) I just noticed that on mobile you have to touch the corner of your phone to reach outside of the dialog to close it and its a bit of a pain

@@ -72,6 +72,9 @@ export const sortSchedulesByBlocks = (schedules: Schedule[]) => {

export const getUrl = (): string => import.meta.env.VITE_API_URL ?? '';

export const getGoogleAPIKey = (): string =>
import.meta.env.VITE_GOOGLE_API_KEY ?? '';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add this in the .env.example as well?

@SamZhang02
Copy link
Collaborator

SamZhang02 commented May 4, 2024

otherwise the code looks fine to me @39bytes @terror idk if you guys have anything to add; we just need to get a key for prod

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.

None yet

4 participants