Actually the error is being generated by the initMap in the Google's api script
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
</script>
so basically when the Google Map API is loaded then the initMap function is executed.
If you don't have an initMap function, then the initMap is not a function error is generated.
So basically what you have to do is one of the following options:
- to create an initMap function
- replace the callback function with one of your own that created for the same purpose but named it something else
- replace the
&callback=angular.noop
if you just want an empty function() (only if you use angular)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…