Merge pull request #1077 from mapbox/fix-style-change-crash
don't stop/start map in relation to style changes anymore since safe
This commit is contained in:
@@ -192,17 +192,13 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([@(mbglMap->getStyleJSON().c_str()) length]) mbglMap->stop();
|
||||
mbglMap->setStyleJSON((std::string)[styleJSON cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
mbglMap->start();
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setStyleURL:(NSString *)filePathURL
|
||||
{
|
||||
if ([@(mbglMap->getStyleJSON().c_str()) length]) mbglMap->stop();
|
||||
mbglMap->setStyleURL(std::string("asset://") + [filePathURL UTF8String]);
|
||||
mbglMap->start();
|
||||
}
|
||||
|
||||
- (BOOL)commonInit
|
||||
@@ -370,6 +366,9 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr;
|
||||
_regionChangeDelegateQueue = [NSOperationQueue new];
|
||||
_regionChangeDelegateQueue.maxConcurrentOperationCount = 1;
|
||||
|
||||
// start the main loop
|
||||
mbglMap->start();
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user