Angularjs 谷歌地图api密钥失败
在配置中,我定义:Angularjs 谷歌地图api密钥失败,angularjs,google-maps,google-maps-api-3,google-maps-api-2,api-key,Angularjs,Google Maps,Google Maps Api 3,Google Maps Api 2,Api Key,在配置中,我定义: .config( ['uiGmapGoogleMapApiProvider', function(GoogleMapApiProviders) { GoogleMapApiProviders.configure({ v: '2.3.3', libraries: 'weather,geometry,visualization', key: 'AIzaSyCz2DCKjoWMnlrf0
.config(
['uiGmapGoogleMapApiProvider', function(GoogleMapApiProviders) {
GoogleMapApiProviders.configure({
v: '2.3.3',
libraries: 'weather,geometry,visualization',
key: 'AIzaSyCz2DCKjoWMnlrf0V23RGidagkYrwTce38'
});
}
]);
在index.html中,我写道:
<script src="https://maps.google.com/maps/api/js?key=AIzaSyCz2DCKjoWMnlrf0V23RGidagkYrwTce38"></script>
因为谷歌告诉我,我没有插入密钥,正如你所看到的,我以前是这样做的
错误是:
js?v=3.exp&callback=initGoogleMaps:37 Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error_.hb @ js?v=3.exp&callback=initGoogleMaps:37(anonymous function) @ common.js:51(anonymous function) @ common.js:191c @ common.js:45(anonymous function) @ AuthenticationService.Authenticate?1shttp%3A%2F%2F47.62.226.23%3A9000%2Fangular%2Findex.html%23%2Fs…:1
如中所述,MissingKeyMapError
是开发人员错误代码,这意味着:
加载API的脚本元素缺少必需的身份验证参数。如果您使用的是标准的Maps JavaScript API,则必须使用具有有效API密钥的密钥参数。如果您是Premium Plan客户,则必须将客户端参数与客户端ID一起使用,或将密钥参数与有效的API密钥一起使用
正如建议的那样,请参见《操作指南》
如果在检查文档中给出的API密钥后,问题仍然存在,请尝试gmaps API问题中给出的解决方法。遇到的问题也可能与提出的问题有关
除此之外,最近在Geo开发者博客上发布的关于此问题的公告也可能有所帮助。如中所述,MissingKeyMapError
是一个开发者错误代码,意味着:
加载API的脚本元素缺少必需的身份验证参数。如果您使用的是标准的Maps JavaScript API,则必须使用具有有效API密钥的密钥参数。如果您是Premium Plan客户,则必须将客户端参数与客户端ID一起使用,或将密钥参数与有效的API密钥一起使用
正如建议的那样,请参见《操作指南》
如果在检查文档中给出的API密钥后,问题仍然存在,请尝试gmaps API问题中给出的解决方法。遇到的问题也可能与提出的问题有关
除此之外,最近在Geo Developers博客上发布的关于这一问题的公告也可能有所帮助。如果您将版本“2.3.3”替换为“3.20”,它将继续工作。下面是错误:js?v=3.exp&callback=initGoogleMaps:37谷歌地图API错误:MissingKeyMapError@js?v=3.exp&callback=initGoogleMaps:37(匿名函数)@common.js:51(匿名函数)@common.js:191c@common.js:45(匿名函数)@AuthenticationService.Authenticate?1shttp%3A%2F%2F47.62.226.23%3A9000%2FANGRAL%2Findex.html%23%2Fs…:1如果将版本“2.3.3”替换为“3.20”,则该版本应继续工作,但不工作。下面是错误:js?v=3.exp&callback=initGoogleMaps:37谷歌地图API错误:MissingKeyMapError@js?v=3.exp&callback=initGoogleMaps:37(匿名函数)@common.js:51(匿名函数)@common.js:191c@common.js:45(匿名函数)@AuthenticationService.Authenticate?1shttp%3A%2F%2F47.62.226.23%3A9000%2Fangular%2Findex.html%23%2Fs…:1
js?v=3.exp&callback=initGoogleMaps:37 Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error_.hb @ js?v=3.exp&callback=initGoogleMaps:37(anonymous function) @ common.js:51(anonymous function) @ common.js:191c @ common.js:45(anonymous function) @ AuthenticationService.Authenticate?1shttp%3A%2F%2F47.62.226.23%3A9000%2Fangular%2Findex.html%23%2Fs…:1