summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLLight.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLLight.mm')
-rw-r--r--platform/darwin/src/MGLLight.mm8
1 files changed, 2 insertions, 6 deletions
diff --git a/platform/darwin/src/MGLLight.mm b/platform/darwin/src/MGLLight.mm
index 02d55e76ed..262fad3b07 100644
--- a/platform/darwin/src/MGLLight.mm
+++ b/platform/darwin/src/MGLLight.mm
@@ -48,9 +48,7 @@ NS_INLINE mbgl::style::TransitionOptions MGLOptionsFromTransition(MGLTransition
anchorStyleValue = MGLStyleValueTransformer<mbgl::style::LightAnchorType, NSValue *, mbgl::style::LightAnchorType, MGLLightAnchor>().toEnumStyleValue(anchor);
}
- NSAssert([anchorStyleValue isKindOfClass:[MGLConstantStyleValue class]], @"Anchor isn’t a constant.");
- NSValue *anchorValue = ((MGLConstantStyleValue *)anchorStyleValue).rawValue;
- _anchor = [anchorValue MGLLightAnchorValue];
+ _anchor = anchorStyleValue;
_anchorTransition = MGLTransitionFromOptions(mbglLight->getAnchorTransition());
@@ -89,11 +87,9 @@ NS_INLINE mbgl::style::TransitionOptions MGLOptionsFromTransition(MGLTransition
{
mbgl::style::Light mbglLight;
- MGLStyleValue<NSValue *> *anchorType = [MGLStyleValue<NSValue *> valueWithRawValue:[NSValue valueWithMGLLightAnchor:self.anchor]];
- auto anchor = MGLStyleValueTransformer<mbgl::style::LightAnchorType, NSValue *, mbgl::style::LightAnchorType, MGLLightAnchor>().toEnumPropertyValue(anchorType);
+ auto anchor = MGLStyleValueTransformer<mbgl::style::LightAnchorType, NSValue *, mbgl::style::LightAnchorType, MGLLightAnchor>().toEnumPropertyValue(self.anchor);
mbglLight.setAnchor(anchor);
-
mbglLight.setAnchorTransition(MGLOptionsFromTransition(self.anchorTransition));
auto position = MGLStyleValueTransformer<mbgl::style::Position, NSValue *>().toInterpolatablePropertyValue(self.position);