Closed Seagullible closed 3 years ago
yea looks like you could do lat and longitude
Hello, this is my first issue but I'd like to work on this. I have it running on local and I'm getting latitude and longitude but I'm not quite sure how to get postal code from that. Where did you get the above screenshot from?
its from the pet finder api
https://www.petfinder.com/developers/v2/docs/
url with zipCode in PetType.js
axios
.get(
`https://api.petfinder.com/v2/animals?type=${type}&location=${zipCode}&limit=12&page=${
page || 1
}`,
config
)
Oh, so the user can either allow location and the pet finder can pass in latitude and longitude to get the pets OR they provide their zip code? I just want to make sure I'm understanding the use case.
yea
If we added geolocation, we could give the user's zip code to the Petfinder API call right away. That way, the animals that show up on the home page would be results from the user's zip code, instead of the default 19019.
It would be best to do some research and find the least intrusive geolocation library for this, as we would just need the zip code. We might be able to do this with the built-in React geolocation, which provides latitutde/longitude. In that case this would be a straightforward change.