Created
October 11, 2011 17:42
-
-
Save emilepetrone/1278810 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// get voting districts for an area | |
SGEnvelope *envelope = [SGEnvelope envelopeWithNorth:40.613952 | |
west:-105.90271 | |
south:39.078908 | |
east:-103.513184]; | |
[query setFilters:[NSArray arrayWithObject:SGContextFilterFeatures]]; | |
[query setFeatureCategories:[NSArray arrayWithObjects:SGFeatureCategoryLegislativeDistrict, | |
SGFeatureCategorySchoolDistrict, | |
nil]]; | |
[client getContextForQuery:query | |
callback:[SGCallback callbackWithSuccessBlock: | |
^(id response) { | |
// you've got feature polygons! | |
// to create an array of SGFeature objects: | |
NSArray *features = [NSArray arrayWithSGCollection:response | |
type:SGCollectionTypeFeatures]; | |
} failureBlock:^(NSError *error) { | |
// handle failure | |
}]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment