我正在使用Google Places API在我的api密钥下添加地点。我能够成功创建该地点并查看它的详细信息,但它也没有使用相同的密钥在我的iPhone应用程序的地图上显示它。有没有其他人遇到过这个问题
我发送请求,其中有效:
https://maps.googleapis.com/maps/api/place/add/json?key=MYKEY
我确保通过发送以下请求来创建该地点,该请求包含我刚创建的地点的ID:
https://maps.googleapis.com/maps/api/place/details/json?placeid=idofplace
这会返回正确的位置。如果我转到我的iPhone应用程序,它使用相同的API密钥和附近的搜索获得结果,该项目不会出现在地图上。
答案 0 :(得分:2)
该地方是否显示在json搜索响应中?请确保您没有使用iOS密钥。 The Places API does not work with an Android or iOS API key.
您可以尝试使用附近的搜索,示例请求:
https://maps.googleapis.com/maps/api/place/nearbysearch/output?parameters
需要确保地点位于所提供位置的半径范围内,但是如果您的请求半径太大,您的结果将会进入next_page_token
我能够发布一个新地点,并通过以下请求从附近的搜索中获取它:
发布: https://maps.googleapis.com/maps/api/place/add/json?key=YOUR_KEY
{ "location": {
"lat": -33.8669710,
"lng": 151.1958750
},
"accuracy": 50,
"name": "Stackoverflow!",
"phone_number": "(02) 9374 4000",
"address": "48 Pirrama Road, Pyrmont, NSW 2009, Australia",
"types": ["shoe_store"],
"website": "http://www.google.com.au/",
"language": "en-AU"
}
获取: https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&key=YOUR_KEY&radius=50
然后在json响应中搜索名称Stackoverflow
。 (您也可以直接在浏览器中访问GET请求链接)
根据Places API文档,new places will be available immediately in place nearby searches initiated by your application.
但是,新版本的地方不会出现在原位文本搜索或雷达搜索结果中,也不会出现在其他应用程序中,直到审核过程批准为止。< / p>
您的应用程序添加的地点也可以删除,直到它们被审核为止。审核并添加到完整位置搜索结果后,就无法再删除某个地点。审核过程不接受的地方将继续对提交它们的应用程序可见。 有关详细信息,请参阅Place Action documentation。