Google Maps API 错误:Google Maps API 错误:ApiNotActivatedMapError [英] Google Maps API error: Google Maps API error: ApiNotActivatedMapError
问题描述
我试图在我的项目中使用谷歌地图距离矩阵 api 来获取 2 个地方之间的距离.我也在谷歌开发者控制台中启用了这个 api.但我不断收到错误 ApiNotActivatedMapError
.
I am trying to use google maps distance matrix api in my project to get distance between 2 places. I have also enable this api in google developer console. But I am continuously getting error ApiNotActivatedMapError
.
我使用谷歌提供的示例代码作为 distance-matrix
I am using sample code provided by google as distance-matrix .
推荐答案
当您通过 Maps-Javascript-API 使用库或服务并使用密钥时,您只需要激活Google Maps JavaScript API .
When you use a library or service via the Maps-Javascript-API, and use a key, you only need to activate the Google Maps JavaScript API .
当您收到链接示例的特定错误时,您显然没有为您的项目激活 Google Maps JavaScript API.
When you get the particular error with the linked example you obviously didn't activate the Google Maps JavaScript API for your project.
2016 年 6 月 22 日起,如果您要使用以下功能,还需要为新应用激活相关 API(Webservice):
since June 22, 2016 you need also to activate the related API(Webservice) for new applications when you want to use the following features:
- 地理编码服务
- 路线服务
- distanceMatrix 服务
- 海拔服务
- 地方图书馆
这篇关于Google Maps API 错误:Google Maps API 错误:ApiNotActivatedMapError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!