You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
I'm having problems using an API key. After loading the library I call $.gmap3({ key: "..." })'.
Sometimes it works sometimes it doesn't. The problem is that the Google API is loaded in the onReady event, but sometimes the onReady event has already fired when the JS loads. Thus the API is loaded before I get to set the key, and I can't set the key before loading the API.
I know this is the cause of the problem because if I move the code that loads the API inside the $.gmap3(), after storing the key, it always works.
The text was updated successfully, but these errors were encountered:
I've forked the code and moved the Google API loading code inside $.gmap3(). This gives me control over when and how scripts are loaded. I'm not doing a PR since I guess this is not what everybody wants.
I haven't found another way to make it work. When you have ten scripts in your site, all of them trying to be loaded first and none of them really needing to be the first you need to take control.
Nice regards.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm having problems using an API key. After loading the library I call
$.gmap3({ key: "..." })'
.Sometimes it works sometimes it doesn't. The problem is that the Google API is loaded in the onReady event, but sometimes the onReady event has already fired when the JS loads. Thus the API is loaded before I get to set the key, and I can't set the key before loading the API.
I know this is the cause of the problem because if I move the code that loads the API inside the
$.gmap3()
, after storing the key, it always works.The text was updated successfully, but these errors were encountered: