Home Forums Backend Issues (wp-admin) Google Map TypeError


Google Map TypeError

  • I’m trying to use the Google Map field, but when I go to the post type to use the field WordPress has an error in the console: TypeError: ‘undefined’ is not an object (evaluating ‘new google.maps.places.Autocomplete’) and I’m not able to search for an address.

    I’ve looked around online and people are saying you need to include to fix this issue but I’m not sure how to do that.

    Does anyone have any suggestions or input?
    Thanks so much!


  • Hi @controlyours

    ACF includes this script already, although it does it through jQuery $.getScript instead of a script tag.

    In your browser, you can inspect all scripts loaded into the page via the firebug/inspector panel.

    If you open that up and clic ont he scripts or network tabs, you can see all the files being loaded.

    Firstly check for any other JS errors in the console log, but then check the script is being loaded. Perhaps there is a firewall that is preventing the google API from loading?


  • The only error in the console is the one I mentioned and the source of the error is input.min.js on line 1176

    Is there a particular js file I should check to be sure it loaded in the list? I’m not sure why this would be happening. :/

    Any suggestions?


  • Hi @controlyours

    I would look in the ‘network’ tab for any script which is not working. Are there any scripts that appear with an error? Perhaps one of them is the google API?

    It is possible that your website is already including the google API, but not including the places module.

    Can you check your source code for any google maps script?


  • My theme was already pulling in the Google Maps script, so I removed that and it’s working now! Sorry to be such a pain!


  • Hi @elliot,

    Thanks for your excellent work.

    I have also found the same issue that @controlyours had, but the script was being loaded just fine. The problem I found is that it wasn’t getting the places library.

    I changed the js call in wp-content/plugins/acf-location-field/location-v4.php in Ln 94 from

    echo '<script src="" type="text/javascript"></script>';


    echo '<script src="//" type="text/javascript"></script>';

    How do you feel about this approach? I am not happy to change the plugin files, since an update could remove those.

    Many thanks,

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Google Map TypeError’ is closed to new replies.