City location
How you guys would implement a geolocation property from a user profile? The user has to pick a town where he or she is from. Super cool would be to have some city name validation as well. Super cool as well would be if I could combine it with the convenience of Prisma.
7 Replies
You would need at least these properties
Then you could use something like the Google Places or Autocomplete API to get the location from the user's input and save it to your db
Example response:
@JulieCezar thanks a lot. That looks super promising 🙂
Np np, just be careful the pricing for it can be expensive 😂
MUI has some autocomplete for locations, if you wanna use that.
https://mui.com/material-ui/react-autocomplete/#google-maps-place
React Autocomplete component - Material UI
The autocomplete is a normal text input enhanced by a panel of suggested options.
And also, although I didn't test it myself I've found this free option https://wiki.openstreetmap.org/wiki/API_v0.6