fixes #5957: automatically call update() for iOS runtime style API

This commit is contained in:
Justin R. Miller
2016-08-15 13:47:25 -07:00
parent 31f15c6c62
commit 01b94de107
12 changed files with 120 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
#import "MGLBaseStyleLayer.h"
#import "MGLBaseStyleLayer_Private.hpp"
#import "MGLStyleLayer_Private.hpp"
#import "MGLMapView_Private.hpp"
@@ -16,7 +17,10 @@
- (void)update
{
self.mapView.mbglMap->update(mbgl::Update::RecalculateStyle | mbgl::Update::Classes);
// A style layer's map view can be nil when first created at runtime
// before being added to a map style. In these cases, just no-op since
// the addition of the layer will trigger a visual refresh.
if (self.mapView) self.mapView.mbglMap->update(mbgl::Update::RecalculateStyle | mbgl::Update::Classes);
}
- (void)setVisible:(BOOL)visible