dburles/meteor-google-maps

MissingKeyMapError with Meteor and React

Closed this issue · 4 comments

How can I solve this problem? After showing the map, no more than 1 second it will show an error, Oops! Something went wrong. Then in the console,
Google Maps API error: MissingKeyMapError appeared.

rlora commented

I have an app where the component works as expected. But another one in which the map crashes after 1s showing that error. I haven't found the root cause yet, I'm inclined to believe that it is something about Google. Given that package does not use an api key, probably if the domain is registered in Google console it acts differently. Will post more if I solve the issue.

rlora commented

Ok. I think is because of this: https://maps-apis.googleblog.com/2016/06/building-for-scale-updates-to-google.html

Starting 2016/06 all apps using Google Maps need an API Key. Look at the code, when you are loading the library you can pass an options hash. If it contains the key it should be included in the URL. As in: https://developers.google.com/maps/documentation/javascript/tutorial#Loading_the_Maps_API

That should work. I will confirm when I allocate some time to look at the app that I have crashing.

You can add an API key just check the docs under load

rlora commented

@dburles Yes! Thank you, works as expected by adding the api key in the options object.