用于地理编码的映射API键永远不起作用



我已经启用了Google Maps Geocoding API和Google places API,用于Android从查询到Google Maps获取POI。我也有服务器键。我的链接是:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=lat,lng&radius=1000&sensor=true&types=food|bar|store|museum|art_gallery&key=my_server_key

我得到这样的结果:

{
    "error_message" : "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console",
           "html_attributions" : [],
           "results" : [],
           "status" : "REQUEST_DENIED"
}

如果我删除链接的关键部分,我得到这个:

{
    "error_message" : "This service requires an API key.",
           "html_attributions" : [],
           "results" : [],
           "status" : "REQUEST_DENIED"
}

我怎么能解决这个问题??thx

您只启用以下服务Google Maps Geocoding API和Google places API for Android。android的API是和android框架一起使用的,它不能提供restful webservice。启用"Google放置API web服务"

最新更新