[英]Google maps background is gray
If you're like me, you might be searching all of the internet to fix this problem. 如果您像我一样,则可能正在整个互联网上搜索以解决此问题。 Every post will be saying
每个帖子都会说
If you have a gray background it's your API key
如果背景为灰色,则是您的API密钥
but we thought we were special. 但是我们认为我们很特别。 Even our
甚至我们的
GMSServices.provideAPIKey("YOUR_API_KEY")
was returning with True
. 带着
True
返回。
We checked that: 我们检查了:
Nothing worked. 没事。
We stored out API key in a file, so we could add it to our .gitignore
. 我们将API密钥存储在文件中,因此可以将其添加到
.gitignore
。 Turns out when you're reading in your API key you're going to want to be absolutely sure that you're trimming \\n
s from your string. 事实证明,当您阅读API密钥时,您将要绝对确定要从字符串中修剪
\\n
。
I hope this helps at least one other person! 我希望这可以帮助至少另一个人!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.