Open 4N1S opened 8 years ago
it's working probably a problem with your code
I have recloned repo directory to another and I start example.js without any change .. I have the same error in files poke.io.js:550
at Request._callback (/Users/NiS/Desktop/travail_ETE_2016/Pokemon_test/node_modules/geocoder/providers/google.js:20:5)
at Request.self.callback (/Users/NiS/Desktop/travail_ETE_2016/Pokemon_test/node_modules/geocoder/node_modules/request/main.js:122:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request.
I find the solution ! the problem was the limit of GeoCod api google .. It must go through a rental in lat and long . it works !
GeocoderQuotaExceeded: The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.
I solved it. You may get a Geocode Api Key and add it as parameter in every geocode call inside poke.io.js
Example:
geocoder.reverseGeocode.apply(geocoder, _toConsumableArray(GetCoords(self)).concat([function (err, data) {
if (err) return callback(err);
if (data && data.status !== 'ZERO_RESULTS' && data.results && data.results[0]) {
self.playerInfo.locationName = data.results[0].formatted_address;
}
callback(null, self.GetLocationCoords());
}]),{key: 'YOUR KEY'});
I'm using this API myself but I'm only feeding it lat/lng coordinates directly because I hit the quota at some point as well. While looking into how to hook the api key into it, I noticed that the geocoder
package is completely nuts and doesn't pass the options you pass it to google, so I fixed it for me like this:
https://github.com/shark0der/geocoder/commit/cfd0aaa49d37f50e320aa76f901758b643cd21b9
After a closer look, I noticed that you actually don't need reverse geocoding at all, so I forked this repo and removed that part of code. You can see it here:
https://github.com/shark0der/Pokemon-GO-node-api/commit/69298c2f5ddf585fe12dbb1a8d4bca7cca61fbd0
I can open a pull request as this is the only change I made to the API.
As I see this might fix #164 as well
it worked well until now . Niantic against attack?
TypeError: Cannot read property 'geometry' of undefined ?? var _data$results$0$geome = data.results[0].geometry.location;