Reputation: 989
I am using the Google Places API to add a place under my api key. I am able to successfully create the place and view details for it, but it doesn't show it on the map on my iPhone app also using the same key. Has anyone else come across this issue
I send the request to, which works:
https://maps.googleapis.com/maps/api/place/add/json?key=MYKEY
I made sure it created the place by sending the following request with the id of the place that I just created:
https://maps.googleapis.com/maps/api/place/details/json?placeid=idofplace
This returns the correct place. If I then go to my iPhone app which gets results using the same API Key and a nearby search, the item doesn't appear on the map.
Upvotes: 0
Views: 1214
Reputation: 6921
Does the place showed in the json search response? Please make sure you are not using the iOS key. The Places API does not work with an Android or iOS API key.
You can try using the nearby search, sample request:
https://maps.googleapis.com/maps/api/place/nearbysearch/output?parameters
Need to make sure the place is within the radius of your supplied location, however if your request radius is too large, your result will get into the next_page_token
I was able to POST a new place and GET it from nearby search with following requests:
POST: 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"
}
GET: https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&key=YOUR_KEY&radius=50
Then search the name Stackoverflow
in the json response. (You can past the GET request link directly in your browser too)
According to the Places API documentation, new places will be available immediately in place nearby searches initiated by your application.
However, a newly-added place will not appear in place text search or radar search results, or to other applications, until it has been approved by the moderation process.
Places that have been added by your application can also be deleted, until they have been moderated. Once moderated and added into the full place search results, a place can no longer be deleted. Places that are not accepted by the moderation process will continue to be visible to the application that submitted them. For more information, please refer to the Place Action documentation.
Upvotes: 2