summaryrefslogtreecommitdiff
path: root/platform/darwin/src
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-04-22 12:31:42 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-04-22 12:31:42 -0700
commit9c9ff2d2d4aeac9f605a6ca23447e54adea9f6bd (patch)
treed4dc35bc3f359901a84628b612f2014c455c7814 /platform/darwin/src
parent2a1a5f088564b2d6c2e3765d0d741edf1886fc81 (diff)
downloadqtlocation-mapboxgl-9c9ff2d2d4aeac9f605a6ca23447e54adea9f6bd.tar.gz
[ios, osx] Updated build system for jazzy
Consolidated NSValue categories to work around realm/jazzy#539. Documented MGLErrorCode. Moved jazzy configuration file into platform/ios/. Removed redundant include/Mapbox.h that was only being used by jazzy, now that the static frameworks’s umbrella header is based on that of the dynamic framework. Moved framework/Mapbox.h to include/Mapbox.h for consistency.
Diffstat (limited to 'platform/darwin/src')
-rw-r--r--platform/darwin/src/MGLCoordinateFormatter.m2
-rw-r--r--platform/darwin/src/MGLGeometry.mm35
-rw-r--r--platform/darwin/src/MGLOfflinePack.mm14
-rw-r--r--platform/darwin/src/MGLOfflineStorage.mm1
-rw-r--r--platform/darwin/src/NSValue+MGLAdditions.m49
5 files changed, 51 insertions, 50 deletions
diff --git a/platform/darwin/src/MGLCoordinateFormatter.m b/platform/darwin/src/MGLCoordinateFormatter.m
index 847b5dfe76..259917717f 100644
--- a/platform/darwin/src/MGLCoordinateFormatter.m
+++ b/platform/darwin/src/MGLCoordinateFormatter.m
@@ -1,6 +1,6 @@
#import "MGLCoordinateFormatter.h"
-#import "MGLGeometry.h"
+#import "NSValue+MGLAdditions.h"
@implementation MGLCoordinateFormatter {
NSNumberFormatter *_numberFormatter;
diff --git a/platform/darwin/src/MGLGeometry.mm b/platform/darwin/src/MGLGeometry.mm
index 9907f14252..70f00afd2f 100644
--- a/platform/darwin/src/MGLGeometry.mm
+++ b/platform/darwin/src/MGLGeometry.mm
@@ -44,38 +44,3 @@ double MGLZoomLevelForAltitude(CLLocationDistance altitude, CGFloat pitch, CLLoc
CGFloat mapPixelWidthAtZoom = std::cos(MGLRadiansFromDegrees(latitude)) * mbgl::util::M2PI * mbgl::util::EARTH_RADIUS_M / metersPerPixel;
return ::log2(mapPixelWidthAtZoom / mbgl::util::tileSize);
}
-
-@implementation NSValue (MGLGeometryAdditions)
-
-+ (instancetype)valueWithMGLCoordinate:(CLLocationCoordinate2D)coordinate {
- return [self valueWithBytes:&coordinate objCType:@encode(CLLocationCoordinate2D)];
-}
-
-- (CLLocationCoordinate2D)MGLCoordinateValue {
- CLLocationCoordinate2D coordinate;
- [self getValue:&coordinate];
- return coordinate;
-}
-
-+ (instancetype)valueWithMGLCoordinateSpan:(MGLCoordinateSpan)span {
- return [self valueWithBytes:&span objCType:@encode(MGLCoordinateSpan)];
-}
-
-- (MGLCoordinateSpan)MGLCoordinateSpanValue {
- MGLCoordinateSpan span;
- [self getValue:&span];
- return span;
-}
-
-+ (instancetype)valueWithMGLCoordinateBounds:(MGLCoordinateBounds)bounds {
- return [self valueWithBytes:&bounds objCType:@encode(MGLCoordinateBounds)];
-}
-
-- (MGLCoordinateBounds)MGLCoordinateBoundsValue {
- MGLCoordinateBounds bounds;
- [self getValue:&bounds];
- return bounds;
-}
-
-@end
-
diff --git a/platform/darwin/src/MGLOfflinePack.mm b/platform/darwin/src/MGLOfflinePack.mm
index 13032a6ec6..9c8396f728 100644
--- a/platform/darwin/src/MGLOfflinePack.mm
+++ b/platform/darwin/src/MGLOfflinePack.mm
@@ -202,17 +202,3 @@ void MBGLOfflineRegionObserver::mapboxTileCountLimitExceeded(uint64_t limit) {
[pack.delegate offlinePack:pack didReceiveMaximumAllowedMapboxTiles:limit];
});
}
-
-@implementation NSValue (MGLOfflinePackAdditions)
-
-+ (NSValue *)valueWithMGLOfflinePackProgress:(MGLOfflinePackProgress)progress {
- return [NSValue value:&progress withObjCType:@encode(MGLOfflinePackProgress)];
-}
-
-- (MGLOfflinePackProgress)MGLOfflinePackProgressValue {
- MGLOfflinePackProgress progress;
- [self getValue:&progress];
- return progress;
-}
-
-@end
diff --git a/platform/darwin/src/MGLOfflineStorage.mm b/platform/darwin/src/MGLOfflineStorage.mm
index 89bf050249..f09b03def1 100644
--- a/platform/darwin/src/MGLOfflineStorage.mm
+++ b/platform/darwin/src/MGLOfflineStorage.mm
@@ -5,6 +5,7 @@
#import "MGLOfflinePack_Private.h"
#import "MGLOfflineRegion_Private.h"
#import "MGLTilePyramidOfflineRegion.h"
+#import "NSValue+MGLAdditions.h"
#include <mbgl/util/string.hpp>
diff --git a/platform/darwin/src/NSValue+MGLAdditions.m b/platform/darwin/src/NSValue+MGLAdditions.m
new file mode 100644
index 0000000000..0d2128bea8
--- /dev/null
+++ b/platform/darwin/src/NSValue+MGLAdditions.m
@@ -0,0 +1,49 @@
+#import "NSValue+MGLAdditions.h"
+
+@implementation NSValue (MGLAdditions)
+
+#pragma mark Geometry
+
++ (instancetype)valueWithMGLCoordinate:(CLLocationCoordinate2D)coordinate {
+ return [self valueWithBytes:&coordinate objCType:@encode(CLLocationCoordinate2D)];
+}
+
+- (CLLocationCoordinate2D)MGLCoordinateValue {
+ CLLocationCoordinate2D coordinate;
+ [self getValue:&coordinate];
+ return coordinate;
+}
+
++ (instancetype)valueWithMGLCoordinateSpan:(MGLCoordinateSpan)span {
+ return [self valueWithBytes:&span objCType:@encode(MGLCoordinateSpan)];
+}
+
+- (MGLCoordinateSpan)MGLCoordinateSpanValue {
+ MGLCoordinateSpan span;
+ [self getValue:&span];
+ return span;
+}
+
++ (instancetype)valueWithMGLCoordinateBounds:(MGLCoordinateBounds)bounds {
+ return [self valueWithBytes:&bounds objCType:@encode(MGLCoordinateBounds)];
+}
+
+- (MGLCoordinateBounds)MGLCoordinateBoundsValue {
+ MGLCoordinateBounds bounds;
+ [self getValue:&bounds];
+ return bounds;
+}
+
+#pragma mark Offline maps
+
++ (NSValue *)valueWithMGLOfflinePackProgress:(MGLOfflinePackProgress)progress {
+ return [NSValue value:&progress withObjCType:@encode(MGLOfflinePackProgress)];
+}
+
+- (MGLOfflinePackProgress)MGLOfflinePackProgressValue {
+ MGLOfflinePackProgress progress;
+ [self getValue:&progress];
+ return progress;
+}
+
+@end