Reputation: 514
I have a html and js file (maps_scripts.js) in which I have defined all the google maps function related to the mentioned html page. These two are working really fine.
I've been assigned to include these files to jruby on rails project developed by someone else.
So far these are the steps I took.
added
<%= javascript_include_tag 'https://maps.googleapis.com/maps/api/js?key=my_key&libraries=places' %> "
to my html.erb page
include
<%= javascript_include_tag 'map_scripts.js', 'data-turbolinks-track' => true %>
to my html.erb page
Question
I'm getting
Uncaught ReferenceError: google is not defined at map_scripts.self-09044ded37604e5a1f367207911e2c79370a307b67a4be3178923d19f555011c.js:4
Note : I have several
google.maps.*
calls in the maps_scripts.js file. For an instance
Upvotes: 0
Views: 533
Reputation: 128
Either you are missing a script or order of the scripts in map_scripts.js is wrong. try changing the order.
Upvotes: 1