Skip to content

Navigation Menu

Sign up
apneadiving edited this page Aug 27, 2011 · 19 revisions

When you have questions, please ask them on http://stackoverflow.com so that everybody gets the info.

All questions here: http://stackoverflow.com/questions/tagged/gmaps4rails

Known Problem

Please note there is an issue with jquery 1.4.4/1.5.1 + rails ujs driver + google maps API v3: clicking on markers, or using other 'live' event triggers on the page will result in a critical error on IE < 9.

There is a workaround available. For more information, please see this discussion http://stackoverflow.com/questions/5221787.

Json creation

You could see in the code that I'm almost recreating the wheel, rewriting some kind of to_json method.

Indeed, I did a benchmark with 1000 objects:

Benchmark.bm do |x|
 x.report("builtin json:") { User.all.to_gmaps4rails2 }
 x.report("custom_method:") { User.all.to_gmaps4rails }
end
 user system total real
builtin json: 0.780000 0.020000 0.800000 ( 0.817267)
custom method: 0.460000 0.020000 0.480000 ( 0.502094)

So I kept my own json creation method.

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /