Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #348483

    Hi,

    Since I need more advanced map functions I opted to use the Maps Marker Pro plugin which works great with the Enfold except when I try to create a new location in which case the Enfold’s Google map element conflicts with the plugin.

    The theme enqueues the Google Maps javascript on ALL admin pages and the plugin’s map creation page, thus breaking the map appearance and address autocomplete features of the plugin. I temporarily change the theme to 2014 and I verify that indeed Enfold is breaking the plugin.

    I contacted the plugin’s author and I was told that this issue was reported to Kriesi since the theme’s 2.6.4 version which it has not been solved yet.

    It is important to my needs to use a more advanced map features instead of the default theme’s basic Google map element. Therefore I need help in either disabling the theme’s Google Map javascript loading on ALL admin pages (when there is no reason to be enqueued unless it’s called) or I need help in completely disabling the theme’s Google Maps element from the child theme side so the disabling code won’t be replaced on Enfold’s future updates.

    Thank you,
    George

    #349100

    Hey George!

    Unfortunately we don’t have a copy of that plugin to do proper testing, can you please create us a WordPress administrator account? we don’t mind taking a look.

    Cheers!
    Josue

    #349211
    This reply has been marked as private.
    #350294

    Hey!

    Thank you for the update.

    Please add this on functions.php to prevent the theme’s default gmaps from rendering any scripts:

    add_filter('avf_gmap_vars', 'avf_gmap_vars_remove', 10, 1);
    function avf_gmap_vars_remove($js_vars)
    {	
    	$js_vars = array();
    	return $js_vars;
    }

    The google maps element will be disabled.

    Best regards,
    Ismael

    #350575

    Hey Ismael,

    Thanks for the code but it doesn’t work. The Google maps element is still there and works as normal on the back end. It seems that the code you suggested all it does is to disable the map from appearing on the front end.

    Is there a code that I can put on the child theme that will completely disable the theme’s Google map element and remove it from the back end?

    Thank you,
    George

    #351079

    Hey!

    Please try this:

    add_filter('avf_load_google_map_api', 'disable_google_map_api', 10, 1);
    
    function disable_google_map_api($load_google_map_api) {
    	$load_google_map_api = false;
    	return $load_google_map_api;
    }

    This should disable the theme’s default google map api. If it doesn’t work, I’m not sure we can be of any help regarding this issue. I’m sorry but you will need to contact the plugin author. We don’t usually provide support for third party plugins as stated on our support policy.

    Best regards,
    Ismael

    #351502

    Hi Ismael,

    This code worked. It removed the themes map api as I needed,

    Thank you!
    George

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Google Maps element javascript conflict with Maps Marker Pro Plugin’ is closed to new replies.