Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Google Maps api load order + provide an extra callback for devs to hook into #371

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

davidwebca
Copy link
Contributor

Fixes #294

Fixes the load order for Google Maps api. Since it uses a passed callback in the URL, the callback needs to be added first, hence changing to registerScript to force the order (Craft doesn't seem to have a mechanism to specify assets order except AssetBundles).

Also added an onload event to provide an extra callback with "onload" since the code already provides the callback to add the markers. By adding this callback, we are guaranteed that our extra code executes after the Google Maps API is loaded and that the initial callback is executed.

@Tam Tam changed the base branch from v4 to v4-dev April 4, 2024 14:14
@Tam Tam merged commit 73fb1d3 into ethercreative:v4-dev Apr 4, 2024
@Tam
Copy link
Member

Tam commented Apr 4, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map won't load intermittently, 'Uncaught (in promise)' error in console
2 participants