diff options
Diffstat (limited to 'platform/darwin/src/MGLSource.mm')
-rw-r--r-- | platform/darwin/src/MGLSource.mm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLSource.mm b/platform/darwin/src/MGLSource.mm index 4f9cfb014f..2fa580df89 100644 --- a/platform/darwin/src/MGLSource.mm +++ b/platform/darwin/src/MGLSource.mm @@ -2,6 +2,14 @@ #include <mbgl/style/source.hpp> +@interface MGLSource () + +// Even though this class is abstract, MGLStyle uses it to represent some +// special internal source types like mbgl::AnnotationSource. +@property (nonatomic) mbgl::style::Source *rawSource; + +@end + @implementation MGLSource - (instancetype)initWithIdentifier:(NSString *)identifier @@ -12,6 +20,20 @@ return self; } +- (void)addToMapView:(MGLMapView *)mapView { + [NSException raise:NSInvalidArgumentException format: + @"The source %@ cannot be added to the style. " + @"Make sure the source was created as a member of a concrete subclass of MGLSource.", + self]; +} + +- (void)removeFromMapView:(MGLMapView *)mapView { + [NSException raise:NSInvalidArgumentException format: + @"The source %@ cannot be removed from the style. " + @"Make sure the source was created as a member of a concrete subclass of MGLSource.", + self]; +} + - (NSString *)description { return [NSString stringWithFormat:@"<%@: %p; identifier = %@>", NSStringFromClass([self class]), (void *)self, self.identifier]; |