Turn off pop-up when you hover over a pin

Is there a way to turn off the pop-up with the buddypress member info when you hover over a pin? We want that off for privacy of the members

  • Adam Czajczyk
    • Support Gorilla

    Hello clamoreaux,

    I hope you're well today and thank you for your question!

    The Google Maps plugin shouldn't use any BuddyPress members' data (therefore create any "members' pins") unless there's a "BuddyPress profile maps" add-on active. Is it enabled on your site? You may check this by going to "Settings -> Google Maps -> Add-ons" page in your site's dashboard.

    I think though that I may be missing a point here so if above is not an issue indeed could you please elaborate a bit more on this? A slightly more detailed description and some example screenshots of what exactly are you referring to would be most helpful :slight_smile:

    Best regards,
    Adam

  • clamoreaux
    • Design Lord, Child of Thor

    I mis-spoke -- I should have said "click on" and not "hover over".
    If you go to the website https://www.cyclingchicks.xyz scroll down the map and click on a pink pin (you may have to zoom in to expand the blue cluster pins into individual member pink pins), a pop-up will appear with the member info. I want that pop-up turned off.

    And yes we have the buddypress add-on active. We want to show there are members all over but not give out any information about them. Part of the problem is when anyone goes to the site and is not logged in, they can get to the member profile -- privacy issues.

  • Madhusudan
    • Site Builder, Child of Zeus

    Hello clamoreaux ,

    You can hide the information detail from non-members by pasting the following code snippet into bottom of your child theme's funcitons.php file:

    if ( !is_user_logged_in() ): // íf user is not logged in
    ?>
    <style>
    .gm-style-iw{
    	display: none;
    }
    </style>
    
    <?php
       endif;

    However the members will be able see the details after logging in.

    If you haven't created a child theme earlier, here's are the detail guides on how to create it.
    https://premium.wpmudev.org/blog/easy-child-themes/
    https://premium.wpmudev.org/blog/how-to-create-wordpress-child-theme/

    I hope this will help to solve your issue, if not let us know.

    Thanking you,
    Madhusudan

  • clamoreaux
    • Design Lord, Child of Thor

    After i added that to the end of my functions.php, i got this error and it was displayed on my website and in the php_errorlog file: Warning: Cannot modify header information - headers already sent by (output started at /home/XXXX/public_html/cyclingchicks.xyz/wp-content/themes/Builder-Summit-Custom/functions.php:173) in /home/XXXX/public_html/cyclingchicks.xyz/wp-content/plugins/ithemes-exchange/lib/sessions/db_session_manager/class-db-session.php on line 153
    As soon as I took those lines back out it stopped happening.

  • Milan
    • WordPress Wizard

    Hello clamoreaux

    Hope you are well today and thanks for asking us. :slight_smile:

    When echoing data directly via functions.php without using proper WordPress hook, sometime can cause some plugin/theme breaking issue. ! So I think we need to wrap code snippet my colleague Madhusudan gave you with wp_head hook. :slight_smile: So please replace it with this one,

    add_action( 'wp_head', 'hide_a_thing' );
    function hide_a_thing(){
    	if ( !is_user_logged_in() ): // íf user is not logged in
    	?>
    	<style>
    	.gm-style-iw{
    		display: none;
    	}
    	</style>
    
    	<?php
    	   endif;
    }

    if this does not hide element, please use this one instead. :slight_smile:

    add_action( 'wp_head', 'hide_a_thing' );
    function hide_a_thing(){
    	if ( !is_user_logged_in() ): // íf user is not logged in
    	?>
    	<style>
    	.gm-style-iw{
    		display: none !important;
    	}
    	</style>
    
    	<?php
    	   endif;
    }

    Let me know how it goes. :slight_smile:
    Cheers,
    Milan

  • Milan
    • WordPress Wizard

    Hello clamoreaux

    Hope you are well today ?

    Unfortunately those div's are being rendered dynamically and they don't have any CSS selector assigned to it. So its very difficult for me to target those with CSS selectors. But there is one addon can help us in this situation I think. Please activate Additional Behaviour addon from Settings > Google Maps > Settings > Addon > Additional Behaviour. It will give you two options,

    #1) Click on item in marker-list opens the detail popup
    #2) Click on directions link scrolls to the directions form

    Keep these two checkboxes unchecked and save changes, Test after this and let me know how it goes.
    Cheers,
    Milan

  • Predrag Dubajic
    • Support

    Hi clamoreaux,

    Unfortunately there's no option in Google Maps to disable this popup, the above option Milan suggested only disables popup if you click on marker in the list below the map.

    I will flag this thread for our second line support developers so they could have a look at this and see if there's a quick workaround.
    Please note that, developer response might be slower than usual staff response, so we appreciate your patience on this.

    Best regards,
    Predrag

  • Panos
    • SLS

    Hello clamoreaux ,

    I have tried deregistering and de-queueuing the script that sets it, but it doesn't seem to work no matter how high priority I set it to.

    So what's left is to replace that js file, download attached file to your desktop, unzip it and replace
    wp-content/plugins/wpmu_dev_maps_plugin/js/user/google-maps.min.js

    Hope this helps :slight_smile:

    Kind regards,
    Panos

  • Adam Czajczyk
    • Support Gorilla

    Hello clamoreaux!

    I understand that the code is working for now is that right? Unfortunately, after plugin's update it will have to be re-applied. My colleague Panos tried to applied this tweak by first de-registering original scripts and then registering this "patched" one but as it didn't work this seems to be the only way to deal with it.

    Kind regards,
    Adam

  • Panos
    • SLS

    Sorry for not being clear, this is not another version of Google Maps plugin. It's a different plugin that de-registers the js file and re-registers the one I mention in my previous response :slight_smile:

    You can simply install it alongside Google Maps plugin and it will not be affected if you update it.

    I could have provided simply the code snipped so you can place it in your functions.php, but I preferred to provide it as a plugin which includes the fixed js file.

    Please let me know if you have further questions!

    Thanks!
    Panos

  • Panos
    • SLS

    It shouldn't, this is the only code it contains:

    function wpmudev_requeue_gmapscript() {
        wp_deregister_script( 'wpmu-google-maps-min-js' );
        wp_dequeue_script( 'wpmu-google-maps-min-js' );
    
        wp_enqueue_script( 'wpmu-google-maps-min-js', plugins_url( '/google-maps.min.js' , __FILE__ ) );
    
    }
    
    add_action( 'wp_footer', 'wpmudev_requeue_gmapscript' );

    You can check that by extracting the zip file and open file wpmudev-deregister-gmap-js/wpmudev-deregister-gmap-js.php with a text editor.

    As you can see it simply de-queueus a specific js file which has been originally enqueued by the Google Maps plugin. This means that this specific file will not be loaded at all. Then it enqueues the fixed file which should take care of the pin click :slight_smile:

    Thanks!
    Panos

  • clamoreaux
    • Design Lord, Child of Thor

    I installed it and it's close! The pins are no longer clickable to those not logged in but people who are logged in can't click them either. I could click on them and get the pop-up when I was logged in before I installed your new fix. Is there a way to fix that?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.