# Google maps plugin, which one?

**URL:** <https://www.ruby-forum.com/t/google-maps-plugin-which-one/87129>\
**Category:** Rails\
**Created:** [February 28, 2007, 12:53pm UTC](https://www.ruby-forum.com/t/google-maps-plugin-which-one/87129 "2007-02-28T12:53:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RJRJRJ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@RJRJRJ](https://www.ruby-forum.com/u/RJRJRJ)\
**Post date:** [February 28, 2007, 12:53pm UTC](https://www.ruby-forum.com/t/google-maps-plugin-which-one/87129/1 "2007-02-28T12:53:33Z")

</div>

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/](http://cartographer.rubyforge.org/)  
and  
YM4R - [thepochisuperstarmegashow.com](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

---

<div class="post-metadata">

**Author:** ![RJRJRJ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@RJRJRJ](https://www.ruby-forum.com/u/RJRJRJ)\
**Post date:** [February 28, 2007, 3:47pm UTC](https://www.ruby-forum.com/t/google-maps-plugin-which-one/87129/2 "2007-02-28T15:47:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RJRJRJ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@RJRJRJ](https://www.ruby-forum.com/u/RJRJRJ)\
**Post date:** [March 1, 2007, 11:28am UTC](https://www.ruby-forum.com/t/google-maps-plugin-which-one/87129/3 "2007-03-01T11:28:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RJRJRJ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@RJRJRJ](https://www.ruby-forum.com/u/RJRJRJ)\
**Post date:** [March 1, 2007, 7:28am UTC](https://www.ruby-forum.com/t/google-maps-plugin-which-one/87129/4 "2007-03-01T07:28:21Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![RJRJRJ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@RJRJRJ](https://www.ruby-forum.com/u/RJRJRJ)\
**Post date:** [March 2, 2007, 6:08pm UTC](https://www.ruby-forum.com/t/google-maps-plugin-which-one/87129/5 "2007-03-02T18:08:52Z")

</div>

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:

> **[Abstracting mapping with YM4R](https://jystewart.net/2006/09/01/abstracting-mapping-with-ym4r/)**
>
> When Grand Rapids WiFi–then a PHP application–first implemented google map support all the logic for producing those maps came in the templates. The controller passed the view a list of…

with-ym4r/

James.

–  
James S.  
Play: [http://james.anthropiccollective.org](http://james.anthropiccollective.org)  
Work: [Processing Greenbelt 2009 – James Stewart](http://jystewart.net/process/)

---

<div class="post-metadata">

**Author:** ![RJRJRJ](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8491ac/32.png) [@RJRJRJ](https://www.ruby-forum.com/u/RJRJRJ)\
**Post date:** [March 2, 2007, 6:34pm UTC](https://www.ruby-forum.com/t/google-maps-plugin-which-one/87129/6 "2007-03-02T18:34:13Z")

</div>

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:
> 
> [Abstracting mapping with YM4R – James Stewart](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
