[ios, macos] handle duplicate source error

This commit is contained in:
Ivo van Dongen
2016-11-28 18:15:50 +02:00
committed by Ivo van Dongen
parent 379bf08723
commit d8cef78502
3 changed files with 33 additions and 1 deletions

View File

@@ -223,7 +223,11 @@ static NSURL *MGLStyleURL_emerald;
source];
}
[source addToMapView:self.mapView];
try {
[source addToMapView:self.mapView];
} catch (std::runtime_error & err) {
[NSException raise:@"Could not add source" format:@"%s", err.what()];
}
}
- (void)removeSource:(MGLSource *)source