I haven't seen much documentation on this so I thought I would talk a little about what I have learned about javascript scope. So say you want to put all your methods into a main class and have sub classes and methods several layers deep. Everything would be so clean and organized but how the heck do you do that in javascript? Unfortunatly javascript does this very different from say ruby or java.

In javascript if you wanted to do something like google.map.Refresh()
first you need to make your main object like this.
google = {}

then make your sub object with a constructor like this.

google.map = function() {
}

then you can add your class methods to your map object like this.

google.map.prototype.Refresh = function() {
//map refresh code
}

if you decided to make google.foo.map.Refresh() all you do is add this in below your main object.

google.foo = {}
google.foo.map = function() {
}
google.foo.map.prototype.Refresh() = function() {
}

It is important to note that you can only add methods to objects with constructors so google.foo can't have a method but google.foo.maps can have the Map method since it was made with a constructor. I hope this helps clarify things while you organize your javascript.

I always knew I would eventually have to bite the bullet and learn javascript since you can't do everything in rails but it seems that times has come. I have been playing with google maps for a bit and I thought I would share my experience with trying to do so without using javascript directly.

I started out using the bhedana/google_maps rails plugin and while documentation was pretty thin it was great for getting a map up quick and easy however as I started going deeper and playing with more advanced functionality I soon found out that this was not going to give me the control I needed to do what I wanted.

Then I found another plugin yawningman/eschaton rails plugin which had quite a bit more documentation and allot more control. So I redid everything using this plugin and with allot of blood sweat and tears I got quite a bit more functionality out of this plugin however now I'm trying to add more advanced features and it looks like I have reached the end of the line for this plugin as well.

One of my main problems while trying to use rails plugins to get google maps in my project without javascript was that there doesn't seem to be a very big user group so I was pretty much on my own to figure things out and the documentation that was available was not great. I think this is because most people who want a very feature rich google maps application just use javascript which makes sense.

So bottom line if you don't know java script and your looking for a quick easy way to put up a very simple google map the bhedana/google_maps rails plugin was nice and easy. If your looking to set up a google map with what I would consider intermediate functionality I would go with the yawningman/eschaton rails plugin. Again there wasn't much of a community to turn to for answers and while there was allot of documentation it not well documented/organized. If you are going to want allot of fancy features and functionality and you don't know javascript you may as well just bite the bullet and get it over with. You will end up saving allot of time and head aches if you do.

Just so there is no misunderstandings I really appreciate all the hard work these guys put into developing these plugins. I had unreolistic expectations for how they should be used so hopefully this will give others else a little incite. Well back to java script.