• Resolved newspatron

    (@newspatron)


    I was trying to add to a google location as a field group in order to add the same to a listing.

    i dont see an option to add a google map key. i already have the key, but i would like to know how to add the same in the SCF plugin.

    there is no field for that.

Viewing 4 replies - 1 through 4 (of 4 total)
  • To add an API key to use the Google Maps field, you need to add this code to your theme’s functions.php file:

    // Sets Goolge Maps API key.
    add_filter( 'acf/fields/google_map/api', function ( $api ) {
    $api[ 'key' ] = 'your-api-key';

    return $api;
    });

    The following services must be included in this key to work properly: Maps JavaScript API, Geocoding API.

    I’m not sure, but I’m guessing it’s not possible to do this with the interface.

    Thread Starter newspatron

    (@newspatron)

    Thanks for your swift reply. i hope i can use the same as i want.

    cjmcqueen

    (@cjmcqueen)

    I have the same question, but I’m hosted on WordPress.com and apparently I can’t edit the functions.php file. Is there another way to register the API for Google Maps with Secure Custom Fields?

    Yan Metelitsa

    (@yanmetelitsa)

    @cjmcqueen, In the admin panel try to go into Appearance > Theme File Editor, select your theme and in the list on the right side select functions.php

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Google location & API key’ is closed to new replies.