I have searched this problem all over the web and none of them seem to give me any resolution. I have a simple script to just display the map of South Africa.
Version 3.30+ is affected of this problem if there is a global var called Map
.
ex:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOURKEYHERE&v=3&callback=init" async defer></script>
<script type="text/javascript">
function init() {
Map.go();
}
var Map = {
go: function() {
console.log("start engine");
}
};
</script>
We got this error:
TypeError: a.prototype is undefined
Renaming window.Map
then everything goes fine.
I've also seen this error often in the last days, there seems to be an issue with the experimental API-version.
Load the release-version instead(basically you should always load the release-version in production)
<script language="javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true&v=3"></script>
Google Maps started to through errors when loading the script and on touch events. I'm using it for a cordova application on Android and iOS.
These are the errors I get but changing the load version didn't solve it.
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=MYKEY&v=3.21&libraries=geometry,places"></script>