Support

Account

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

Helping

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:
    .. http://imgur.com/Og99ARs

    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('https://www.google.com/jsapi', function(){
    			
    			    google.load('maps', '3', { other_params: 'libraries=places,drawing', callback: function() {
    
    					acf.fields.google_map_draw.set({ $el : $el }).init();
    
    			    }});
    			});
    		}
    		else
    		{
    			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:
    .. http://imgur.com/mCzFFHH

  • Hi @wouter84

    Could you please ask Google Map community about that error?

    Thanks!

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

You must be logged in to reply to this topic.