The API can’t be loaded after the document has finished loading by default, you’ll need to load it asynchronous.
modify the page with the map:
For more details take a look at: https://stackoverflow.com/questions/14184956/async-google-maps-api-v3-undefined-is-not-a-function/14185834#14185834
Example: http://jsfiddle.net/doktormolle/zJ5em/
I know this answer is not directly related to this questions’ issue but in some cases the “Uncaught ReferenceError: google is not defined” issue will occur if your js file is being called prior to the google maps api you’re using…so DON’T DO this: