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

feat: load google maps api dynamically #191

Closed
wants to merge 4 commits into from

Conversation

colenso
Copy link
Contributor

@colenso colenso commented Apr 5, 2024

Loads the maps api dynamically as is the recommended way.
I tried to make sure the diff in the PR is as minimal as possible 😉

@colenso
Copy link
Contributor Author

colenso commented Apr 5, 2024

@sandydoo Another one 🙏

@@ -71,19 +71,57 @@ Learn more: https://ember-google-maps.sandydoo.me/docs/getting-started`,
);

return new Promise((resolve, reject) => {
window.initGoogleMap = bind(() => {
const params = new URLSearchParams(new URL(src).search);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I would use the config directly at this point. I don't see a need to use URI-escaped values here.
  2. As an option, we could also do something JSON.stringify(Object.fromEntries([["version", "whatever"], ["emptyOption", ""]].filter((_, x) => x))). Or push to an array of options, then join(','). I don't really have a preference here, just worried about forgetting a comma somewhere.
  3. Are there versions of google maps that are still available, but don't support this? Should there be a version check to fall back to loading from src?

@colenso
Copy link
Contributor Author

colenso commented Apr 17, 2024

Closing in favour of #193

@colenso colenso closed this Apr 17, 2024
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.

2 participants