Created
February 19, 2014 00:36
-
-
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
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
#import <ArcGIS/ArcGIS.h> | |
@interface AGSPoint (KDJCoreLocation) | |
// Return point as a Core Location CLLocation object | |
- (CLLocation *)kdj_location; | |
@end |
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
#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