0

I'm getting this error in webdev console when I run my html page code

nc {message: "initialize is not a function", name: "InvalidValueError", stack: 
"Error↵    at new nc (https://maps.googleapis.com/m…
##################&callback=initialize:137:68"}

I've based my code off the googlemaps api sample and only altered styling having not changed the function.

The function was called initMap though I have recently changed this to see if it made any difference.

My javascript url is https://comfortestateplanning.co.uk/js/home.js initialize function and my testing site url is https://comfortestateplanning.co.uk/

Showcase Imagery
  • 372
  • 2
  • 19

1 Answers1

0

I have worked out where the error was and how to answer my own question :)

I've determined that the javascript file with the Google Maps function in it should not be async. This would cause the function to load concurrently with the Google Maps API call and not after it.

So in my case

<script async type="text/javascript" src="js/home.js"></script>

became (without async)

<script type="text/javascript" src="js/home.js"></script>
Showcase Imagery
  • 372
  • 2
  • 19