Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does gmaps4rails conflict with geocoder gem?

I am using gmaps4rails to easily generate a google map on my app. gmaps4rails requires a lat and long attributes in the model. however, gmaps4rails isn't very friendly with ambiguous addresses. For example, it doesn't know what address to show when I list an apartment number.

So, I just installed geocoder. I am using geocoder to take my :location attribute and set the lat/long of that in my model. It seems to be working right now but since both gems use the lat/long attributes, I am thinking this will cause a conflict later on. Will it?

like image 208
Matthew Berman Avatar asked Nov 01 '11 03:11

Matthew Berman


1 Answers

Both gems shouldn't interfere but be sure to tell gmaps4rails not to try to geocode the saved objects:

acts_as_gmappable :process_geocoding => false

Otherwise, concerning the ambiguous address, you can get raw results from gmaps4rails doing:

Gmaps4rails.geocode(address)

Anyway, feel free to use the geocoding library you prefer: gmaps4rails is after all not really made for geocoding but to display maps! (and Geocoder is great for it's job)

like image 167
apneadiving Avatar answered Sep 28 '22 08:09

apneadiving