Google Maps distance matrix in a modal

11 views
Skip to first unread message

Gary Terry

unread,
Mar 1, 2014, 1:02:28 AM3/1/14
to bootstr...@googlegroups.com
I setup a test page to get distances automatically from input on a form field. I use a database call to get the destination, and input the source location. Then with an onBlur event fire the calculateDistances() function.

It works perfectly.

However, as soon as I load the exact same page via the data-remote into a modal, the whole thing fails. These are the errors I'm getting.

  1. Uncaught ReferenceError: google is not defined VM1143:43
  1. Uncaught TypeError: Cannot read property 'defaults' of undefined
  1. Uncaught TypeError: undefined is not a function


I have tried putting the script inside the modal itself, in the document calling the modal, in the remote file that's loaded into the modal and all of them result in the same errors.

Has anyone tried something like this? Any ideas why this is failing?











Reply all
Reply to author
Forward
0 new messages