• Resolved Zougou

    (@zougou)


    Hi,
    I’m struggling with the integration to block Google Maps from Premium Addons for Elementor.
    I’ve followed instructions from here :
    https://complianz.io/custom-google-maps-implementation/
    Here’s my first function :

    function cmplz_custom_googlemaps_script( $tags ) {
    $tags[] = array(
    'name' => 'google-maps',
    'category' => 'marketing',
    'placeholder' => 'google-maps',
    'urls' => array(
    'maps.googleapis.com/maps/api/js',
    '/js/premium-maps',
    ),
    'enable_placeholder' => '1',
    'placeholder_class' => 'premium-maps-container',
    'enable_dependency' => '1',
    'dependency' => [
    //'wait-for-this-script' => 'script-that-should-wait'
    'maps.googleapis.com/maps/api/js' => '/js/premium-maps',
    ],
    );
    return $tags;
    }
    add_filter( 'cmplz_known_script_tags', 'cmplz_custom_googlemaps_script' );

    I didn’t edut the second function cmplz_custom_maps_initDomContentLoaded().

    For my tests :
    I cleared web browser
    When I vist the page with the google Map
    => the placeholder is well displayed, with the button to activate Marketing cookies (but I have a JS error ‘google is not defined’
    If I click on placeholder button, sometimes the map is displayed, and sometimes not with a JS error ‘google is not defined’.
    If I refresh page with F5 multiple times, I keep having the same problem ; sometimes the map load, and sometimes not.

    PS : I have tried to inverse ‘dependency’ to

    '/js/premium-maps' => 'maps.googleapis.com/maps/api/js',

    with no luck.

    Could you help me with that please ?
    Thanks in advance for your return,
    Best regards

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Block Premium Addon Elementor Google Map’ is closed to new replies.