• Resolved Julie

    (@wonderfullie)


    Hi,

    I have an issue with Google Maps and Complianz (everything works fine when the plugin is desactivated).

    My map is loaded via an initMap() function, in a .me-gmaps element. I had the “google is not defined” error, so I followed this tutorial to fix it : https://complianz.io/custom-google-maps-implementation/

    function cmplz_custom_googlemaps_script( $tags ) {
    	$tags[] = 'maps.googleapis.com/maps/api/js';
    	$tags[] = 'initMap';
    
    	return $tags;
    }
    add_filter( 'cmplz_known_script_tags', 'cmplz_custom_googlemaps_script' );
    function cmplz_custom_maps_dependencies( $tags ) {
    	$tags['maps.googleapis.com'] = 'initMap';
    	return $tags;
    }
    add_filter( 'cmplz_dependencies', 'cmplz_custom_maps_dependencies' );
    function cmplz_custom_maps_placeholder( $tags ) {
    	$tags['google-maps'][] = "me-gmaps";
    	return $tags;
    }
    add_filter( 'cmplz_placeholder_markers', 'cmplz_custom_maps_placeholder' );

    I don’t have the error anymore, but my map still don’t show… I also tried to switch off Google Maps in Complianz > Integration, with no sucess.

    Could you help me please ? Website is not online yet, but I can create an access on development environnement if necessary.

    Thank you,

    Julie.

Viewing 16 replies (of 16 total)
  • Thread Starter Julie

    (@wonderfullie)

    `I made a search in my theme and I have only this line in my footer.php for the Google Maps API :

    <script src="https://maps.googleapis.com/maps/api/js?key=[MY KEY]" defer></script>

    Switching theme is kind of complicated because I have a lot of rewrite and custom post type directly in the theme. So, I tried to add your function in my function.php file and… It works !

    I don’t understand what your fonction do exactly, could you explain to me if I enconter the same problem again ?

    Thanks

Viewing 16 replies (of 16 total)
  • The topic ‘Google Maps doesn’t work’ is closed to new replies.