Home Forums Backend Issues (wp-admin) Google maps duplicate api error


Google maps duplicate api error

  • Hi,

    I’m creating a plugin for ACF. I needed a google maps drawing plugin so started to creating it.

    Works fine but sometimes it works and sometimes it does not.
    Seems it is conflicting with the google maps plugin.

    Gives the following error:

    I think its because the two sources of jsapi are loaded async, at the same time.

    I check if duplicate with the following code:

    		// validate google
    		if( typeof window['google'] === 'undefined' )
    			$.getScript('', function(){
    			    google.load('maps', '3', { other_params: 'libraries=places,drawing', callback: function() {
    					acf.fields.google_map_draw.set({ $el : $el }).init();
    			google.load('maps', '3', { other_params: 'libraries=places,drawing', callback: function(){
    				acf.fields.google_map_draw.set({ $el : $el }).init();

    Here is a sample of the plugin:

  • Hi @wouter84

    Could you please ask Google Map community about that error?


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

The topic ‘Google maps duplicate api error’ is closed to new replies.