FlyCodeRepeat
FlyCodeRepeat

Reputation: 396

Google maps JS API stopped working for me today

I have a cordova/phonegap mobile app that has been using Google Maps for a few years. The code regarding the mapping features has not changed in a while, but today, the map stopped showing in the app. When I debug, I get an error about: TypeError: h is not a function. (In 'h({map:a,Fi:void 0,cl:H,Kc:r.Kc})', 'h' is undefined) during map initialization. It's the same error on Android and iOS.

Other web apps I have that use Google Maps are still working fine. Has anyone else had an issue today? Has google released an update that could be causing this?

Upvotes: 2

Views: 837

Answers (1)

FlyCodeRepeat
FlyCodeRepeat

Reputation: 396

So it seems to be an issue with the newest experimental version of the JS that's boot-loaded. When I specified v=3, it forced the release version instead of the experimental version and things started working again.

So I changed :

<script type="text/javascript" 
        src="https://maps.googleapis.com/maps/api/js?key=API_KEY&callback=initMap" 
        async 
        defer></script>

to

<script type="text/javascript"
        src="https://maps.googleapis.com/maps/api/js?key=API_KEY&v=3&callback=initMap" 
        async 
        defer></script>

(added v=3 to force release version).

Upvotes: 2

Related Questions