• Resolved amoonalu

    (@amoonalu)


    When I created my first map with this plugin, I received this message: “Google Maps Conflict Detected: It appears that a plugin or theme that you are using is including also Google Maps API JavaScript on your website. This means there will be a conflict with the Google Maps Builder plugin. Please dequeue the additional Google Maps JavaScript call to return the plugin to a working state.”

    I am also currently using an events plugin that also uses Google Maps, but I installed Google Maps Builder because I wanted to display maps by themselves. Can I not use these two plugins together? If I “dequeue additional Google Maps JavaScript call” will it disable the map functions on my other plugin?

    I’m also not well-versed in Javascript or CSS, and didn’t quite understand the instructions the message sent me to: http://codex.wordpress.org/Function_Reference/wp_dequeue_script.

    I would appreciate any help you can give me.

    Thanks!

    Stephanie

    ~

    Website in question: http://www.thecompanypresents.com/

    https://wordpress.org/plugins/google-maps-builder/

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Matt Cromwell

    (@webdevmattcrom)

    Hi Stephanie,

    This is a new alert we’ve added specifically for use cases like yours. The simple answer to your question is “No”, the Javascript needs to only be applied once, so if you dequeue the other script, both will be able to use the script in our plugin just fine.

    But, there are cases where that may be problematic. Give me a little bit and I’ll test your use-case and provide a snippet that should help you get around this issue.

    Please tell me specifically which Events plugin you are using which uses the Google Maps Javascript in it so I can test.

    Thanks!

    Thread Starter amoonalu

    (@amoonalu)

    Thank you so much for your help!

    The other plugin is called EventOn: http://codecanyon.net/item/eventon-wordpress-event-calendar-plugin/1211017

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    I sent you a private message on our support forum with an email address to send that plugin to for testing. Thanks!

    Thread Starter amoonalu

    (@amoonalu)

    Sure! I’ve sent over an email with the plugin attached.

    Thanks!

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    @amoonalu

    In your case this is the function you should place in your themes functions.php:

    function dequeue_eventon_gmaps_scripts() {
    	wp_dequeue_script( 'evcal_gmaps' );
    	wp_deregister_script( 'evcal_gmaps' );
    	update_option( 'gmb_google_maps_conflict', false );
    }
    add_action( 'wp_print_scripts', 'dequeue_eventon_gmaps_scripts', 100 );

    Let me know how that goes.

    Thread Starter amoonalu

    (@amoonalu)

    I think I must have pasted it wrong… again, I’m not very good with code. Is there a certain place in the theme functions.php I’m meant to put it? I tried pasting it at the bottom and nothing happened, so I’m sure I must have done it wrong.

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    No, pasting it exactly as you see it there should be fine. One thing I forgot to mention is after you’ve pasted it in, go to the FRONTEND of your site, specifically to a page where the Events are, and press CTRL and F5. Then go to the BACKEND again and go to the Dashboard or refresh that page. That should help.

    If you still see it, try these things:

    1) In the last line, try changing the 100 to 9
    2) Make sure that there is not a ?> right BEFORE the whole thing. If there is, move it to the end.
    3) Check if perhaps you have even another plugin that uses the Google Maps API by disabling ALL plugins except Google Maps Builder and EventOn. If the notification goes away with only those two enabled, then re-enable each one, one by one and refresh the front-end each time and check for when the notification comes back. Then let me know which plugin uses the API and I’ll give you another updated code.

    Let me know.

    Thread Starter amoonalu

    (@amoonalu)

    Okay, the warning has gone away, but now none of my maps are visible. I tried changing the 100 to a 9, I tried the CTRL + F5 instruction, and I also disabled all my plugins except Google Maps Builder and EventOn without any change.

    I don’t know if this would affect it but I’m using a multiple themes plugin: https://wordpress.org/plugins/jonradio-multiple-themes/. I added the code to both of the themefunction.php’s, but maybe the problem is there? Though I disabled that as well…

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    I need to take a look under the hood I think. Can you email me at support at wordimpress.com?

    I’m having the same issue with another plugin. It’s Event Organiser. Tried using this in my functions.php, but no luck…

    function dequeue_eventorganiser_gmaps_scripts() {
    wp_dequeue_script( ‘eventorganiser_gmaps’ );
    wp_deregister_script( ‘eventorganiser_gmaps’ );
    update_option( ‘gmb_google_maps_conflict’, false );
    }
    add_action( ‘wp_print_scripts’, ‘dequeue_eventorganiser_gmaps_scripts’, 100 );

    Thanks!

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    Hi @catsigater

    The code you’ll want to resolve the conflict for the Event Organizer is this:

    function dequeue_eventorganiser_gmaps_scripts() {
    wp_dequeue_script( 'eo_GoogleMap' );
    wp_deregister_script( 'eo_GoogleMap' );
    update_option( 'gmb_google_maps_conflict', false );
    }
    add_action( 'wp_print_scripts', 'dequeue_eventorganiser_gmaps_scripts', 9 );

    Let me know how that goes. Thanks!

    Hi Matt.

    Were you able to resolve amoonalu’s issue? Mine’s the same. I installed the code, and the error message is gone, but the map space is now blank. I’ll be happy to give you whatever access you need.

    Thanks so much for your help.

    Andy

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    Hi @catsigater

    We resolved the main issue, yes. Add this code after what was provided previously:

    function gmaps_api_js() {
    	wp_enqueue_script( 'gmaps-master-js', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places', array(), 'null', true );
    }
    
    add_action( 'wp_enqueue_scripts', 'gmaps_api_js' );

    That did it. I copied the code directly from my email which was rendering the apostrophes as “'”. But once I replaced them back, works like a charm.

    Thanks! This is site’s getting ready to go live, so I appreciate the quick response.

    Plugin Author Devin Walker

    (@dlocc)

    Thanks for jumping in and solving Matt. @catsigater – if you’re happy with the plugin and support please rate it 5-stars to help us out! Thanks! http://wordpress.org/support/view/plugin-reviews/google-maps-builder

Viewing 15 replies - 1 through 15 (of 19 total)

The topic ‘Conflict Detected??’ is closed to new replies.