diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2016-11-28 18:15:50 +0200 |
---|---|---|
committer | Jesse Bounds <jesse@rebounds.net> | 2016-12-02 11:39:16 -0800 |
commit | 37026a14ff12fcf2fbad02b95fc7847908ce31d5 (patch) | |
tree | c85fd5a2a8db5b39ddd6e3a4bd12144aa7f07022 /platform/darwin | |
parent | d44d1c8401f38982905bce3166eaad8431661263 (diff) | |
download | qtlocation-mapboxgl-37026a14ff12fcf2fbad02b95fc7847908ce31d5.tar.gz |
[ios, macos] handle duplicate source error
Diffstat (limited to 'platform/darwin')
-rw-r--r-- | platform/darwin/src/MGLStyle.mm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index e11ceb028b..a722c993a7 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -183,7 +183,12 @@ static NSURL *MGLStyleURL_emerald; @"Make sure the source was created as a member of a concrete subclass of MGLSource.", 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 |