TypeError: window.initMap is not a function

I am following this tutorial, basically copy all the code


but got an error saying that the initMap function is not a function.
I am using angularjs in my project, could that be causing problems?

I copied the same code into plunker and it works just fine…
What are the possible issues?


turns out it has to do with ng-Route and the order of loading script
wrote a directive and put the API script on top of everything works.

Leave a Reply

Your email address will not be published. Required fields are marked *