Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1127784
    aceven24
    Participant

    Hello,

    I have a page that is using the Google Maps Element, it adds this script line to my page

    <script type=’text/javascript’ src=’https://maps.googleapis.com/maps/api/js?key=MYAPI;ver=4.5.3′></script&gt;

    I have some custom stuff that I want to do that requires google maps to load this and google maps doesn’t like loading scripts twice, where do I override the behavior of the above script and replace it with something like this:

    <script type=”text/javascript” src=”https://maps.googleapis.com/maps/api/js?key=MYAPI&libraries=places”></script&gt;

    #1128253
    Nico
    Moderator

    Hi There,

    Thanks for writing in! Regretfully, this particular customization request is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself. If you have any further questions about the theme, we are more than happy to provide you with assistance on these inquiries.

    Thank you for your understanding.

    #1128608
    aceven24
    Participant

    I am a developer, but just not a WordPress developer, I figured it out see. May I make a recommendation for the google map element.

    Add the ability to add libraries as a parameter, similar to the way you allow API to be set, this will allow additional libraries to be downloaded.

    In addition use the proper url for getting map apis per google docs. https://maps.googleapis.com/maps/api/js

    I added this to functions in my child field, I’m not a PHP or WordPress guy, but this was the only way to get it to work, obviously I took out the API KEY.

    I deregistered and dequeued your entry in the googlemap element and added it back with the libraries option.

    function my_google()
    {
    wp_deregister_script(‘cs-google-maps’);
    wp_dequeue_script(‘cs-google-maps’);
    wp_register_script(‘cs-google-maps’,’https://maps.googleapis.com/maps/api/js?key=MYAPI&libraries=places&#8217;);
    wp_enqueue_script(‘cs-google-maps’);

    }

    add_action(‘wp_enqueue_scripts’,’my_google’);

    ?>

    #1128739
    Joao
    Moderator

    Hi There,

    Thanks for your input I will forward your suggestion to our developers.

    Joao

  • <script> jQuery(function($){ $("#no-reply-1127784 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>