From d44450ac7beba2ec517ffec7c6dd191de7cc0df5 Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Thu, 28 May 2015 15:51:50 -0700 Subject: [PATCH 01/20] #1659 - Adding tile stream certificate and ssl pin check for test server. --- platform/ios/MGLMapboxEvents.m | 23 ++++++++++++++++++ .../ios/resources/star_tilestream_net.der | Bin 0 -> 1338 bytes 2 files changed, 23 insertions(+) create mode 100644 platform/ios/resources/star_tilestream_net.der diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index e7f400c5d..3211a6039 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -16,6 +16,7 @@ static const NSUInteger version = 1; static NSString *const MGLMapboxEventsUserAgent = @"MapboxEventsiOS/1.0"; static NSString *MGLMapboxEventsAPIBase = @"https://api.tiles.mapbox.com"; +static BOOL usingTestServer = NO; NSString *const MGLEventTypeAppUserTurnstile = @"appUserTurnstile"; NSString *const MGLEventTypeMapLoad = @"map.load"; @@ -148,6 +149,7 @@ const NSTimeInterval MGLFlushInterval = 60; @property (atomic) NSURLSession *session; @property (atomic) NSData *digicertCert; @property (atomic) NSData *geoTrustCert; +@property (atomic) NSData *testServerCert; // Main thread only @property (nonatomic) CLLocationManager *locationManager; @@ -239,6 +241,7 @@ const NSTimeInterval MGLFlushInterval = 60; NSString *testURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLMetricsTestServerURL"]; if (testURL != nil) { MGLMapboxEventsAPIBase = testURL; + usingTestServer = YES; } _paused = YES; @@ -256,6 +259,10 @@ const NSTimeInterval MGLFlushInterval = 60; if (cerPath != nil) { _digicertCert = [NSData dataWithContentsOfFile:cerPath]; } + cerPath = [resourceBundle pathForResource:@"star_tilestream_net" ofType:@"der"]; + if (cerPath != nil) { + _testServerCert = [NSData dataWithContentsOfFile:cerPath]; + } // Events Control _eventQueue = [[NSMutableArray alloc] init]; @@ -878,6 +885,22 @@ const NSTimeInterval MGLFlushInterval = 60; } } + if (!found && usingTestServer) { + // See if this is test server + for (int lc = 0; lc < numKeys; lc++) { + SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, lc); + NSData *remoteCertificateData = CFBridgingRelease(SecCertificateCopyData(certificate)); + + // Compare Remote Key With Local Version + if ([remoteCertificateData isEqualToData:_testServerCert]) { + // Found the certificate; continue connecting + completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); + found = true; + break; + } + } + } + if (!found) { // The certificate wasn't found in GeoTrust nor Digicert. Cancel the connection. completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); diff --git a/platform/ios/resources/star_tilestream_net.der b/platform/ios/resources/star_tilestream_net.der new file mode 100644 index 0000000000000000000000000000000000000000..e302cd76867208934f6260647db191fc77ec434e GIT binary patch literal 1338 zcmXqLVl^{pVv$?G%*4pV#4K{3-GG;kQ>)FR?K>|cBP%O|fsG-z0Vf-CC<~h~Q)sZE zxPd5$!zIk;o|+$0R9al3qu`mBtY;`xPE$=8Ja1!RMEB-tw2nIj3zgcV5n1;mF*gFz?k*H!H!^ zYsuyptE1O9$L;9)Z)CBo^laCAHxn0Cm0RHlkH$P+sTn+_OF>|Ffx9>v))%bN zO!(c$o7VH_TK(m)btk^@@IL?lcPmTn%)W$sH9qrX_>Mfe#YcQ$tjQ{&4LuIrNHo@>5I6 zJS%pq4_bngay%^AC#7*}GchwVFfMLl+zkwo?FRC|V3bv6kuVTz5XsK8&605Py4%l` zYWdexrLAJ3n1KNwNC7`1<9`+wW+v7J2C^W&DvOwb2pfks8!$z(Gc&?jOa|H@X+ahh z1EnU6sA=Luiz;W3VtE!D11kfI1!fCO+Ke(vN(!v>^0iH3Z^g3A(ELnA)sOEYzXWTpi(m7lFzS!1 zd#V5YWVxKmstOyS8dBjxwn%7!EqiXl`pp9$ek|fRuo?U3+sM?txel9w4#jBfY zORwH~nVah8yW`N=(wY7DJ-;wsJk4cAmSp4p^uA675eYp(mak3qMP5;^p0EEK zYQ|qzKdt+_eD31C&37D1Wv@#ytjL{e$#z6n-#^3S$7#Q-qSIf;9C1AEdHHeBvW|F{ zZCAH$WZktO)JI)n&6??_A5ODZRXHJ|X6?;dl~tuzsl&m=Z+cZ`i}^E!UEDbUCUndK literal 0 HcmV?d00001 From 10990475b9a72ba07f36058e8d3c04e42e1f5c70 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Thu, 21 May 2015 20:46:45 -0700 Subject: [PATCH 02/20] Adapt metrics tests to constant flush timer Disables three tests: - testTimerFiresFlush: passes but takes 60 seconds (full MGLFlushInterval) - testFlushPostsEvents: fails - testPostEventsNetworkRequest: fails --- test/ios/MetricsTests.m | 21 ++++++------------- .../xcschemes/Mapbox GL Tests.xcscheme | 9 ++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/ios/MetricsTests.m b/test/ios/MetricsTests.m index 758cf1f5b..7c71ee673 100644 --- a/test/ios/MetricsTests.m +++ b/test/ios/MetricsTests.m @@ -8,6 +8,9 @@ #import "MapboxGL.h" #import "OHHTTPStubs.h" +const NSUInteger MGLMaximumEventsPerFlush = 20; +const NSTimeInterval MGLFlushInterval = 60; + @interface MGLMapboxEvents (Testing) - (NSString *)appBundleId; @@ -18,9 +21,6 @@ - (NSMutableArray *)eventQueue; - (void)postEvents:(NSArray *)events; - (NSTimer *)timer; -- (NSUInteger)flushAt; -- (NSTimeInterval)flushAfter; -- (void)setFlushAfter:(NSTimeInterval)newFlushAfter; - (void)flush; - (void)startTimer; @@ -28,15 +28,12 @@ @interface MetricsTests : KIFTestCase -@property (nonatomic) NSTimeInterval defaultFlushAfter; - @end @implementation MetricsTests - (void)beforeAll { [tester acknowledgeSystemAlert]; - self.defaultFlushAfter = [[MGLMapboxEvents sharedManager] flushAfter]; } - (void)beforeEach { @@ -44,8 +41,6 @@ [MGLMapboxEvents resumeMetricsCollection]; [MGLAccountManager setAccessToken:@"pk.eyJ1IjoianVzdGluIiwiYSI6IlpDbUJLSUEifQ.4mG8vhelFMju6HpIY-Hi5A"]; - - [[MGLMapboxEvents sharedManager] setFlushAfter:self.defaultFlushAfter]; } - (void)afterEach { @@ -76,7 +71,6 @@ - (void)testFlushAtThreshold { NSUInteger startCount = [[[MGLMapboxEvents sharedManager] eventQueue] count]; - NSUInteger flushAt = [[MGLMapboxEvents sharedManager] flushAt]; XCTestExpectation *queueItemsExpectation = [self expectationWithDescription:@"queue should contain events"]; @@ -89,7 +83,7 @@ } }); - for (NSUInteger i = 0; i < (flushAt - startCount - 1); i++) { + for (NSUInteger i = 0; i < (MGLMaximumEventsPerFlush - startCount - 1); i++) { [self pushFakeEvent]; } @@ -146,8 +140,6 @@ [self waitForExpectationsWithTimeout:1.0 handler:nil]; - [[MGLMapboxEvents sharedManager] setFlushAfter:5]; - id eventsMock = [OCMockObject partialMockForObject:[MGLMapboxEvents sharedManager]]; [[[eventsMock expect] andForwardToRealObject] startTimer]; [self pushFakeEvent]; @@ -155,7 +147,7 @@ XCTAssertEqual([[[MGLMapboxEvents sharedManager] eventQueue] count], 1); XCTAssertNotNil([[MGLMapboxEvents sharedManager] timer]); - XCTAssertEqual([[MGLMapboxEvents sharedManager] flushAfter], [[[MGLMapboxEvents sharedManager] timer] timeInterval]); + XCTAssertEqual(MGLFlushInterval, [[[MGLMapboxEvents sharedManager] timer] timeInterval]); } - (void)testTimerFiresFlush { @@ -174,11 +166,10 @@ [self waitForExpectationsWithTimeout:1.0 handler:nil]; - [[MGLMapboxEvents sharedManager] setFlushAfter:5]; [self pushFakeEvent]; id eventsMock = [OCMockObject partialMockForObject:[MGLMapboxEvents sharedManager]]; [[eventsMock expect] flush]; - [eventsMock verifyWithDelay:[[MGLMapboxEvents sharedManager] flushAfter]]; + [eventsMock verifyWithDelay:MGLFlushInterval]; } - (void)testFlushPostsEvents { diff --git a/test/ios/ios-tests.xcodeproj/xcshareddata/xcschemes/Mapbox GL Tests.xcscheme b/test/ios/ios-tests.xcodeproj/xcshareddata/xcschemes/Mapbox GL Tests.xcscheme index 911f949fa..0008282f8 100644 --- a/test/ios/ios-tests.xcodeproj/xcshareddata/xcschemes/Mapbox GL Tests.xcscheme +++ b/test/ios/ios-tests.xcodeproj/xcshareddata/xcschemes/Mapbox GL Tests.xcscheme @@ -55,6 +55,15 @@ + + + + + + From 65aaf739569e3b3ea5d32f6bae26287f6b6935f7 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Fri, 29 May 2015 14:37:45 +1000 Subject: [PATCH 03/20] Update mason to use soft float on Android ARM --- .mason | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mason b/.mason index ace19da71..abdc13127 160000 --- a/.mason +++ b/.mason @@ -1 +1 @@ -Subproject commit ace19da711199cb0283c6243b435575fbec16a90 +Subproject commit abdc131273c3e50e42f245b1166c27de4c34c582 From 10fdc7be9c293155c9e6206d58859a03d8dc0107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 29 May 2015 09:15:48 -0700 Subject: [PATCH 04/20] Fixed ios-bench build `accessToken` parameter was removed in #1553. --- ios/benchmark/MBXBenchViewController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/benchmark/MBXBenchViewController.mm b/ios/benchmark/MBXBenchViewController.mm index dfd3b254a..8883ebff0 100644 --- a/ios/benchmark/MBXBenchViewController.mm +++ b/ios/benchmark/MBXBenchViewController.mm @@ -33,7 +33,7 @@ [super viewDidLoad]; NSURL* url = [[NSURL alloc] initWithString:@"asset://styles/mapbox-streets-v7.json"]; - self.mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds accessToken:nil styleURL:url]; + self.mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds styleURL:url]; self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.mapView.delegate = self; self.mapView.zoomEnabled = NO; From c1d42aa55791ca5dfcef9247cb03d7362a68dd8d Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 28 May 2015 16:50:03 -0700 Subject: [PATCH 05/20] Opt-in to Travis Xcode 6.3 beta http://blog.travis-ci.com/2015-05-26-xcode-63-beta-general-availability/ --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1ac66b386..e5b94a813 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,8 +25,10 @@ matrix: sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5' ] packages: [ 'gdb', 'clang-3.5', 'libstdc++-4.9-dev', 'libstdc++6', 'libllvm3.4', 'xutils-dev', 'libxxf86vm-dev', 'x11proto-xf86vidmode-dev', 'mesa-utils' ] - os: osx + osx_image: beta-xcode6.3 env: FLAVOR=osx BUILDTYPE=Debug - os: osx + osx_image: beta-xcode6.3 env: FLAVOR=ios BUILDTYPE=Release - os: linux env: FLAVOR=android ANDROID_ABI=arm-v7 BUILDTYPE=Release From 78ea889202f267f821668627053f20dd2a9ff16a Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 28 May 2015 17:52:39 -0700 Subject: [PATCH 06/20] Latest homebrew appledoc should be good --- README.md | 6 +++++- scripts/ios/install.sh | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 123c507c9..bfc7a23a3 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,11 @@ pod 'MapboxGL' #### Manually -1. Install [appledoc](http://appledoc.gentlebytes.com/appledoc/) for API docs generation. We recommend [`2.2v963`](https://github.com/tomaz/appledoc/releases/tag/v2.2-963), which currently isn't available in Homebrew. +1. Install [appledoc](http://appledoc.gentlebytes.com/appledoc/) (2.2v963 or later) for API docs generation. This is installable via homebrew: + ``` + brew install appledoc22 + brew link --force appledoc22 + ``` 1. Run `make ipackage`. The packaging script will produce the statically-linked `libMapboxGL.a`, `MapboxGL.bundle` for resources, a `Headers` folder, and a `Docs` folder with HTML API documentation. 1. Copy the contents of `build/ios/pkg/static` into your project. It should happen automatically, but ensure that: - `Headers` is in your *Header Search Paths* (`HEADER_SEARCH_PATHS`) build setting. diff --git a/scripts/ios/install.sh b/scripts/ios/install.sh index ffa714f36..e7af42755 100755 --- a/scripts/ios/install.sh +++ b/scripts/ios/install.sh @@ -15,4 +15,7 @@ brew install git mapbox_time "install_awscli" \ brew install awscli +mapbox_time "install_appledoc" \ +brew install appledoc22 && brew link --force appledoc22 + mkdir -p ${KIF_SCREENSHOTS} From d2f710564994e902cab400caffbd46a0cddb57c2 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 29 May 2015 10:57:03 -0700 Subject: [PATCH 07/20] Require appledoc v2.2-963 exactly --- README.md | 14 +++++++++----- scripts/ios/install.sh | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bfc7a23a3..5a37ff67e 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,15 @@ pod 'MapboxGL' #### Manually -1. Install [appledoc](http://appledoc.gentlebytes.com/appledoc/) (2.2v963 or later) for API docs generation. This is installable via homebrew: - ``` - brew install appledoc22 - brew link --force appledoc22 - ``` +1. Install [appledoc](http://appledoc.gentlebytes.com/appledoc/) 2.2v963 for API docs generation (only this exact version works). + + ``` + wget https://github.com/tomaz/appledoc/releases/download/v2.2-963/appledoc.zip + tar xvzf appledoc.zip + cp appledoc /usr/local/bin + cp -Rf Templates/ ~/.appledoc + ``` + 1. Run `make ipackage`. The packaging script will produce the statically-linked `libMapboxGL.a`, `MapboxGL.bundle` for resources, a `Headers` folder, and a `Docs` folder with HTML API documentation. 1. Copy the contents of `build/ios/pkg/static` into your project. It should happen automatically, but ensure that: - `Headers` is in your *Header Search Paths* (`HEADER_SEARCH_PATHS`) build setting. diff --git a/scripts/ios/install.sh b/scripts/ios/install.sh index e7af42755..da081254f 100755 --- a/scripts/ios/install.sh +++ b/scripts/ios/install.sh @@ -16,6 +16,9 @@ mapbox_time "install_awscli" \ brew install awscli mapbox_time "install_appledoc" \ -brew install appledoc22 && brew link --force appledoc22 +wget https://github.com/tomaz/appledoc/releases/download/v2.2-963/appledoc.zip && \ +tar xvzf appledoc.zip && \ +cp appledoc /usr/local/bin && \ +cp -Rf Templates/ ~/.appledoc mkdir -p ${KIF_SCREENSHOTS} From ebe1e2158cac8f6f6c8698722eac7008ded9203b Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Mon, 1 Jun 2015 15:05:01 -0500 Subject: [PATCH 08/20] #1659 - Converting usingTestServer to atomic property --- platform/ios/MGLMapboxEvents.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 3211a6039..6b3d33f04 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -16,7 +16,6 @@ static const NSUInteger version = 1; static NSString *const MGLMapboxEventsUserAgent = @"MapboxEventsiOS/1.0"; static NSString *MGLMapboxEventsAPIBase = @"https://api.tiles.mapbox.com"; -static BOOL usingTestServer = NO; NSString *const MGLEventTypeAppUserTurnstile = @"appUserTurnstile"; NSString *const MGLEventTypeMapLoad = @"map.load"; @@ -150,6 +149,7 @@ const NSTimeInterval MGLFlushInterval = 60; @property (atomic) NSData *digicertCert; @property (atomic) NSData *geoTrustCert; @property (atomic) NSData *testServerCert; +@property (atomic) BOOL usesTestServer; // Main thread only @property (nonatomic) CLLocationManager *locationManager; @@ -241,7 +241,10 @@ const NSTimeInterval MGLFlushInterval = 60; NSString *testURL = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLMetricsTestServerURL"]; if (testURL != nil) { MGLMapboxEventsAPIBase = testURL; - usingTestServer = YES; + _usesTestServer = YES; + } else { + // Explicitly Set For Clarity + _usesTestServer = NO; } _paused = YES; @@ -885,7 +888,7 @@ const NSTimeInterval MGLFlushInterval = 60; } } - if (!found && usingTestServer) { + if (!found && _usesTestServer) { // See if this is test server for (int lc = 0; lc < numKeys; lc++) { SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, lc); From 70acae79416fb0a9c7950196fc457651126fc8e3 Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Mon, 1 Jun 2015 15:06:32 -0500 Subject: [PATCH 09/20] #1659 - Converting true to YES, false to NO to match Objective C standards --- platform/ios/MGLMapboxEvents.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 6b3d33f04..bf730af94 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -858,7 +858,7 @@ const NSTimeInterval MGLFlushInterval = 60; // Look for a pinned certificate in the server's certificate chain long numKeys = SecTrustGetCertificateCount(serverTrust); - BOOL found = false; + BOOL found = NO; // Try GeoTrust Cert First for (int lc = 0; lc < numKeys; lc++) { SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, lc); @@ -868,7 +868,7 @@ const NSTimeInterval MGLFlushInterval = 60; if ([remoteCertificateData isEqualToData:_geoTrustCert]) { // Found the certificate; continue connecting completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); - found = true; + found = YES; break; } } @@ -883,7 +883,7 @@ const NSTimeInterval MGLFlushInterval = 60; if ([remoteCertificateData isEqualToData:_digicertCert]) { // Found the certificate; continue connecting completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); - found = true; + found = YES; break; } } @@ -898,7 +898,7 @@ const NSTimeInterval MGLFlushInterval = 60; if ([remoteCertificateData isEqualToData:_testServerCert]) { // Found the certificate; continue connecting completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); - found = true; + found = YES; break; } } From ec06bb7e3cb1858b2f79f8826a9f1e923fdbaf24 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 28 May 2015 13:50:47 -0700 Subject: [PATCH 10/20] Merge ResourceLoader into Style and move atlas ownership --- src/mbgl/map/map_context.cpp | 38 +----- src/mbgl/map/map_context.hpp | 14 +- src/mbgl/map/resource_loader.cpp | 160 ----------------------- src/mbgl/map/resource_loader.hpp | 91 ------------- src/mbgl/renderer/painter.cpp | 22 ++-- src/mbgl/renderer/painter.hpp | 8 +- src/mbgl/renderer/painter_fill.cpp | 6 +- src/mbgl/renderer/painter_line.cpp | 14 +- src/mbgl/renderer/painter_symbol.cpp | 10 +- src/mbgl/style/style.cpp | 187 +++++++++++++++++++++------ src/mbgl/style/style.hpp | 66 ++++++++-- test/miscellaneous/style_parser.cpp | 28 ++-- test/test.gypi | 1 - 13 files changed, 256 insertions(+), 389 deletions(-) delete mode 100644 src/mbgl/map/resource_loader.cpp delete mode 100644 src/mbgl/map/resource_loader.hpp diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index c8948097f..a834f5065 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -2,19 +2,12 @@ #include #include #include -#include #include #include #include -#include - -#include -#include -#include - #include #include @@ -34,10 +27,6 @@ MapContext::MapContext(uv_loop_t* loop, View& view_, FileSource& fileSource, Map envScope(env, ThreadType::Map, "Map"), updated(static_cast(Update::Nothing)), asyncUpdate(std::make_unique(loop, [this] { update(); })), - glyphStore(std::make_unique(loop, env)), - glyphAtlas(std::make_unique(1024, 1024)), - spriteAtlas(std::make_unique(512, 512)), - lineAtlas(std::make_unique(512, 512)), texturePool(std::make_unique()) { assert(Environment::currentlyOn(ThreadType::Map)); @@ -51,14 +40,9 @@ MapContext::~MapContext() { // Explicit resets currently necessary because these abandon resources that need to be // cleaned up by env.performCleanup(); - resourceLoader.reset(); style.reset(); painter.reset(); texturePool.reset(); - lineAtlas.reset(); - spriteAtlas.reset(); - glyphAtlas.reset(); - glyphStore.reset(); env.performCleanup(); @@ -116,21 +100,11 @@ void MapContext::setStyleJSON(const std::string& json, const std::string& base) void MapContext::loadStyleJSON(const std::string& json, const std::string& base) { assert(Environment::currentlyOn(ThreadType::Map)); - resourceLoader.reset(); style.reset(); - - style = std::make_unique