Open sobolevn opened 7 years ago
@sobolevn Ueberauth it is good idea. But I think about config file where you can choose geocoding service, ip service, units (km or miles), etc. Example:
MyConfig.config do
# geocoding service
config.lookup :yandex
config.ip_service :freegeoip
config.units :km
...
end
Example of searching
# Search by city (Yandex)
Geocoder.search("Moscow")
# Search by ip (Freegeoip)
Geocoder.search("127.0.0.1")
And what do you think?
I think it would be a good idea to start with the geocoders providers API research. What functionality do they provide? How does it differ from one to another? What are the limitations?
I see this basic API as
behaviour
declaration. We could separate the providers the same way as ueberauth did with their providers. So this mechanism would be simple and extendable.What do you think?