I want to find out the nearest places using parse API.When i enter a city name i have to find all the nearest places based on current latitude and longitude.My keywords will be there in parse database.Please let me know how can i do it.Here is the sample code which i have tried
//for finding the nearest places
ParseGeoPoint point = new ParseGeoPoint(17.5, -54.2);
ParseObject object = new ParseObject("Places");
object.put("hyderabad", point);
object.save();
Did you try whereWithinKilometers, whereWithinMiles or whereWithinRadians
Check on the ParseQuery in the right menu.
You code will look like something like:
ParseGeoPoint userLocation = (ParseGeoPoint) userObject.get("location");
ParseQuery query = new ParseQuery("PlaceObject");
query.whereWithinKilometers("location", userLocation);
query.findInBackground(new FindCallback() { ... });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With