summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLFillStyleLayer.mm
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-01-16 11:38:35 -0800
committerMinh Nguyễn <mxn@1ec5.org>2017-01-16 11:38:35 -0800
commit7ef2843e6a62116667be6a2c12de085951fdd5ea (patch)
tree40eca249e044e2706efd1193d617e6eb8e59d708 /platform/darwin/src/MGLFillStyleLayer.mm
parent76301b252cbc4bc3ae1fc84322bcbcdbd26cae8a (diff)
parent13b97dd0cebffe36b187bdb74923910def6bd87b (diff)
downloadqtlocation-mapboxgl-7ef2843e6a62116667be6a2c12de085951fdd5ea.tar.gz
Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.7
Diffstat (limited to 'platform/darwin/src/MGLFillStyleLayer.mm')
-rw-r--r--platform/darwin/src/MGLFillStyleLayer.mm67
1 files changed, 53 insertions, 14 deletions
diff --git a/platform/darwin/src/MGLFillStyleLayer.mm b/platform/darwin/src/MGLFillStyleLayer.mm
index 891ab85d0b..63a482ac2e 100644
--- a/platform/darwin/src/MGLFillStyleLayer.mm
+++ b/platform/darwin/src/MGLFillStyleLayer.mm
@@ -1,5 +1,5 @@
// This file is generated.
-// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
+// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
#import "MGLSource.h"
#import "MGLMapView_Private.h"
@@ -8,12 +8,14 @@
#import "MGLStyleValue_Private.h"
#import "MGLFillStyleLayer.h"
+#include <mbgl/map/map.hpp>
#include <mbgl/style/layers/fill_layer.hpp>
+
namespace mbgl {
- MBGL_DEFINE_ENUM(MGLFillTranslateAnchor, {
- { MGLFillTranslateAnchorMap, "map" },
- { MGLFillTranslateAnchorViewport, "viewport" },
+ MBGL_DEFINE_ENUM(MGLFillTranslationAnchor, {
+ { MGLFillTranslationAnchorMap, "map" },
+ { MGLFillTranslationAnchorViewport, "viewport" },
});
}
@@ -49,6 +51,13 @@ namespace mbgl {
super.rawLayer = rawLayer;
}
+- (NSString *)sourceIdentifier
+{
+ MGLAssertStyleLayerIsValid();
+
+ return @(self.rawLayer->getSourceID().c_str());
+}
+
- (NSString *)sourceLayerIdentifier
{
MGLAssertStyleLayerIsValid();
@@ -68,7 +77,7 @@ namespace mbgl {
{
MGLAssertStyleLayerIsValid();
- self.rawLayer->setFilter(predicate.mgl_filter);
+ self.rawLayer->setFilter(predicate ? predicate.mgl_filter : mbgl::style::NullFilter());
}
- (NSPredicate *)predicate
@@ -133,9 +142,11 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
-
- (void)setFillAntialias:(MGLStyleValue<NSNumber *> *)fillAntialias {
- NSAssert(NO, @"Use -setFillAntialiased: instead.");
+}
+
+- (MGLStyleValue<NSNumber *> *)fillAntialias {
+ return self.isFillAntialiased;
}
- (void)setFillColor:(MGLStyleValue<MGLColor *> *)fillColor {
@@ -194,33 +205,61 @@ namespace mbgl {
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
-- (void)setFillTranslate:(MGLStyleValue<NSValue *> *)fillTranslate {
+- (void)setFillTranslation:(MGLStyleValue<NSValue *> *)fillTranslation {
MGLAssertStyleLayerIsValid();
- auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(fillTranslate);
+ auto mbglValue = MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toPropertyValue(fillTranslation);
self.rawLayer->setFillTranslate(mbglValue);
}
-- (MGLStyleValue<NSValue *> *)fillTranslate {
+- (MGLStyleValue<NSValue *> *)fillTranslation {
MGLAssertStyleLayerIsValid();
auto propertyValue = self.rawLayer->getFillTranslate() ?: self.rawLayer->getDefaultFillTranslate();
return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
-- (void)setFillTranslateAnchor:(MGLStyleValue<NSValue *> *)fillTranslateAnchor {
+- (void)setFillTranslate:(MGLStyleValue<NSValue *> *)fillTranslate {
+}
+
+- (MGLStyleValue<NSValue *> *)fillTranslate {
+ return self.fillTranslation;
+}
+
+- (void)setFillTranslationAnchor:(MGLStyleValue<NSValue *> *)fillTranslationAnchor {
MGLAssertStyleLayerIsValid();
- auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLFillTranslateAnchor>().toEnumPropertyValue(fillTranslateAnchor);
+ auto mbglValue = MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLFillTranslationAnchor>().toEnumPropertyValue(fillTranslationAnchor);
self.rawLayer->setFillTranslateAnchor(mbglValue);
}
-- (MGLStyleValue<NSValue *> *)fillTranslateAnchor {
+- (MGLStyleValue<NSValue *> *)fillTranslationAnchor {
MGLAssertStyleLayerIsValid();
auto propertyValue = self.rawLayer->getFillTranslateAnchor() ?: self.rawLayer->getDefaultFillTranslateAnchor();
- return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLFillTranslateAnchor>().toEnumStyleValue(propertyValue);
+ return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLFillTranslationAnchor>().toEnumStyleValue(propertyValue);
+}
+
+- (void)setFillTranslateAnchor:(MGLStyleValue<NSValue *> *)fillTranslateAnchor {
+}
+
+- (MGLStyleValue<NSValue *> *)fillTranslateAnchor {
+ return self.fillTranslationAnchor;
}
@end
+
+@implementation NSValue (MGLFillStyleLayerAdditions)
+
++ (NSValue *)valueWithMGLFillTranslationAnchor:(MGLFillTranslationAnchor)fillTranslationAnchor {
+ return [NSValue value:&fillTranslationAnchor withObjCType:@encode(MGLFillTranslationAnchor)];
+}
+
+- (MGLFillTranslationAnchor)MGLFillTranslationAnchorValue {
+ MGLFillTranslationAnchor fillTranslationAnchor;
+ [self getValue:&fillTranslationAnchor];
+ return fillTranslationAnchor;
+}
+
+@end