Plugin Author
Aert
(@aahulsebos)
Hi @pstidsen,
For Google Maps with ACF to work we have 2 integrations;
ACF & Google Maps, one is under Integrations -> Plugins, the other under Services.
Try enabling both, if not yet already. Or disable both to see if the map works.
regards Aert
Hi there,
Thanks for the quick reply! π
They are both activated. Disabling Integrations -> Plugins -> ACF made the map work. But is that compliant?
Plugin Author
Aert
(@aahulsebos)
Hi @pstidsen,
Can you activate both again, so we can have a look?
Thanks, regards Aert
Hi Aert,
Both are activated now.
However, we are moved to a new domain this night. You will be redirected to the new site if you go to the link in the original post but delete the ?cmp-part
/ Peter
Hi @pstidsen,
It looks like this is a custom Google Maps implementation from the theme.
Can you try to add the following string to complianz/integrations/script center, in the field where it says “part of url’s that should be blocked”
show_google_map_acf.js
It is possible you need to add a dependency, but let’s first try this.
Hi Rogier
Thanks for your reply. I recognize that script. I have added it to the list and something is better. On load the map is loaded with placeholder. However, on accepting cookies it disappear. Maybe I should add a dependency? Which one?
Can you add a mu-plugin, as described here:
https://complianz.io/adding-filters-with-mu-plugins-quick-easy/
With the following code:
This code makes sure the acf.js file waits for the google api to be loaded.
/**
* add the dependency
* $deps['wait-for-this-script'] = 'script-that-should-wait';
*/
function cmplz_multimarker_dependencies( $tags ) {
$tags['maps.googleapis.com/maps/api/'] = 'show_google_map_acf.js';
return $tags;
}
add_filter( 'cmplz_dependencies', 'cmplz_multimarker_dependencies' );
Hi Rogier,
That’s great, it worked. Thanks!
Is this filter the same as declaring $deps in wp_enqueue_script?
Best Regards,
Peter
Hi Peter,
Itβs a similar approach indeed. Glad it worked!