3

Is it possible to get country code by GPS location coordinates?

Currently, in my app I have implemented country rectangles but it is not accurate enough as every country has its own "shape" and rectangles are overflowing each other

I was wondering if you don't know about any react-native API where I'm able to post GPS coordinates and it will return info including country code.

I also need to be able to get the country code in offline mode.

Thanks!

sbqq
  • 1,083
  • 1
  • 14
  • 25
  • You can use the third party library for this. https://github.com/devfd/react-native-geocoder. But it will not work in offline mode. – Jebin Benny Apr 02 '19 at 09:11
  • @JebinBenny so if I need to make it work even in offline mode there is no better option for me than shape-based algorithm? – sbqq Apr 02 '19 at 09:16
  • Then you have to follow your idea. – Jebin Benny Apr 02 '19 at 09:20
  • Possible duplicate of this https://stackoverflow.com/a/3633619/4022607 – Ahmad Ayyaz Apr 02 '19 at 09:38
  • @AhmadAyyaz is this a duplicate even when I'm asking for react-native solution? :) – sbqq Apr 02 '19 at 10:01
  • you were asking about some API and it is mentioning Yahoo API. Also here is one more https://stackoverflow.com/a/11828498/4022607 with Google's geocoding services. I think you can use js with react native – Ahmad Ayyaz Apr 02 '19 at 10:09
  • @AhmadAyyaz I need to make offline-first so I will not be able to fire request when there is no internet connection but thanks anyway! :) – sbqq Apr 02 '19 at 10:14

0 Answers0