summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorFredrik Karlsson <bjorn.fredrik.karlsson@gmail.com>2016-08-18 10:51:24 +0200
committerFredrik Karlsson <bjorn.fredrik.karlsson@gmail.com>2016-08-18 14:26:05 +0200
commita2029413605c5923a02c3f18b52b4d6b55fb3194 (patch)
tree9aac3441d47a6c7fcded0eef7255773e2a667fa3 /platform
parentf7069523b4b137eb6dfb965eca82d39b46841b15 (diff)
downloadqtlocation-mapboxgl-a2029413605c5923a02c3f18b52b4d6b55fb3194.tar.gz
[ios, macos] reuse utility function
Diffstat (limited to 'platform')
-rw-r--r--platform/darwin/src/MGLStyle.mm19
-rw-r--r--platform/darwin/src/NSDate+MGLAdditions.h11
-rw-r--r--platform/darwin/src/NSDate+MGLAdditions.mm10
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj12
-rw-r--r--platform/ios/src/MGLMapView.h28
-rw-r--r--platform/ios/src/MGLMapView.mm6
-rw-r--r--platform/ios/src/MGLMapView_Private.h3
-rw-r--r--platform/macos/macos.xcodeproj/project.pbxproj8
-rw-r--r--platform/macos/src/MGLMapView.mm6
-rw-r--r--platform/macos/src/MGLMapView_Private.h3
10 files changed, 57 insertions, 49 deletions
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm
index 8bc4018e73..7b6a36d834 100644
--- a/platform/darwin/src/MGLStyle.mm
+++ b/platform/darwin/src/MGLStyle.mm
@@ -13,6 +13,8 @@
#import "MGLStyleLayer_Private.h"
#import "MGLSource_Private.h"
+#import "NSDate+MGLAdditions.h"
+
#import "MGLSource.h"
#import "MGLVectorSource.h"
#import "MGLRasterSource.h"
@@ -125,11 +127,11 @@ static NSURL *MGLStyleURL_emerald;
- (Class)classFromSource:(mbgl::style::Source *)source
{
- if (dynamic_cast<mbgl::style::VectorSource *>(source)) {
+ if (source->is<mbgl::style::VectorSource>()) {
return MGLVectorSource.class;
- } else if (dynamic_cast<mbgl::style::GeoJSONSource *>(source)) {
+ } else if (source->is<mbgl::style::GeoJSONSource>()) {
return MGLGeoJSONSource.class;
- } else if (dynamic_cast<mbgl::style::RasterSource *>(source)) {
+ } else if (source->is<mbgl::style::RasterSource>()) {
return MGLRasterSource.class;
}
@@ -185,13 +187,12 @@ static NSURL *MGLStyleURL_emerald;
- (NS_ARRAY_OF(NSString *) *)styleClasses
{
- NSMutableArray *returnArray = [NSMutableArray array];
-
const std::vector<std::string> &appliedClasses = self.mapView.mbglMap->getClasses();
- for (auto class_it = appliedClasses.begin(); class_it != appliedClasses.end(); class_it++)
- {
- [returnArray addObject:@(class_it->c_str())];
+ NSMutableArray *returnArray = [NSMutableArray arrayWithCapacity:appliedClasses.size()];
+
+ for (auto appliedClass : appliedClasses) {
+ [returnArray addObject:@(appliedClass.c_str())];
}
return returnArray;
@@ -208,7 +209,7 @@ static NSURL *MGLStyleURL_emerald;
for (NSString *appliedClass in appliedClasses)
{
- newAppliedClasses.insert(newAppliedClasses.end(), [appliedClass UTF8String]);
+ newAppliedClasses.push_back([appliedClass UTF8String]);
}
mbgl::style::TransitionOptions transition { { MGLDurationInSeconds(transitionDuration) } };
diff --git a/platform/darwin/src/NSDate+MGLAdditions.h b/platform/darwin/src/NSDate+MGLAdditions.h
new file mode 100644
index 0000000000..a116ef32de
--- /dev/null
+++ b/platform/darwin/src/NSDate+MGLAdditions.h
@@ -0,0 +1,11 @@
+#import <Foundation/Foundation.h>
+
+#include <mbgl/mbgl.hpp>
+#include <mbgl/util/chrono.hpp>
+
+@interface NSDate (MGLAdditions)
+
+/// Converts from a duration in seconds to a duration object usable in mbgl.
+mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration);
+
+@end
diff --git a/platform/darwin/src/NSDate+MGLAdditions.mm b/platform/darwin/src/NSDate+MGLAdditions.mm
new file mode 100644
index 0000000000..75072ad7ff
--- /dev/null
+++ b/platform/darwin/src/NSDate+MGLAdditions.mm
@@ -0,0 +1,10 @@
+#import "NSDate+MGLAdditions.h"
+
+@implementation NSDate (MGLAdditions)
+
+mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
+{
+ return std::chrono::duration_cast<mbgl::Duration>(std::chrono::duration<NSTimeInterval>(duration));
+}
+
+@end
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index 3c750471a1..d3fc36732c 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -72,6 +72,10 @@
353933FC1D3FB7C0003F57D7 /* MGLRasterStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 353933FA1D3FB7C0003F57D7 /* MGLRasterStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
353933FE1D3FB7DD003F57D7 /* MGLSymbolStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 353933FD1D3FB7DD003F57D7 /* MGLSymbolStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
353933FF1D3FB7DD003F57D7 /* MGLSymbolStyleLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 353933FD1D3FB7DD003F57D7 /* MGLSymbolStyleLayer.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 353AFA141D65AB17005A69F4 /* NSDate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 353AFA121D65AB17005A69F4 /* NSDate+MGLAdditions.h */; };
+ 353AFA151D65AB17005A69F4 /* NSDate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 353AFA121D65AB17005A69F4 /* NSDate+MGLAdditions.h */; };
+ 353AFA161D65AB17005A69F4 /* NSDate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 353AFA131D65AB17005A69F4 /* NSDate+MGLAdditions.mm */; };
+ 353AFA171D65AB17005A69F4 /* NSDate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 353AFA131D65AB17005A69F4 /* NSDate+MGLAdditions.mm */; };
353BAEF61D646370009A8DA9 /* amsterdam.geojson in Resources */ = {isa = PBXBuildFile; fileRef = 353BAEF51D646370009A8DA9 /* amsterdam.geojson */; };
353BAEF71D646370009A8DA9 /* amsterdam.geojson in Resources */ = {isa = PBXBuildFile; fileRef = 353BAEF51D646370009A8DA9 /* amsterdam.geojson */; };
353D23961D0B0DFE002BE09D /* MGLAnnotationViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 353D23951D0B0DFE002BE09D /* MGLAnnotationViewTests.m */; };
@@ -488,6 +492,8 @@
353933F71D3FB79F003F57D7 /* MGLLineStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLineStyleLayer.h; sourceTree = "<group>"; };
353933FA1D3FB7C0003F57D7 /* MGLRasterStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterStyleLayer.h; sourceTree = "<group>"; };
353933FD1D3FB7DD003F57D7 /* MGLSymbolStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSymbolStyleLayer.h; sourceTree = "<group>"; };
+ 353AFA121D65AB17005A69F4 /* NSDate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+MGLAdditions.h"; sourceTree = "<group>"; };
+ 353AFA131D65AB17005A69F4 /* NSDate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSDate+MGLAdditions.mm"; sourceTree = "<group>"; };
353BAEF51D646370009A8DA9 /* amsterdam.geojson */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = amsterdam.geojson; path = ../../darwin/test/amsterdam.geojson; sourceTree = "<group>"; };
353D23951D0B0DFE002BE09D /* MGLAnnotationViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLAnnotationViewTests.m; sourceTree = "<group>"; };
354B83941D2E873E005D9406 /* MGLUserLocationAnnotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLUserLocationAnnotationView.h; sourceTree = "<group>"; };
@@ -1241,6 +1247,8 @@
DAD165831CF4CFED001FF4B9 /* Categories */ = {
isa = PBXGroup;
children = (
+ 353AFA121D65AB17005A69F4 /* NSDate+MGLAdditions.h */,
+ 353AFA131D65AB17005A69F4 /* NSDate+MGLAdditions.mm */,
DA8848121CBAFA6200AB86E3 /* NSBundle+MGLAdditions.h */,
DA8848131CBAFA6200AB86E3 /* NSBundle+MGLAdditions.m */,
35305D461D22AA450007D005 /* NSData+MGLAdditions.h */,
@@ -1325,6 +1333,7 @@
404326891D5B9B27007111BD /* MGLAnnotationContainerView_Private.h in Headers */,
DA88483B1CBAFB8500AB86E3 /* MGLCalloutView.h in Headers */,
35E0CFE61D3E501500188327 /* MGLStyle_Private.h in Headers */,
+ 353AFA141D65AB17005A69F4 /* NSDate+MGLAdditions.h in Headers */,
DAB4F8301D63DD7600E27738 /* MGLBaseStyleLayer_Private.h in Headers */,
3593E5261D529EDC006D9365 /* UIColor+MGLStyleAttributeAdditions_Private.h in Headers */,
35599DF01D46F3A60048254D /* MGLStyleAttributeValue.h in Headers */,
@@ -1438,6 +1447,7 @@
DABFB8691CBE99E500D62B32 /* MGLShape.h in Headers */,
350098CB1D482D9C004B2AF0 /* NSArray+MGLStyleAttributeAdditions.h in Headers */,
DABFB8701CBE9A0F00D62B32 /* MGLMapView+IBAdditions.h in Headers */,
+ 353AFA151D65AB17005A69F4 /* NSDate+MGLAdditions.h in Headers */,
350098D91D4830D5004B2AF0 /* NSString+MGLStyleAttributeAdditions_Private.h in Headers */,
35CE61831D4165D9004F2359 /* UIColor+MGLAdditions.h in Headers */,
350098B01D47E6F4004B2AF0 /* UIColor+MGLStyleAttributeAdditions.h in Headers */,
@@ -1849,6 +1859,7 @@
DA8848261CBAFA6200AB86E3 /* MGLPolygon.mm in Sources */,
DA8848521CBAFB9800AB86E3 /* MGLAPIClient.m in Sources */,
DA8848301CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m in Sources */,
+ 353AFA161D65AB17005A69F4 /* NSDate+MGLAdditions.mm in Sources */,
35D13AC51D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm in Sources */,
DA8848241CBAFA6200AB86E3 /* MGLOfflineStorage.mm in Sources */,
DA88482A1CBAFA6200AB86E3 /* MGLTilePyramidOfflineRegion.mm in Sources */,
@@ -1912,6 +1923,7 @@
DAA4E4341CBB730400178DFB /* MGLFaux3DUserLocationAnnotationView.m in Sources */,
DAA4E4311CBB730400178DFB /* MGLMapboxEvents.m in Sources */,
DAA4E4231CBB730400178DFB /* MGLPolygon.mm in Sources */,
+ 353AFA171D65AB17005A69F4 /* NSDate+MGLAdditions.mm in Sources */,
35D13AC61D3D19DD00AFB4E0 /* MGLFillStyleLayer.mm in Sources */,
DAA4E42A1CBB730400178DFB /* NSProcessInfo+MGLAdditions.m in Sources */,
DAA4E4211CBB730400178DFB /* MGLOfflineStorage.mm in Sources */,
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h
index a0511da273..db273ebcb6 100644
--- a/platform/ios/src/MGLMapView.h
+++ b/platform/ios/src/MGLMapView.h
@@ -209,33 +209,13 @@ IB_DESIGNABLE
*/
@property (nonatomic, readonly) UIButton *attributionButton;
-/**
- Currently active style classes, represented as an array of string identifiers.
- */
-@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses __attribute__((deprecated("Use -style.styleClasses:.")));
+@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses __attribute__((deprecated("Use style.styleClasses.")));
-/**
- Returns a Boolean value indicating whether the style class with the given
- identifier is currently active.
-
- @param styleClass The style class to query for.
- @return Whether the style class is currently active.
- */
-- (BOOL)hasStyleClass:(NSString *)styleClass __attribute__((deprecated("Use -style.hasStyleClass:.")));
+- (BOOL)hasStyleClass:(NSString *)styleClass __attribute__((deprecated("Use style.hasStyleClass:.")));
-/**
- Activates the style class with the given identifier.
-
- @param styleClass The style class to activate.
- */
-- (void)addStyleClass:(NSString *)styleClass __attribute__((deprecated("Use -style.addStyleClass:.")));
+- (void)addStyleClass:(NSString *)styleClass __attribute__((deprecated("Use style.addStyleClass:.")));
-/**
- Deactivates the style class with the given identifier.
-
- @param styleClass The style class to deactivate.
- */
-- (void)removeStyleClass:(NSString *)styleClass __attribute__((deprecated("Use -style.removeStyleClass:.")));
+- (void)removeStyleClass:(NSString *)styleClass __attribute__((deprecated("Use style.removeStyleClass:.")));
#pragma mark Displaying the User’s Location
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 671bbd7d12..d588f797cc 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -32,6 +32,7 @@
#import "MGLOfflineStorage_Private.h"
#import "NSBundle+MGLAdditions.h"
+#import "NSDate+MGLAdditions.h"
#import "NSString+MGLAdditions.h"
#import "NSProcessInfo+MGLAdditions.h"
#import "NSException+MGLAdditions.h"
@@ -293,11 +294,6 @@ public:
#pragma mark - Setup & Teardown -
-mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
-{
- return std::chrono::duration_cast<mbgl::Duration>(std::chrono::duration<NSTimeInterval>(duration));
-}
-
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame])
diff --git a/platform/ios/src/MGLMapView_Private.h b/platform/ios/src/MGLMapView_Private.h
index 25e68d5da8..5c74ba6dc8 100644
--- a/platform/ios/src/MGLMapView_Private.h
+++ b/platform/ios/src/MGLMapView_Private.h
@@ -15,9 +15,6 @@ extern const CGSize MGLAnnotationAccessibilityElementMinimumSize;
- (mbgl::Map *)mbglMap;
-/** Converts NSTimeInterval to mbgl::Duration */
-mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration);
-
/** Returns whether the map view is currently loading or processing any assets required to render the map */
- (BOOL)isFullyLoaded;
diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj
index 063a943ab2..9c80a6e9c9 100644
--- a/platform/macos/macos.xcodeproj/project.pbxproj
+++ b/platform/macos/macos.xcodeproj/project.pbxproj
@@ -36,6 +36,8 @@
3593E52A1D52A628006D9365 /* MGLStyleAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 3593E5281D52A628006D9365 /* MGLStyleAttribute.h */; };
3593E52B1D52A628006D9365 /* MGLStyleAttribute.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3593E5291D52A628006D9365 /* MGLStyleAttribute.mm */; };
3593E52D1D52A680006D9365 /* NSColor+MGLStyleAttributeAdditions_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3593E52C1D52A680006D9365 /* NSColor+MGLStyleAttributeAdditions_Private.h */; };
+ 35D65C5A1D65AD5500722C23 /* NSDate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35D65C581D65AD5500722C23 /* NSDate+MGLAdditions.h */; };
+ 35D65C5B1D65AD5500722C23 /* NSDate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35D65C591D65AD5500722C23 /* NSDate+MGLAdditions.mm */; };
52BECB0A1CC5A26F009CD791 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */; };
5548BE781D09E718005DDE81 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3451CC31D1200DB3429 /* libmbgl-core.a */; };
558F18221D0B13B100123F46 /* libmbgl-loop.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 558F18211D0B13B000123F46 /* libmbgl-loop.a */; };
@@ -233,6 +235,8 @@
3593E5281D52A628006D9365 /* MGLStyleAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleAttribute.h; sourceTree = "<group>"; };
3593E5291D52A628006D9365 /* MGLStyleAttribute.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLStyleAttribute.mm; sourceTree = "<group>"; };
3593E52C1D52A680006D9365 /* NSColor+MGLStyleAttributeAdditions_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSColor+MGLStyleAttributeAdditions_Private.h"; sourceTree = "<group>"; };
+ 35D65C581D65AD5500722C23 /* NSDate+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+MGLAdditions.h"; sourceTree = "<group>"; };
+ 35D65C591D65AD5500722C23 /* NSDate+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSDate+MGLAdditions.mm"; sourceTree = "<group>"; };
52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
5548BE791D0ACBB2005DDE81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop-darwin.a"; path = "cmake/Debug/libmbgl-loop-darwin.a"; sourceTree = "<group>"; };
5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop-darwin.a"; path = "cmake/Debug/libmbgl-loop-darwin.a"; sourceTree = "<group>"; };
@@ -688,6 +692,8 @@
children = (
DAE6C37D1CC31E2A00DB3429 /* NSBundle+MGLAdditions.h */,
DAE6C37E1CC31E2A00DB3429 /* NSBundle+MGLAdditions.m */,
+ 35D65C581D65AD5500722C23 /* NSDate+MGLAdditions.h */,
+ 35D65C591D65AD5500722C23 /* NSDate+MGLAdditions.mm */,
DAE6C37F1CC31E2A00DB3429 /* NSException+MGLAdditions.h */,
DAE6C3801CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h */,
DAE6C3811CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.m */,
@@ -881,6 +887,7 @@
DA8F259A1D51CAD00010E6B5 /* MGLSource_Private.h in Headers */,
DA8F25931D51CA750010E6B5 /* MGLSymbolStyleLayer.h in Headers */,
DAE6C3B91CC31EF300DB3429 /* MGLOpenGLLayer.h in Headers */,
+ 35D65C5A1D65AD5500722C23 /* NSDate+MGLAdditions.h in Headers */,
DAE6C3891CC31E2A00DB3429 /* MGLMultiPoint_Private.h in Headers */,
DAE6C3A51CC31E9400DB3429 /* MGLMapView+IBAdditions.h in Headers */,
DA35A2AD1CCA091800E826B2 /* MGLCompassDirectionFormatter.h in Headers */,
@@ -1074,6 +1081,7 @@
DA8F25AA1D51CB270010E6B5 /* NSNumber+MGLStyleAttributeAdditions.mm in Sources */,
DAE6C3B71CC31EF300DB3429 /* MGLMapView.mm in Sources */,
DAE6C38C1CC31E2A00DB3429 /* MGLOfflinePack.mm in Sources */,
+ 35D65C5B1D65AD5500722C23 /* NSDate+MGLAdditions.mm in Sources */,
DAE6C3B11CC31EF300DB3429 /* MGLAnnotationImage.m in Sources */,
DACC22151CF3D3E200D220D9 /* MGLFeature.mm in Sources */,
355BA4EE1D41633E00CCC6D5 /* NSColor+MGLAdditions.mm in Sources */,
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 9e90103550..74a5ed96d2 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -34,6 +34,7 @@
#import <unordered_set>
#import "NSBundle+MGLAdditions.h"
+#import "NSDate+MGLAdditions.h"
#import "NSProcessInfo+MGLAdditions.h"
#import "NSException+MGLAdditions.h"
#import "NSString+MGLAdditions.h"
@@ -110,11 +111,6 @@ NSImage *MGLDefaultMarkerImage() {
return [[NSImage alloc] initWithContentsOfFile:path];
}
-/// Converts from a duration in seconds to a duration object usable in mbgl.
-mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) {
- return std::chrono::duration_cast<mbgl::Duration>(std::chrono::duration<NSTimeInterval>(duration));
-}
-
/// Converts a media timing function into a unit bezier object usable in mbgl.
mbgl::util::UnitBezier MGLUnitBezierForMediaTimingFunction(CAMediaTimingFunction *function) {
if (!function) {
diff --git a/platform/macos/src/MGLMapView_Private.h b/platform/macos/src/MGLMapView_Private.h
index 01b1ba7702..2d9fc52a62 100644
--- a/platform/macos/src/MGLMapView_Private.h
+++ b/platform/macos/src/MGLMapView_Private.h
@@ -22,9 +22,6 @@
/// Synchronously render a frame of the map.
- (void)renderSync;
-/// Converts NSTimeInterval to mbgl::Duration
-mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration);
-
- (mbgl::Map *)mbglMap;
@end