Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    That branch does not exist anymore because it has been merged and released. If there is an issue on your site it is something else.

    If you post your website we can take a look.

    Thread Starter gasserb

    (@gasserb)

    Plugin Contributor Aert Hulsebos

    (@aahulsebos)

    HI @gasserb,

    I don’t see Complianz enabled. How do you implement the Google Maps, just with ACF?

    regards Aert

    Thread Starter gasserb

    (@gasserb)

    It is enabled… yes with ACF!

    Thread Starter gasserb

    (@gasserb)

    it is enabled but on the end oft the website there is no google maps… only a grey rectangle…

    Plugin Contributor jarnovos

    (@jarnovos)

    Hello @gasserb,

    You have a script called “goldenerfisch.js” which tries to initialize the Google Map when the Google Maps API is still blocked by Complianz. This results in a “google is not defined” error and results in the map being unable to load.

    If you create a new integration under Complianz > Script Center > Block a script/iframe, add “goldenerfisch.js” as the “URL to block”, and finally set it’s dependency to wait for “maps.googleapis.com”, it should work in theory.

    Although I see that that particular JavaScript file contains more than just Google Maps code, so, blocking it might also affect other functionality that was included in that file.

    Kind regards,
    Jarno

    Thread Starter gasserb

    (@gasserb)

    hey thanks but that still do not work… do you have another solution?

    Thread Starter gasserb

    (@gasserb)

    update: it works if i accept the cookie banner and refresh after that
    and if i decline the cookies it reloades and the google maps are not shown!

    But if i accept the google maps only show after the manual refresh….

    And there is no placeholder image if the map is not shown…

    Kind regards,
    Bastian

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    If your maps doesn’t load on accept, the custom script probably triggers on document.read. To fix, please add:

    function cmplz_custom_initDomContentLoaded() {
    	ob_start();
    	?>
    	<script>
    		document.addEventListener("cmplz_run_after_all_scripts", cmplz_novo_fire_domContentLoadedEvent);
    		function cmplz_novo_fire_domContentLoadedEvent() {
    			dispatchEvent(new Event('load'));
    		}
    	</script>
    	<?php
    	$script = ob_get_clean();
    	$script = str_replace(array('<script>', '</script>'), '', $script);
    	wp_add_inline_script( 'cmplz-cookiebanner', $script );
    }
    add_action( 'wp_enqueue_scripts', 'cmplz_custom_initDomContentLoaded',PHP_INT_MAX );

    For a placeholder, where the blocked element is a script, you can uncheck “the blocked content is an iframe”, then insert the div or ID of the html element where you want the placeholder to appear.

    Thread Starter gasserb

    (@gasserb)

    oh thanks that worked!

    • This reply was modified 2 years, 3 months ago by gasserb.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Google Maps (via ACF) not working with Complianz’ is closed to new replies.