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

Location on initial map load #220

Open
davenquinn opened this issue Jun 11, 2024 · 2 comments
Open

Location on initial map load #220

davenquinn opened this issue Jun 11, 2024 · 2 comments

Comments

@davenquinn
Copy link
Member

On the initial load of the Macrostrat website, we set the location to a zoomed out "null island" view of the entire world. It might be nice to improve this, maybe in the following ways:

  • Figure out the user's rough location based on their IP address and zoom to their nation or state
  • Retain a locally stored "last visited" position for an individual user

When I load Google Maps, it starts ~near where I am located, which I think is broadly ideal.

Once the user has moved the map, we do maintain the ability to link to a specific location.

@davenquinn
Copy link
Member Author

davenquinn commented Jun 13, 2024

I think the canonical solution would be to use something like geoip-lite to find the nearest location. Having this running on the web server would have a bit of overhead but would allow us to quickly move to users' locations. There might be other, lower-footprint libraries that support lower precision linking.

@CannonLock
Copy link
Collaborator

https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API

Could also request location directly.

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

No branches or pull requests

2 participants