To avoid this, we can simply put { :libraries => [:adsense] } in :map_options, for example:
1 | @google_maps_html = gmaps( :map_options => { |
And in our view, put javascript like this in the window load callback:
1 | Gmaps.map.callback = function() { |
The :libraries key seems not appear on the Google-Maps-for-Rails wiki. But after trace the source code, we don’t have to modify the plugin but just use it. Force working with the newest Google Maps API with gmaps4rails is not recommended.
