0

We are using the Google Places API to add places and those should reflect in the Map loaded with the API key from the same console project. However, the added places do not reflect on the map, even after a long period of time.

https://developers.google.com/places/webservice/add-place

if somebody has used these APIs, please suggest some insight as to why this is happening. I had enabled the APis from the console project.

Thanks

Code is as follows:

function addPlaceToGoogle(data, callback) {
var request = require('request');
var requestUrl = 'https://maps.googleapis.com/maps/api/place/add/json?key=' + config.get("google_key");
var type = "store";
if (data.type) {
type = data.type;
}
var newData =
{
"location": {
"lat": data.latitude,
"lng": data.longitude
},
"accuracy": 50,
"name": data.address,
"address": data.address,
"types": [type]

};
var request = require('request');
var options = {
uri: requestUrl,
method: 'POST',
json: newData
};
request(options, function(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body) // Print the shortened url.
if (body.status == 'OK') {
data.placeId = body.place_id;
} else {
data.placeId = "";
}
data.type = type;
callback(null, data);
}
});
}
  • Can you show your code? Also did you enable the API? – Verma Jul 21 '15 at 17:10
  • Yes, updated the question with the code and yes I had enabled the API – Kunal Sethiya Jul 26 '15 at 12:20
  • 1
    Unfortunately, [Place Add](https://developers.google.com/places/web-service/add-place) has been deprecated on June 30, 2017 and will stop working on June 30, 2018. So you cannot use this method anymore. For further details please refer to the corresponding [geo blog post](https://maps-apis.googleblog.com/2017/06/announcing-deprecation-of-place-add.html). – xomena Jul 02 '17 at 14:52

0 Answers0