Skip to content

Instantly share code, notes, and snippets.

@kristopherjohnson
Created February 19, 2014 00:36
Show Gist options
  • Save kristopherjohnson/9083748 to your computer and use it in GitHub Desktop.
Save kristopherjohnson/9083748 to your computer and use it in GitHub Desktop.
Category on ArcGIS for iOS SDK's AGSPoint to render coordinate as a CLLocation
#import <ArcGIS/ArcGIS.h>
@interface AGSPoint (KDJCoreLocation)
// Return point as a Core Location CLLocation object
- (CLLocation *)kdj_location;
@end
#import "AGSPoint+KDJCoreLocation.h"
@implementation AGSPoint (KDJCoreLocation)
- (CLLocation *)kdj_location {
// Project point into WGS84
AGSGeometryEngine *engine = [AGSGeometryEngine defaultGeometryEngine];
AGSPoint *locationPoint = (AGSPoint *)[engine projectGeometry:self
toSpatialReference:[AGSSpatialReference wgs84SpatialReference]];
return [[CLLocation alloc] initWithLatitude:locationPoint.y
longitude:locationPoint.x];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment