Google maps plugin, which one?

Hi all.

I am going to be integrating google maps into a site I am doing. All it
will be is a simple map with markers (and maybe marker groups). Nothing
more complex than that. I have been googling around for rails plugins
and it appears that there are two that look pretty good.

Cartographer - http://cartographer.rubyforge.org/
and
YM4R - http://thepochisuperstarmegashow.com/projects/#ym4r

From what I can tell it looks like Cartpgrapher is simpler in terms of
setup and functionality (which could be a benefit here) but I was
wondering if anyone had any real-world experience with them both and
could recommend one over the other.

Cheers

RJ

Hi RJ,

I recently switched from Cartographer to YM4R/GM. I considered YM4R/
Mapstraction as well, but decided to go with just /GM since it seems
more lightweight (i.e. less JS) and has more features for specifically
for GM.

Cartographer is not maintained as far as I could tell and it predates
Rails 1.0.

Honestly, I liked the API for Cartographer much better as it seemed to
flow with the usual Rails conventions, whereas YM4R is full of init_
methods and you have to call more of them instead of cleanly passing a
hash parameter to a single method…

I also found the API key handling to be easier on Mapstraction. I had
to write some request_uri.gsub magic to get it to find the right key
in YM4R when I have maps in more than one directory. (Google takes /
maps without the trailing slash and /maps/ to be different directories
so you need two keys…)

Why did I switch? I had a very strange bug with Mapstraction where
the whole Rails stack would seem to get corrupted after clicking to a
map page that created map markers for some of my models. Any
subsequent request would totally lose associations between models:

“association named ‘Address’ not found, perhaps you misspelled it?”

This would affect all other pages in my app, even breaking
associations not related to mapping until I restarted the server. I
actually updated my app from 1.1.6 to 1.2 out of desperation since I
couldn’t tell what was causing this–even integration tests to
simulate my clicking through the app wouldn’t show the problem. So,
eventually I narrowed it down to Cartographer and after banging my
head on the wall for a couple weeks thinking there must be some
fundamental bug in my code, I removed Cartographer.

–Andrew

werdnativ wrote:

Correcting myself…

I also found the API key handling to be easier on Mapstraction.

Why did I switch? I had a very strange bug with Mapstraction

I meant to write Cartographer (…not Mapstraction)

Many thanks werdnativ for detaling your real world experience, I was
learning towards YM4R anyway but having looked into it further I will
use YM4R with geospatial and georuby as I am going to be working with
images taken on GPS enabled cameras and these plugisn combined should
make things easier.

RJ

Correcting myself…

I also found the API key handling to be easier on Mapstraction.

Why did I switch? I had a very strange bug with Mapstraction

I meant to write Cartographer (…not Mapstraction)

On Feb 28, 2007, at 6:53 AM, RJ wrote:

From what I can tell it looks like Cartpgrapher is simpler in terms of
setup and functionality (which could be a benefit here) but I was
wondering if anyone had any real-world experience with them both and
could recommend one over the other.

I’ve used YM4R_Mapstraction and been very pleased with it. While I
primarily work with google maps it’s nice to know I could easily
switch over to another mapping system should I need to.

I wrote up my experience a few months ago at:

http://jystewart.net/process/archives/2006/09/abstracting-mapping-
with-ym4r/

James.


James S.
Play: http://james.anthropiccollective.org
Work: http://jystewart.net/process/

James S. wrote:

On Feb 28, 2007, at 6:53 AM, RJ wrote:

From what I can tell it looks like Cartpgrapher is simpler in terms of
setup and functionality (which could be a benefit here) but I was
wondering if anyone had any real-world experience with them both and
could recommend one over the other.

I’ve used YM4R_Mapstraction and been very pleased with it. While I
primarily work with google maps it’s nice to know I could easily
switch over to another mapping system should I need to.

I wrote up my experience a few months ago at:

http://jystewart.net/process/archives/2006/09/abstracting-mapping-
with-ym4r/

James.

Cheers James. I also recently saw the annoucement of geokit on
blog.rubyonrails, while not directly related to mapping it does have
some interesting distance calculation functions using lat/lng. Have you
guys tried using these with ym4r / spacial adapter / georuby code?

RJ