| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Bump to this, good idea 👍 |
Sorry, something went wrong.
|
@avdept Did this solve the geocoder failing for you? I am going to checkout this branch later and try it out. export function geoCodeLocation(location) {
return new Promise((resolve) => {
const { latitude, longitude } = location
if (location) {
Geocoder.fallbackToGoogle(process.env.GOOGLE_GEOCODE_API)
Geocoder.geocodePosition({ lat: latitude, lng: longitude })
.then((userLocation) => {
if (userLocation[0].locality) {
alert(userLocation[0].locality)
resolve(userLocation[0].locality)
}
})
.catch((e) => {
alert(e)
Alert.alert(
'Cannot find city name',
'We were unable to geocode your position. Tide and weather conditions will be accurate.',
[{ text: 'OK' }],
)
})
} else {
alert('NO LOCATION YET!!!!!!')
}
})
}
Been trying to catch a few cases (if they in fact exist), but everything seems correct. Was thinking it was sending it twice, but it's not. |
Sorry, something went wrong.
|
Nice! How's it going with this PR? |
Sorry, something went wrong.
|
I would add fallback to standard geocoder if google fails. Does it make sense? |
Sorry, something went wrong.
|
@ryancoughlin I didnt face error like yours. Did you manage to handle it? @alvelig I think it makes sense if google geocoder was default. In this case you forcing to use only google geocoder, so you should take care about handling errors. But In general its pretty easy to refactor. If anybody else will need it, I will add handler for google geocode failure. |
Sorry, something went wrong.
|
Not yet, it happens every now and then. I can't seem to find a pattern for it. I have the fallback in there as well. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Force geocoder to use google geocoding service. Why need this ? My ios and android app geocoding returns slightly different results. For ex. - 1 Orange St on IOS and 1 Orange street on android, which is caused by different geocoders. Thus, if you need consistency - forcing to use google geocoder.