API Google

New home Forums Gold Add-on General queries API Google

This topic contains 1 reply, has 2 voices, and was last updated by  SupportTeam 2 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25305

    artotal
    Member

    Hi,
    How I can add the Google Api in the plugin:
    Can I do a hook?

    function add_scripts_map() {
      //wp_enqueue_script('google-maps', 'https://maps.googleapis.com/maps/api/js?callback=initMap', [], null, true);
      wp_enqueue_script('google-maps', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBElMmJbCJRrLY3NqV2-PziNBPxM8Klrcs', ['sage/js'], null, true);
    }
    add_action('wp_enqueue_scripts',  __NAMESPACE__ . '\\add_scripts_map');

    It seems doesn’t work?

    Thanks

    #25320

    SupportTeam
    Moderator

    Hi there,

    Thank you for getting in touch with us.

    Paste the API Key into the Google Maps API Key box at WordPress Dashboard → Maps → Settings → Advanced.
    You can also follow the instruction here: http://www.wpgmaps.com/documentation/creating-a-google-maps-api-key/

    I hope it helps. Thank you for your time in this.

    Best regards,
    Jarek

    • This reply was modified 2 years, 8 months ago by  SupportTeam.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.