• Resolved Bonaldi

    (@bonaldi)


    Hi,

    How can I block MapPress Maps for WordPress Google Maps ?
    Is it possible to add it in your plugin ?

    Happy new year 2020 !

    Regards.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    Hi @bonaldi,

    A happy 2020 to you to ??

    This is certainly possible. I have created a branche with an integration for it:
    https://github.com/rlankhorst/complianz-gdpr/tree/mappress

    We will ship it with the next release.

    Essentially, it consists of the following additional code:
    Block the script:

    add_filter('cmplz_known_script_tags', 'cmplz_mappress_script');
    function cmplz_mappress_script($tags){
    
    	$tags[] = 'mappress-google-maps-for-wordpress/js/mappress';
    
    	return $tags;
    }

    Add a placeholder:

    function cmplz_mappress_placeholder($tags){
    
        $tags['google-maps'] = 'mapp-canvas';
        return $tags;
    }
    add_filter('cmplz_placeholder_markers', 'cmplz_mappress_placeholder');

    Make sure the placeholder gets the correct height:

    add_action('wp_footer', 'cmplz_mapppress_css');
    function cmplz_mapppress_css(){
    	$obj = new Mappress_Map();
    	?>
    	<style>
    		.mapp-main .cmplz-placeholder-element {height:<?php echo $obj->height()?>;}
    	</style>
    	<?php
    };
    Thread Starter Bonaldi

    (@bonaldi)

    Hi Rogier,
    Good, I tested and it works.
    Thanks.
    Regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘MapPress Maps for WordPress’ is closed to new replies.