Last active
December 14, 2015 22:59
-
-
Save mdobson/5162194 to your computer and use it in GitHub Desktop.
Geolocation queries in UserGrid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UGQuery * query = [[UGQuery alloc] init]; | |
//This performs a geolocation query on the App Services platform. | |
//Note that geolocation queries are no different then other queries that can be performed | |
//on the App Services platform | |
[query addRequiredWithin:@"restaurants" latitude:37.776753 longitude:-122,407846 distance:16093.00]; | |
//An alternate way to perform this query is to use the SDK method that takes a CLLocation object. | |
//Set up the CLLocation object with a lat and lon, and simply pass it into the SDK Method | |
CLLocation *myLocation = [[CLLocation alloc] initWithLatitude:37.776753 longitude:-122.407846]; | |
[query addRequiredWithinLocation:@"restaurants" location:myLocation distance:16093.00]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment