Reputation: 47
I am developing an application in iPhone in which I am showing the list of places in tableview.
I want to show the distance of the place from user's current location in cell. To find the distance, I am using Google api and I had written the code to find the distance in the cell itself.
There are 20 rows in the tableview so the Google web service is called 20 times and thats why it's giving OVER QUERY LIMIT response.
To overcome this, I have also used NSOperationQueue
but this is also not working. The Google api is still giving the OVER QUERY LIMIT response.
Does anyone have an idea about how to overcome this?
Upvotes: 0
Views: 1292
Reputation: 70997
Google Places API has a limit on the number of requests you can make per day (more here). So adding delays between calls will not really help.
If you have the lat/lon of both the points, you can use the Haversine Formula to calculate the distance or use Core Location.
Upvotes: 0
Reputation: 3125
don't use Google API to calculate the distance. Instead of Google use the CLLocation of iOS.
Take a look at CLLocation Class Reference, and use:
- (CLLocationDistance)distanceFromLocation:(const CLLocation *)location
Upvotes: 2