Script callback and sensor errors
-
Google Maps seems to have updated their API again. I was getting a JS error “initMap is not a function” as well as a warning “Sensor not required.”
I found the problem in line 169:
wp_enqueue_script( 'google-maps-api', 'https://maps.google.com/maps/api/js?sensor=false&key=AIzaSyA4AcYDV9EH4AmoolzFu1Mg-55Ft1mRSVY&callback=initMap' );
The “sensor” and “callback” parameters need to be removed from the query string, so line becomes:
wp_enqueue_script( 'google-maps-api', 'https://maps.google.com/maps/api/js?key=AIzaSyA4AcYDV9EH4AmoolzFu1Mg-55Ft1mRSVY' );
I made this change to my site and it resolved the error and warning, which were preventing a Gravity Forms registration form from appearing. I did not see this add-on plugin in GitHub or I would send a pull request. ??
- The topic ‘Script callback and sensor errors’ is closed to new replies.