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

Uncaught ReferenceError: google is not defined #25

Open
patrickbolle opened this issue Feb 24, 2016 · 3 comments
Open

Uncaught ReferenceError: google is not defined #25

patrickbolle opened this issue Feb 24, 2016 · 3 comments

Comments

@patrickbolle
Copy link

Looks like it is on this line -
this.autocompleteservice =new google.maps.places.AutocompleteService();

I'm not sure if I'm just not loading google places properly (have it in my head tag of the navbar), or if I'm doing something else wrong.

Thanks a lot!!

@ptrmrrs
Copy link

ptrmrrs commented Feb 29, 2016

You might have some kind of race condition where meteor tries to render the field before the API has loaded. If you're using the dburles:google-maps package you can use the reactive method GoogleMaps.loaded() in a helper to only render the form field if it returns true.

@patrickbolle
Copy link
Author

I'll give it a shot! Thanks @yetanotherpete

@acomito
Copy link

acomito commented Mar 31, 2016

I set up a global helper that uses the GoogleMaps.loaded(), then I do a trigger on enter with FlowRouter. I wrap the google input in a #if dependent on the googlemapsisready helper that comes with dburles package.

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

No branches or pull requests

3 participants