[ios, macos] fixes #7059: raise exception for abstract sources on add (#7060)

This commit is contained in:
Justin R. Miller
2016-11-14 16:02:16 -08:00
parent 07b311d490
commit eefda0d381

View File

@@ -204,6 +204,13 @@ static NSURL *MGLStyleURL_emerald;
- (void)addSource:(MGLSource *)source
{
if (!source.rawSource) {
[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.",
source];
}
[source addToMapView:self.mapView];
}