We just checked in code which improves the readability of GeoKit’s finders. Its quite obvious from the code, so just take a look at these examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# Find the nearest store. stores = Store.find(:nearest, |
We just checked in code which improves the readability of GeoKit’s finders. Its quite obvious from the code, so just take a look at these examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# Find the nearest store. stores = Store.find(:nearest, |
Are there any plans to add support for using Google Maps in the view to display results from using geokit? If not, can you recommend a good plugin that fits well with geokit?
Check out this blog (though it is in German):
http://blog.ebenessen.de/2007/2/17/geokoordinaten-und-google-maps
where he’s using the YM4R plugin. He uses GeoKit and YM4R in a brief, but useful tutorial.
Thanks, while not totally ideal (the plugins store their API keys in 2 different locations), it works ok.
Yeah, well we aren’t affiliated with the YM4R folks and well-behaved plugins usually namespace all their stuff so that they can co-exist peacefully.
If you don’t like the duplication of keys, consider creating your own variable to keep the key and assign it to the various plugins that need it. With this approach, you can preserve your DRY goals.
Otherwise, if that’s the extent of your inconvenience, then you are doing pretty well. The value of each plugin easily outweighs your concerns (IMHO).
@Jeroen: You’re right. I’ve altered the tutorial a bit. Now GeoKit uses the YM4R-Key.
Just add to config/environment.rb:
GeoKit::Geocoders::GOOGLE= Ym4r::GmPlugin::ApiKey::GMAPS_API_KEY
I have been using the plugin wo any problem until today : I needed to use the :range option and I discover that the find :range doesn’t handle the exclusive option at all , I tried several cases :
p_exclusive = Proposition.find_by_range((0…2), .. and got 89
p_exclusive = Proposition.find_by_range(Range.new(0,2,true).. got 89
p_inclusive = Proposition.find_by_range((0..2), .. and got 89
p_inclusive = Proposition.find_by_range(Range.new(0,2,false).. got 89
p_inclusive = Proposition.find_by_range(Range.new(0,2).. got 89
I know my result should be 86, I can exclude the 2.. but the generated SQL is always