我正在试着从一个有GeoKit的地址获取suggested_bounds。这个解决方案起作用了,但是突然它开始失败了:
Geokit::Geocoders::GoogleGeocoder.geocode(location).suggested_bounds这将返回nil。在不使用suggested_bounds的情况下尝试时,它会返回以下内容:
Street:
City:
State:
Zip:
Latitude:
Longitude:
Country:
Success: false这已经工作了几个月了,我试着更新Google API密钥,但没有成功。
如果有帮助,我可以将MultiGeocoder与IP地址一起使用,而不是实际地址,如下所示:
Geokit::Geocoders::MultiGeocoder.geocode(ip_address)提前谢谢你。
发布于 2013-11-03 12:09:55
Geokit之前使用的是Google Maps API v2。这个API已经过时了。要使Geokit在rails中使用新版本,请更新您的geokit_config.rb文件:
Geokit::Geocoders::provider_order = [:google3, :us]
Geokit::Geocoders::Google3Geocoder = Geokit::Geocoders::GoogleGeocoder3https://stackoverflow.com/questions/19337635
复制相似问题