• Resolved webitman

    (@webitman)


    After installing Gtranslate, great plugin, the map of WP Google Maps does not show up.
    After trial & error I finally found that Gtranslate seems to conflict.
    What solution do you suggest ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author edo888

    (@edo888)

    Hi,

    I’ll need to see it in action on your website to identify the issue and provide a solution.

    Usually Google map apps only check for “google” javascript variable and when it is already set they do not run their code. The solution is to check for google.maps variable instead, since GTranslate uses google.translate variable which also sets google variable.

    You may also contact our live chat and provide your link there if you do not want to be public.

    https://gtranslate.io/#contact

    Thanks! ??

    Thread Starter webitman

    (@webitman)

    This is not the site where the problem because the site is in ComingSoon mode.
    But I can easy reproduce the error at this site
    https://portal-base.com/email-us/
    At the left side is WP Google Maps………….

    Plugin Author edo888

    (@edo888)

    Hi,

    I have found this code, which is not exactly correct:

    /wp-content/plugins/wp-google-maps/js/wpgmaps.js

    MYMAP.init = function(selector, latLng, zoom) {
    
    	var maptype = null;
    	
    	if(window.google)
    	{
    		if (typeof wpgmaps_localize[wpgmaps_mapid].type !== "undefined") {
    			if (wpgmaps_localize[wpgmaps_mapid].type === "1") { maptype = google.maps.MapTypeId.ROADMAP; }
    			else if (wpgmaps_localize[wpgmaps_mapid].type === "2") { maptype = google.maps.MapTypeId.SATELLITE; }
    			else if (wpgmaps_localize[wpgmaps_mapid].type === "3") { maptype = google.maps.MapTypeId.HYBRID; }
    			else if (wpgmaps_localize[wpgmaps_mapid].type === "4") { maptype = google.maps.MapTypeId.TERRAIN; }
    			else { maptype = google.maps.MapTypeId.ROADMAP; }
    		} else {
    			maptype = google.maps.MapTypeId.ROADMAP;
    		}
    	}
            ...
    

    Instead of just checking for window.google it must also check for window.google.maps. Hope this helps and the plugin developer can correct that.

    Thanks! ??

    Hi @edo888

    Perry here from WP Google Maps, thank you for pointing this out,

    We’ve added an additional check for google.maps by changing line 214 of wpgmaps.js to

    if(window.google && google.maps)

    Anyone reading can apply the same change for an immediate fix.

    We have applied this fix in our 8.0.12 update, which will go live early next week.

    Kind regards
    – Perry

    Thread Starter webitman

    (@webitman)

    @perryrylance and @edo888 You guys are great, thanks a lot.

    Plugin Author edo888

    (@edo888)

    Thank you. Happy new year! ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘conflict with WP Google Maps’ is closed to new replies.