tags:

views:

61

answers:

0

Hi, I have installed both geokit gem and geokit-rails plugin. I configured the plugin as shown here: http://github.com/andre/geokit-rails . Then I generated a new model - Location, which looks like this:

class Location < ActiveRecord::Base
acts_as_mappable :default_units => :kms
end

and a controller:
class TestController < ApplicationController
include GeoKit::Geocoders
include GeoKit::Mappable
def test1
@a=Geokit::Geocoders::YahooGeocoder.geocode 'Kaohsiung City, Taiwan' @b=Location.find(:all, :origin => '100 Spear st, San Francisco, CA', :within => 5)
end
end


I also set up a Locations table with both lng and lat columns in my database and put my google key in /config/initializers/geokit_config.rb And right now, altough @a is giving me correct results from YahooGeocoder (I can use GoogleGeocoder as well), @b is an empty array. I know @a is generated using Geokit gem and @b using Geokit-rails plugin, so the problem is definitely related to the plugin. When I use @c=IpGeocoder.geocode('85.128.202.178') I get "success: false" ... What am I doing wrong here?