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

Return the google global from the API service if Google Maps has already been loaded #140

Merged
merged 1 commit into from
Aug 24, 2021

Conversation

grodriguez85
Copy link
Contributor

@grodriguez85 grodriguez85 commented Aug 22, 2021

On the GoogleMapsApiService, the _getApi() should return window.google, not window.google.maps right?

After I install the ember-place-autocomplete addon this one is failing to load the Google Maps API. The _loadAndInitApi() function resolves window.google after it loads, and the getter directionsService() tries to access the .maps property. So returning window.google.maps on _getAPI() fails on the getter as it tries to access the maps property by a second time. I think this is a bug added like 4 months ago.

I don't know why the tests are failing, looks like the tests don't have an API Key set.

@sandydoo sandydoo added the bug Something isn't working label Aug 23, 2021
@sandydoo
Copy link
Owner

Thanks, @grodriguez85! I'll merge this after I get the CI working. Ember@4.0 is also in beta, so, naturally, the CI is choking on errors 😓

@sandydoo
Copy link
Owner

@grodriguez85, would you mind rebasing your branch on main?

@grodriguez85
Copy link
Contributor Author

Sure, now it's rebased.

@sandydoo sandydoo changed the title fix: _getApi() should return window.google, as _loadAndInitApi() does. Return the google global from the API service if Google Maps has already been loaded Aug 24, 2021
@sandydoo sandydoo merged commit 8d8a3c1 into sandydoo:main Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants