diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.mm b/platform/darwin/src/MGLBackgroundStyleLayer.mm index 151d4cada..47b491fc6 100644 --- a/platform/darwin/src/MGLBackgroundStyleLayer.mm +++ b/platform/darwin/src/MGLBackgroundStyleLayer.mm @@ -5,7 +5,6 @@ #import "NSPredicate+MGLAdditions.h" #import "NSDate+MGLAdditions.h" #import "MGLStyleLayer_Private.h" -#import "MGLForegroundStyleLayer_Private.h" #import "MGLStyleValue_Private.h" #import "MGLBackgroundStyleLayer.h" diff --git a/platform/darwin/src/MGLCircleStyleLayer.mm b/platform/darwin/src/MGLCircleStyleLayer.mm index 0370f68bd..42961f2e1 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.mm +++ b/platform/darwin/src/MGLCircleStyleLayer.mm @@ -5,7 +5,6 @@ #import "NSPredicate+MGLAdditions.h" #import "NSDate+MGLAdditions.h" #import "MGLStyleLayer_Private.h" -#import "MGLForegroundStyleLayer_Private.h" #import "MGLStyleValue_Private.h" #import "MGLCircleStyleLayer.h" @@ -37,7 +36,7 @@ namespace mbgl { - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source { auto layer = std::make_unique(identifier.UTF8String, source.identifier.UTF8String); - return self = [super initWithPendingLayer:std::move(layer) source:source]; + return self = [super initWithPendingLayer:std::move(layer)]; } - (mbgl::style::CircleLayer *)rawLayer diff --git a/platform/darwin/src/MGLFillStyleLayer.mm b/platform/darwin/src/MGLFillStyleLayer.mm index 1abc36892..71b01a666 100644 --- a/platform/darwin/src/MGLFillStyleLayer.mm +++ b/platform/darwin/src/MGLFillStyleLayer.mm @@ -5,7 +5,6 @@ #import "NSPredicate+MGLAdditions.h" #import "NSDate+MGLAdditions.h" #import "MGLStyleLayer_Private.h" -#import "MGLForegroundStyleLayer_Private.h" #import "MGLStyleValue_Private.h" #import "MGLFillStyleLayer.h" @@ -32,7 +31,7 @@ namespace mbgl { - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source { auto layer = std::make_unique(identifier.UTF8String, source.identifier.UTF8String); - return self = [super initWithPendingLayer:std::move(layer) source:source]; + return self = [super initWithPendingLayer:std::move(layer)]; } - (mbgl::style::FillLayer *)rawLayer diff --git a/platform/darwin/src/MGLForegroundStyleLayer.mm b/platform/darwin/src/MGLForegroundStyleLayer.mm index 6926dfac1..6888f89b9 100644 --- a/platform/darwin/src/MGLForegroundStyleLayer.mm +++ b/platform/darwin/src/MGLForegroundStyleLayer.mm @@ -1,22 +1,11 @@ #import "MGLForegroundStyleLayer.h" -#import "MGLForegroundStyleLayer_Private.h" -#import "MGLStyleLayer_Private.h" -#import "MGLSource.h" @implementation MGLForegroundStyleLayer -- (instancetype)initWithRawLayer:(mbgl::style::Layer *)rawLayer source:(MGLSource *)source { - if (self = [super initWithRawLayer:rawLayer]) { - _sourceIdentifier = source.identifier; - } - return self; -} - -- (instancetype)initWithPendingLayer:(std::unique_ptr)pendingLayer source:(MGLSource *)source { - if (self = [super initWithPendingLayer:std::move(pendingLayer)]) { - _sourceIdentifier = source.identifier; - } - return self; +- (NSString *)sourceIdentifier { + [NSException raise:@"MGLAbstractClassException" + format:@"MGLForegroundStyleLayer is an abstract class"]; + return nil; } - (NSString *)description { diff --git a/platform/darwin/src/MGLForegroundStyleLayer_Private.h b/platform/darwin/src/MGLForegroundStyleLayer_Private.h deleted file mode 100644 index 8b8da6c78..000000000 --- a/platform/darwin/src/MGLForegroundStyleLayer_Private.h +++ /dev/null @@ -1,20 +0,0 @@ -#import "MGLForegroundStyleLayer.h" - -#include - -NS_ASSUME_NONNULL_BEGIN - -namespace mbgl { - namespace style { - class Layer; - } -} - -@interface MGLForegroundStyleLayer (Private) - -- (instancetype)initWithRawLayer:(mbgl::style::Layer *)rawLayer source:(MGLSource *)source; -- (instancetype)initWithPendingLayer:(std::unique_ptr)pendingLayer source:(MGLSource *)source; - -@end - -NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/MGLLineStyleLayer.mm b/platform/darwin/src/MGLLineStyleLayer.mm index b04b238fe..8b90efd0c 100644 --- a/platform/darwin/src/MGLLineStyleLayer.mm +++ b/platform/darwin/src/MGLLineStyleLayer.mm @@ -5,7 +5,6 @@ #import "NSPredicate+MGLAdditions.h" #import "NSDate+MGLAdditions.h" #import "MGLStyleLayer_Private.h" -#import "MGLForegroundStyleLayer_Private.h" #import "MGLStyleValue_Private.h" #import "MGLLineStyleLayer.h" @@ -44,7 +43,7 @@ namespace mbgl { - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source { auto layer = std::make_unique(identifier.UTF8String, source.identifier.UTF8String); - return self = [super initWithPendingLayer:std::move(layer) source:source]; + return self = [super initWithPendingLayer:std::move(layer)]; } - (mbgl::style::LineLayer *)rawLayer diff --git a/platform/darwin/src/MGLRasterStyleLayer.mm b/platform/darwin/src/MGLRasterStyleLayer.mm index 8f5415629..c63fd2352 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.mm +++ b/platform/darwin/src/MGLRasterStyleLayer.mm @@ -5,7 +5,6 @@ #import "NSPredicate+MGLAdditions.h" #import "NSDate+MGLAdditions.h" #import "MGLStyleLayer_Private.h" -#import "MGLForegroundStyleLayer_Private.h" #import "MGLStyleValue_Private.h" #import "MGLRasterStyleLayer.h" @@ -23,7 +22,7 @@ - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source { auto layer = std::make_unique(identifier.UTF8String, source.identifier.UTF8String); - return self = [super initWithPendingLayer:std::move(layer) source:source]; + return self = [super initWithPendingLayer:std::move(layer)]; } - (mbgl::style::RasterLayer *)rawLayer diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index b01d9aa51..091299382 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -12,7 +12,6 @@ #import "MGLStyle_Private.h" #import "MGLStyleLayer_Private.h" -#import "MGLForegroundStyleLayer_Private.h" #import "MGLSource_Private.h" #import "NSDate+MGLAdditions.h" @@ -332,20 +331,15 @@ static NSURL *MGLStyleURL_emerald; } if (auto fillLayer = rawLayer->as()) { - MGLSource *source = [self sourceWithIdentifier:@(fillLayer->getSourceID().c_str())]; - return [[MGLFillStyleLayer alloc] initWithRawLayer:fillLayer source:source]; + return [[MGLFillStyleLayer alloc] initWithRawLayer:fillLayer]; } else if (auto lineLayer = rawLayer->as()) { - MGLSource *source = [self sourceWithIdentifier:@(lineLayer->getSourceID().c_str())]; - return [[MGLLineStyleLayer alloc] initWithRawLayer:lineLayer source:source]; + return [[MGLLineStyleLayer alloc] initWithRawLayer:lineLayer]; } else if (auto symbolLayer = rawLayer->as()) { - MGLSource *source = [self sourceWithIdentifier:@(symbolLayer->getSourceID().c_str())]; - return [[MGLSymbolStyleLayer alloc] initWithRawLayer:symbolLayer source:source]; + return [[MGLSymbolStyleLayer alloc] initWithRawLayer:symbolLayer]; } else if (auto rasterLayer = rawLayer->as()) { - MGLSource *source = [self sourceWithIdentifier:@(rasterLayer->getSourceID().c_str())]; - return [[MGLRasterStyleLayer alloc] initWithRawLayer:rasterLayer source:source]; + return [[MGLRasterStyleLayer alloc] initWithRawLayer:rasterLayer]; } else if (auto circleLayer = rawLayer->as()) { - MGLSource *source = [self sourceWithIdentifier:@(circleLayer->getSourceID().c_str())]; - return [[MGLCircleStyleLayer alloc] initWithRawLayer:circleLayer source:source]; + return [[MGLCircleStyleLayer alloc] initWithRawLayer:circleLayer]; } else if (auto backgroundLayer = rawLayer->as()) { return [[MGLBackgroundStyleLayer alloc] initWithRawLayer:backgroundLayer]; } else if (auto customLayer = rawLayer->as()) { diff --git a/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/darwin/src/MGLStyleLayer.mm.ejs index 74b67be74..da67cbd63 100644 --- a/platform/darwin/src/MGLStyleLayer.mm.ejs +++ b/platform/darwin/src/MGLStyleLayer.mm.ejs @@ -11,7 +11,6 @@ #import "NSPredicate+MGLAdditions.h" #import "NSDate+MGLAdditions.h" #import "MGLStyleLayer_Private.h" -#import "MGLForegroundStyleLayer_Private.h" #import "MGLStyleValue_Private.h" #import "MGL<%- camelize(type) %>StyleLayer.h" @@ -67,7 +66,7 @@ namespace mbgl { - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source { auto layer = std::make_uniqueLayer>(identifier.UTF8String, source.identifier.UTF8String); - return self = [super initWithPendingLayer:std::move(layer) source:source]; + return self = [super initWithPendingLayer:std::move(layer)]; } <% } -%> diff --git a/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/darwin/src/MGLSymbolStyleLayer.mm index 502115651..5a8f8c608 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.mm +++ b/platform/darwin/src/MGLSymbolStyleLayer.mm @@ -5,7 +5,6 @@ #import "NSPredicate+MGLAdditions.h" #import "NSDate+MGLAdditions.h" #import "MGLStyleLayer_Private.h" -#import "MGLForegroundStyleLayer_Private.h" #import "MGLStyleValue_Private.h" #import "MGLSymbolStyleLayer.h" @@ -91,7 +90,7 @@ namespace mbgl { - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source { auto layer = std::make_unique(identifier.UTF8String, source.identifier.UTF8String); - return self = [super initWithPendingLayer:std::move(layer) source:source]; + return self = [super initWithPendingLayer:std::move(layer)]; } - (mbgl::style::SymbolLayer *)rawLayer diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index a9e69f836..a34b5c3ff 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -168,8 +168,6 @@ 40F887701D7A1E58008ECB67 /* MGLShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40F8876F1D7A1DB8008ECB67 /* MGLShapeSource_Private.h */; }; 40F887711D7A1E59008ECB67 /* MGLShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40F8876F1D7A1DB8008ECB67 /* MGLShapeSource_Private.h */; }; 40FDA76B1CCAAA6800442548 /* MBXAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 40FDA76A1CCAAA6800442548 /* MBXAnnotationView.m */; }; - 522ADA011E955C2F00096484 /* MGLForegroundStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 522ADA001E955C2300096484 /* MGLForegroundStyleLayer_Private.h */; }; - 522ADA021E955C3000096484 /* MGLForegroundStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 522ADA001E955C2300096484 /* MGLForegroundStyleLayer_Private.h */; }; 556660CA1E1BF3A900E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C91E1BF3A900E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 556660D81E1D085500E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D71E1D085500E2C41B /* MGLVersionNumber.m */; }; 556660DB1E1D8E8D00E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C91E1BF3A900E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -634,7 +632,6 @@ 40F8876F1D7A1DB8008ECB67 /* MGLShapeSource_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLShapeSource_Private.h; sourceTree = ""; }; 40FDA7691CCAAA6800442548 /* MBXAnnotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBXAnnotationView.h; sourceTree = ""; }; 40FDA76A1CCAAA6800442548 /* MBXAnnotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBXAnnotationView.m; sourceTree = ""; }; - 522ADA001E955C2300096484 /* MGLForegroundStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLForegroundStyleLayer_Private.h; sourceTree = ""; }; 554180411D2E97DE00012372 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 556660C91E1BF3A900E2C41B /* MGLFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLFoundation.h; sourceTree = ""; }; 556660D71E1D085500E2C41B /* MGLVersionNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLVersionNumber.m; path = ../../darwin/test/MGLVersionNumber.m; sourceTree = ""; }; @@ -979,7 +976,6 @@ 353933F01D3FB6BA003F57D7 /* Layers */ = { isa = PBXGroup; children = ( - 522ADA001E955C2300096484 /* MGLForegroundStyleLayer_Private.h */, 353933F41D3FB785003F57D7 /* MGLBackgroundStyleLayer.h */, 35136D381D42271A00C20EFD /* MGLBackgroundStyleLayer.mm */, 353933F11D3FB753003F57D7 /* MGLCircleStyleLayer.h */, @@ -1576,7 +1572,6 @@ 35E1A4D81D74336F007AA97F /* MGLValueEvaluator.h in Headers */, DA88482C1CBAFA6200AB86E3 /* NSBundle+MGLAdditions.h in Headers */, 357FE2DD1E02D2B20068B753 /* NSCoder+MGLAdditions.h in Headers */, - 522ADA011E955C2F00096484 /* MGLForegroundStyleLayer_Private.h in Headers */, 7E016D7E1D9E86BE00A29A21 /* MGLPolyline+MGLAdditions.h in Headers */, 35D13AB71D3D15E300AFB4E0 /* MGLStyleLayer.h in Headers */, DA88488E1CBB047F00AB86E3 /* reachability.h in Headers */, @@ -1717,7 +1712,6 @@ 353AFA151D65AB17005A69F4 /* NSDate+MGLAdditions.h in Headers */, 3510FFFA1D6DCC4700F413B2 /* NSCompoundPredicate+MGLAdditions.h in Headers */, DA72620C1DEEE3480043BB89 /* MGLOpenGLStyleLayer.h in Headers */, - 522ADA021E955C3000096484 /* MGLForegroundStyleLayer_Private.h in Headers */, 35CE61831D4165D9004F2359 /* UIColor+MGLAdditions.h in Headers */, DABFB8671CBE99E500D62B32 /* MGLPolygon.h in Headers */, 404C26E81D89C55D000AA13D /* MGLTileSource_Private.h in Headers */, diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index 5ccefffe8..a42619c9b 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -62,7 +62,6 @@ 40B77E451DB11BC9003DA2FE /* NSArray+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 40B77E431DB11BB0003DA2FE /* NSArray+MGLAdditions.h */; }; 40B77E461DB11BCD003DA2FE /* NSArray+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 40B77E421DB11BB0003DA2FE /* NSArray+MGLAdditions.mm */; }; 40E1601D1DF217D6005EA6D9 /* MGLStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */; }; - 5209CAB01E94996700BC3AD2 /* MGLForegroundStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 5209CAAF1E94996700BC3AD2 /* MGLForegroundStyleLayer_Private.h */; }; 52B5D17F1E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */; }; 52B5D1801E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */; }; 5548BE781D09E718005DDE81 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3451CC31D1200DB3429 /* libmbgl-core.a */; }; @@ -321,7 +320,6 @@ 40B77E431DB11BB0003DA2FE /* NSArray+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MGLAdditions.h"; sourceTree = ""; }; 40E1601A1DF216E6005EA6D9 /* MGLStyleLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayerTests.h; sourceTree = ""; }; 40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLStyleLayerTests.m; sourceTree = ""; }; - 5209CAAF1E94996700BC3AD2 /* MGLForegroundStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLForegroundStyleLayer_Private.h; sourceTree = ""; }; 52BECB091CC5A26F009CD791 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-loop-darwin.a"; path = "cmake/Debug/libmbgl-loop-darwin.a"; sourceTree = ""; }; 556660C51E1BEA0100E2C41B /* MGLFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLFoundation.h; sourceTree = ""; }; @@ -600,7 +598,6 @@ 35602BF81D3EA99F0050646F /* MGLFillStyleLayer.h */, 35602BF91D3EA99F0050646F /* MGLFillStyleLayer.mm */, 35602BFD1D3EA9B40050646F /* MGLForegroundStyleLayer.h */, - 5209CAAF1E94996700BC3AD2 /* MGLForegroundStyleLayer_Private.h */, 35602BFE1D3EA9B40050646F /* MGLForegroundStyleLayer.mm */, DA8F25891D51CA540010E6B5 /* MGLLineStyleLayer.h */, DA8F258A1D51CA540010E6B5 /* MGLLineStyleLayer.mm */, @@ -1100,7 +1097,6 @@ DAE6C3621CC31E0400DB3429 /* MGLOverlay.h in Headers */, DAE6C3651CC31E0400DB3429 /* MGLPolyline.h in Headers */, DAE6C39A1CC31E2A00DB3429 /* NSProcessInfo+MGLAdditions.h in Headers */, - 5209CAB01E94996700BC3AD2 /* MGLForegroundStyleLayer_Private.h in Headers */, DA8F258B1D51CA540010E6B5 /* MGLLineStyleLayer.h in Headers */, 35C6DF841E214C0400ACA483 /* MGLDistanceFormatter.h in Headers */, DA8F25B21D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h in Headers */,