This removes a previous implementation of geojson options that used a new type to transfer the data around. Added in its place is an options API that takes an NSDictionary that works similarly to NSAttributedString and many other Cocoa APIs that take options. The options parser now expects the developer to send values of the type noted in the documentation and it simply converts the NSNumber to the correct type (integer, double, or bool) for mbgl. However, an exception is raised if the value is not an NSNumber.
20 lines
412 B
Plaintext
20 lines
412 B
Plaintext
#import "MGLSource.h"
|
|
|
|
#include <mbgl/style/source.hpp>
|
|
|
|
@implementation MGLSource
|
|
|
|
- (instancetype)initWithSourceIdentifier:(NSString *)sourceIdentifier {
|
|
if (self = [super init]) {
|
|
_sourceIdentifier = sourceIdentifier;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (std::unique_ptr<mbgl::style::Source>)mbglSource {
|
|
[NSException raise:@"Subclasses must override this method" format:@""];
|
|
return nil;
|
|
}
|
|
|
|
@end
|