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 IP Geolocation for first time users #54

Merged
merged 2 commits into from
Jul 19, 2024

Conversation

quacksire
Copy link
Member

This PR adds IP Geolocation, so that first time users will always "spawn" in their own region, without having to pan away from LA/Irvine area.

This uses Cloudflare's IP Geolocation API to get the user's ROUGH location via a worker.
It will not be accurate, but it will be enough to get the user to their own region.

Adding a pin with this provided lat/long would prob freak a few people out and even mapping sites (google, bing, etc) don't do it either on default.

This feature will not function if there is already a cached geolocation, and if there is not, it will create one and store it BEFORE the user allows the browser side geolocation provider to do so.

One thing that I would like someone to do, as I'm not familiar too much with the codebase, is figure out how to not have the browser location prompt happen during onMount. It should only be called/requested when the user presses the "find me"/locate button.

@kylerchin kylerchin merged commit 14417da into catenarytransit:main Jul 19, 2024
1 check passed
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.

2 participants