lib/gmaps4rails/helper/gmaps4rails_helper.rb
# In order to use turbolinks, one has to include the maps api on the first page to load,
# because the api cannot be loaded dynamically by turbolinks due to the javascript 
# same-origin policy. 
#
# Therefore, in order to be able to use gmaps4rails with turbolinks, one has to include
# the api script tags in the layout file.
#
# For example:
# 
#    <!-- app/layouts/default.html.erb -->
#    <html><head>
#      <%= gmaps4rails_api_script_tags %>
#      ...
#    </head><body> 
#      ...
#    </body></html>
#
In order to use turbolinks, one has to include the maps api on the first page to load,
because the api cannot be loaded dynamically by turbolinks due to the javascript
same-origin policy.

Therefore, in order to be able to use gmaps4rails with turbolinks, one has to include
the api script tags in the layout file.

For example.


In order to use turbolinks one has to include the maps api on the first page to load because the api cannot be loaded dynamically by turbolinks due to the javascript same - origin policy . Therefore in order to be able to use gmaps4rails with turbolinks one has to include the api script tags in the layout file . For example .
def gmaps4rails_api_script_tags(options = {})
    if include_gmaps4rails_api_in_header?
      options.merge!({ :scripts => :api })   
      api_urls = Gmaps4rails::ViewHelper.new(options).js_dependencies_array
      javascript_include_tag *api_urls
    end
  end
def gmaps4rails_api_script_tags ( options = { } ) if include_gmaps4rails_api_in_header? options . merge! ( { :scripts => :api } ) api_urls = Gmaps4rails :: ViewHelper . new ( options ) . js_dependencies_array javascript_include_tag * api_urls end end
In order to use turbolinks, one has to include the maps api on the first page to load,
because the api cannot be loaded dynamically by turbolinks due to the javascript
same-origin policy.
In order to use turbolinks one has to include the maps api on the first page to load because the api cannot be loaded dynamically by turbolinks due to the javascript same - origin policy .
# request only api scripts, here.
options
<not_specific>