Google Map Extended plugin failed to load map, "google not defined"

Hi,

I am using a map element from Google Map Extended plugin.

I am getting this error in my console (only some of the times) and the map does not show up on the page.

On other times, the map does get loaded, and the last error does not show.

I have the map center location to be a state I define on page load with data like: “321 E 14th St, New York, NY 10003, USA”. The map type is Roadmap. The starting zoom level is 4. After the map element is “ready” I “add markers list” and then I “map controls”. All fields are set and aren’t red or raise errors within the editor.

@AliFarahat Any idea why the map would sometimes load and sometimes not? Much appreciated.

Thanks.

The easiest fix is to force bubble to load it’s Google maps library. You can do that by add the bubble native map to the page and make it invisible.

You can make the bubble map element really small and hidden

3 Likes

Hey @AliFarahat,

Thanks for the response. I tried what you recommended. But now it still works only half of the times and gives this error when it doesn’t work:

1 Like

And it now also shows an error on the map itself if it doesn’t load. Any suggestions?

Screen Shot 2020-06-11 at 1.58.18 PM

1 Like

Hi @mazorshimon , it seems I’m passing through the same issues than you. I added the extended pluggin to display itinerary on a google map, and after all (I don’t really know why), the problem fixes itself. Now I have the same problem as you… in french :sweat_smile:

Capture d’écran 2020-09-28 à 17.33.44

Do you figured out what happened? How did you fix it?

@AliFarahat, do you know where this problem is come from? (thanks a lot for the pluggin BTW)

Thanks

Hi @AliFarahat, It’s a strange things going on here. When I preview the page, the previous message appears and the the google map extender’s map is not displayed . When I stay on this page, refreshing it again and again, most of the time it works, but sometimes it doesn’t (3 on 5). Without changing any parameters.
Could you help me with that?

Thanks again

1 Like

I’m having the exact same issue.

1 Like

I’ve struggled with issues using this plugin - getting errors on load only sometimes but usually if I step through the workflows they worked fine. Ultimately what I needed to do was put a 2 second pause immediately on the main page load (not the map load). This seems to allow the map plugin to load correctly and fix the issues, at least in my case.

Hope that helps someone, I was pulling my hair out for the longest time!

Same issue here.

With the latest version 11.2.0 I have ReferenceError: async is not defined

I’m having the issue as well. Version 12. Sometimes the map loads, sometimes it doesn’t. Even tried the pause on page load.

@AliFarahat - Any thoughts on what causes this to happen?

Update, I noticed that another extended map on my page was displaying every time without issue. It was inside of a group that was visible when a custom state was “yes”. I triggered the custom state to “yes” with a workflow once a button was clicked.

I realized the map that I was having issues with was directly on the page. So, I placed it inside of a group and created an “On page Load” workflow that pauses actions for 2 seconds then switches a custom state to “Yes” allowing this group to be visible.

It works every time without fail now.

@AliFarahat - Thanks for this incredible plugin!

Olá… estou tendo este erro:
The plugin Google Maps Extended / action Directions a Maps Extended threw the following error: TypeError: l is not a function
at v (PLUGIN_Google-Maps-Extended-element_action–Maps-Extended-Directions-.js:4:96)
at eval (PLUGIN_Google-Maps-Extended-element_action–Maps-Extended-Directions-.js:7:59) (please report this to the plugin author)

Ola, eu estava com o mesmo problema, então instalei mais produtos do Google API, principalmente o GEOCODING API, então o mapa apareceu e tudo funcionou perfeitamente. Espero que sirva de ajuda!

I am facing this same problem can someone help me out?

Hey @moserbcudi

We are working on a large update that will also solve this issue which is coming in the next week or so. In the meantime you can easily work around this error by adding a hidden regular Google Map (Bubble’s own map element) element to the page

Also make sure that you only execute plugin actions after the map has loaded. You can use the “Ready” event or “Do when Google maps extended ready is yes”

Ok AliFarahat

Thanks for this information

Hi @AliFarahat

Firstly, thanks for the great plugin. I have implemented it in my web app and it works great!

One small issue though, I am getting an error in my console when I try to add a marker to the map using the “MapsExtended Map is Ready” event. From the bubble debugger, it seems that the map fires this event twice for some reason, once before it is actually ready and once after. This means that on the first attempt, my marker cannot be added, but on second attempt it works.

This means there is essentially no issue on the user-facing side of things as the marker does get added when the map is ready. However, having this error show up in my console every time is a bit of an eye sore and also makes me think there might be a bug somewhere in the plugin.

It is of course entirely possible that I am doing something wrong, but I have made sure that the address is definitely defined when the “add marker” action is attempted. The error I get in the console is as below:

Any help would be greatly appreciated!

Hey @peterjbrink

The plugin is designed to utilize Bubble’s own google maps APIs. It first attempts to load and use those if available. However in some cases Bubble may load the APIs a bit later on and may cause some errors. Try the following in order

  1. Try to use “Do when…” instead of the event and see if that helps, if not try to also do the next suggestion
  2. Try to add a native bubble map somewhere on the page. Make it small and hidden. This should force Bubble to load the google map APIs and will avoid the conflict.

Hey mate @AliFarahat

Thanks for the suggestions. I tried both of these and it still seems that the Maps Extended is trying to add the marker before it is actually ready. I can see that the error shows up in the console before the map actually becomes visible.

One can get past this by adding a 1000ms pause before the “Add Marker” action inside the “Do when Maps Extended’s Map - Ready is yes” event, but it feels like a bit of a patchwork fix as any user with longer than usual loading times would surpass this 1000ms pause and still get the error.

EDIT: In fact, just out of interested I experimented with the pause times and it seems that around 747ms is where the cutoff point tends to be. Anything less than that and it will usually throw an error, anything more than that it will usually not, and 747 on the dot gives inconsistent results.

If you have any other suggestions as to what might be happening, or any questions regarding my implementation, please do let me know.