From 9fac640bf35db408f56103b45f8ef7982204bfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Fri, 19 Aug 2016 13:56:46 -0700 Subject: [ios, macos] Key-value compliance for MGLStyle Replaced -[MGLMapView style] with a property. Keep the MGLStyle object around for the lifetime of the style. Bracket changes to layers in willChange and didChange calls. The built-in point annotation layer is added after the style is finished loading but before the map is finished loading. Cause a second wave of change notifications to go out, about both sources and layers. Issue change notifications for style layers when shape annotations are added or removed. --- platform/ios/src/MGLMapView.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'platform/ios/src/MGLMapView.h') diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index e467495a4a..e066387e25 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -117,6 +117,14 @@ IB_DESIGNABLE #pragma mark Configuring the Map’s Appearance +/** + The style currently displayed in the receiver. + + Unlike the `styleURL` property, this property is set to an object that allows + you to manipulate every aspect of the style locally. + */ +@property (nonatomic, readonly) MGLStyle *style; + /** URLs of the styles bundled with the library. @@ -134,6 +142,9 @@ IB_DESIGNABLE If you set this property to `nil`, the receiver will use the default style and this property will automatically be set to that style’s URL. + + If you want to modify the current style without replacing it outright, or if + you want to introspect individual style attributes, use the `style` property. */ @property (nonatomic, null_resettable) NSURL *styleURL; @@ -1077,10 +1088,6 @@ IB_DESIGNABLE */ - (void)removeOverlays:(NS_ARRAY_OF(id ) *)overlays; -#pragma mark - Runtime styling API - -- (MGLStyle *)style; - #pragma mark Accessing the Underlying Map Data /** -- cgit v1.2.1