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

Google Maps JavaScript API has been loaded directly without loading=async #76

Open
francescovgg opened this issue Mar 10, 2024 · 1 comment

Comments

@francescovgg
Copy link

Hi,

Thank you for this awesome plugin!

I see a warning message in the console:
Google Maps JavaScript API has been loaded directly without loading=async. This can result in suboptimal performance. For best-practice loading patterns please see https://goo.gle/js-api-loading

I think a solution would be to add &loading=async&callback=initMap when initializing the plugin, to improve performance

<script async
    src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&loading=async&callback=initMap">
</script>
@matanshukry
Copy link
Owner

@francescovgg that part already exists actually; the current line is

https://maps.googleapis.com/maps/api/js?key=${apiKey}&loading=async&libraries=places&callback=initMap

Not sure why that's happening then.
Can you create a small reproducible example?
Also, does this happen to you on multiple different browsers?

@matanshukry matanshukry added bug Something isn't working waiting for feedback and removed bug Something isn't working labels Aug 14, 2024
@matanshukry matanshukry reopened this Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants