summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLFeature_Private.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLFeature_Private.h')
-rw-r--r--platform/darwin/src/MGLFeature_Private.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/platform/darwin/src/MGLFeature_Private.h b/platform/darwin/src/MGLFeature_Private.h
index d4074b53ed..9fb1f91820 100644
--- a/platform/darwin/src/MGLFeature_Private.h
+++ b/platform/darwin/src/MGLFeature_Private.h
@@ -31,7 +31,7 @@ MGLShape* MGLShapeFromGeoJSON(const mapbox::geojson::geojson &geojson);
returns the feature object with converted `mbgl::FeatureIdentifier` and
`mbgl::PropertyMap` properties.
*/
-mbgl::Feature mbglFeature(mbgl::Feature feature, id identifier, NSDictionary *attributes);
+mbgl::Feature mbglFeature(mbgl::Feature feature, id identifier, NSDictionary * attributes);
/**
Returns an `NSDictionary` representation of an `MGLFeature`.
@@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_END
if (self = [super initWithCoder:decoder]) { \
NSSet<Class> *identifierClasses = [NSSet setWithArray:@[[NSString class], [NSNumber class]]]; \
identifier = [decoder decodeObjectOfClasses:identifierClasses forKey:@"identifier"]; \
- attributes = [decoder decodeObjectOfClass:[NSDictionary class] forKey:@"attributes"]; \
+ _attributes = [decoder decodeObjectOfClass:[NSDictionary class] forKey:@"attributes"]; \
} \
return self; \
}
@@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_END
- (void)encodeWithCoder:(NSCoder *)coder { \
[super encodeWithCoder:coder]; \
[coder encodeObject:identifier forKey:@"identifier"]; \
- [coder encodeObject:attributes forKey:@"attributes"]; \
+ [coder encodeObject:_attributes forKey:@"attributes"]; \
}
#define MGL_DEFINE_FEATURE_IS_EQUAL() \
@@ -67,3 +67,11 @@ NS_ASSUME_NONNULL_END
- (NSUInteger)hash { \
return [super hash] + [[self geoJSONDictionary] hash]; \
}
+
+#define MGL_DEFINE_FEATURE_ATTRIBUTES_GETTER() \
+ - (NSDictionary *) attributes { \
+ if (!_attributes) { \
+ return @{}; \
+ } \
+ return _attributes; \
+ }