diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-01-11 08:06:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-11 08:06:20 -0800 |
commit | 424c12499cab69b935779d306d7d47d19139116e (patch) | |
tree | 56c27e57288a5df08083ede6b54db7204b46a02c /platform/darwin/src/MGLCircleStyleLayer.h | |
parent | 581fb3849da8ce97e557bb3633b886fcc369f6cb (diff) | |
download | qtlocation-mapboxgl-424c12499cab69b935779d306d7d47d19139116e.tar.gz |
[ios, macos] Make MGLMapView.style property nullable (#7664)
* [ios, macos] Made MGLMapView.style property nullable
MGLMapView’s style property is now nullable (optional in Swift). The property is set to nil while the style loads and in the event that the style has failed to load.
* [ios, macos] Switch to delegate method
* [macos] Create MGLMapView programmatically for layer tests
When MGLMapView is created via a nib, -initWithCoder: is called, causing styleURL to be set to nil, in turn causing the default Streets style to be loaded, fooling MGLStyleLayerTests into thinking one-line has been loaded. Instead, create MGLMapView programmatically, passing the intended style URL into the initializer, preventing Streets from being loaded.
Diffstat (limited to 'platform/darwin/src/MGLCircleStyleLayer.h')
-rw-r--r-- | platform/darwin/src/MGLCircleStyleLayer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h index 186dfd23f6..1117077d59 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.h +++ b/platform/darwin/src/MGLCircleStyleLayer.h @@ -72,7 +72,7 @@ typedef NS_ENUM(NSUInteger, MGLCircleTranslationAnchor) { ]) layer.circleOpacity = MGLStyleValue(rawValue: 0.7) layer.predicate = NSPredicate(format: "%K == %@", "marital-status", "married") - mapView.style.addLayer(layer) + mapView.style?.addLayer(layer) ``` */ @interface MGLCircleStyleLayer : MGLVectorStyleLayer |