Fix Custom Drawable Layer usage of private headers (#2039)
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
#import "Mapbox.h"
|
||||
|
||||
#import "MLNFoundation.h"
|
||||
#import "MLNStyleValue.h"
|
||||
#import "MLNStyleLayer.h"
|
||||
#import "MLNGeometry.h"
|
||||
|
||||
@interface ExampleCustomDrawableStyleLayer : MLNStyleLayer
|
||||
@interface ExampleCustomDrawableStyleLayer : MLNCustomDrawableStyleLayer
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier;
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#import "ExampleCustomDrawableStyleLayer.h"
|
||||
#import "MLNStyleLayer.h"
|
||||
|
||||
#import "MLNCustomDrawableStyleLayer_Private.h"
|
||||
#import "MLNStyle_Private.h"
|
||||
#import "MLNStyleLayer_Private.h"
|
||||
#import "MLNGeometry_Private.h"
|
||||
#import "MLNCustomDrawableStyleLayer.h"
|
||||
|
||||
#include <mbgl/layermanager/layer_factory.hpp>
|
||||
#include <mbgl/style/layer.hpp>
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "MLNFoundation.h"
|
||||
#import "MLNFoundation.h"
|
||||
#import "MLNStyleValue.h"
|
||||
#import "MLNStyleLayer.h"
|
||||
#import "MLNGeometry.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <mbgl/style/layer.hpp>
|
||||
#endif
|
||||
|
||||
@interface MLNCustomDrawableStyleLayer : MLNStyleLayer
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier;
|
||||
#ifdef __cplusplus
|
||||
- (instancetype)initWithPendingLayer:(std::unique_ptr<mbgl::style::Layer>)pendingLayer;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
@@ -14,18 +14,12 @@
|
||||
|
||||
@implementation MLNCustomDrawableStyleLayer
|
||||
|
||||
/// @note
|
||||
/// Inherit MLNCustomDrawableStyleLayer class and override initWithIdentifier method to create and attach a valid CustomDrawableLayerHost instance
|
||||
/// Example:
|
||||
/// - (instancetype)initWithIdentifier:(NSString *)identifier {
|
||||
/// auto layer = std::make_unique<mbgl::style::CustomDrawableLayer>(identifier.UTF8String,
|
||||
/// std::make_unique<ExampleCustomDrawableStyleLayerHost>(self));
|
||||
/// return self = [super initWithPendingLayer:std::move(layer)];
|
||||
/// }
|
||||
///
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier {
|
||||
auto layer = std::make_unique<mbgl::style::CustomDrawableLayer>(identifier.UTF8String, nullptr);
|
||||
return self = [super initWithPendingLayer:std::move(layer)];
|
||||
- (instancetype)initWithRawLayer:(mbgl::style::Layer *)rawLayer {
|
||||
return [super initWithRawLayer:rawLayer];
|
||||
}
|
||||
|
||||
- (instancetype)initWithPendingLayer:(std::unique_ptr<mbgl::style::Layer>)pendingLayer {
|
||||
return [super initWithPendingLayer:std::move(pendingLayer)];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user