Repository navigation
Miscellaneous
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
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.
You can prevent the gmaps4rails.css file from being included by passing false as a second argument.
You can prevent:
-
gmaps4rails.js
-
google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer.js
from being included if you set enable_js to false as a third argument.
<% enable_css = false
enable_js = false %>
<%= gmaps( data_hash, enable_css, enable_js) %>
<%= gmaps4rails( markers_json, enable_css, enable_js) %>
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("custom method:") { User.all.to_gmaps4rails2 }
x.report("builtin json:") { User.all.to_gmaps4rails }
end
user system total real
custom method: 0.780000 0.020000 0.800000 ( 0.817267)
builtin json: 0.460000 0.020000 0.480000 ( 0.502094)
So I kept my own json creation method.