-
Notifications
You must be signed in to change notification settings - Fork 65
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
Documentation mentions deprecated methods #801
Comments
If you would like to upvote the priority of this issue, please comment below or react with 👍 so we can see what is popular when we triage.@MrAmericanMike Thank you for opening this issue. 🙏
This is an automated message, feel free to ignore. |
@MrAmericanMike I can see that this has deprecated too. Do you happen to know what I can use instead of |
Yes the one that works is using // Promise for a specific library
loader
.importLibrary('maps')
.then(({Map}) => {
new Map(document.getElementById("map"), mapOptions);
})
.catch((e) => {
// do something
}); |
Yes, |
Great thank you both! |
Yes, but what if we need to load multiple libraries at once? When I call import Library multiple times I get error: Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match. |
There should be a way to load multiple, maybe importLibrary should accept an array of Library names. |
It is intended to be safe to call importLibrary() multiple times. Can you file a new bug to track that (preferably with sample code that exhibits the issue)? |
@chrisjshull When calling multiple times importLibrary 1 by 1 with await() // For example, Previously we'd Warning: "Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match." Solved using Promise.all(): #809 |
Ah, thanks. I'll comment there. |
Not much, just reporting this so the documentation can be updated.
On the README.md there are 2 methods for using the library mentioned
loader.load()
andloader.loadCallback()
but both methods are deprecated.The text was updated successfully, but these errors were encountered: