summaryrefslogtreecommitdiff
path: root/platform/darwin/src
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2017-05-24 12:20:58 -0400
committerFabian Guerra Soto <fabian.guerra@mapbox.com>2017-05-24 14:47:47 -0400
commite1431f9085153f7afb33ee169289ff46d38fe209 (patch)
treebab62b942fedd972d3e20f34b7f63497ec4c5945 /platform/darwin/src
parent8199315e9d554a002e950508d0b6e51f22f79d1c (diff)
downloadqtlocation-mapboxgl-e1431f9085153f7afb33ee169289ff46d38fe209.tar.gz
[ios, macos] Fix MGLLight.achor to accept style functions
Diffstat (limited to 'platform/darwin/src')
-rw-r--r--platform/darwin/src/MGLLight.h4
-rw-r--r--platform/darwin/src/MGLLight.mm8
2 files changed, 4 insertions, 8 deletions
diff --git a/platform/darwin/src/MGLLight.h b/platform/darwin/src/MGLLight.h
index d9a22d60fa..ef9811bd33 100644
--- a/platform/darwin/src/MGLLight.h
+++ b/platform/darwin/src/MGLLight.h
@@ -60,7 +60,7 @@ MGL_EXPORT
href="https://www.mapbox.com/mapbox-gl-js/style-spec/#light-anchor"><code>anchor</code></a>
light property in the Mapbox Style Specification.
*/
-@property (nonatomic) MGLLightAnchor anchor;
+@property (nonatomic) MGLStyleValue<NSValue *> *anchor;
/**
Values describing animated transitions to `anchor` property.
@@ -75,7 +75,7 @@ MGL_EXPORT
href="https://www.mapbox.com/mapbox-gl-js/style-spec/#light-position"><code>position</code></a>
light property in the Mapbox Style Specification.
*/
-@property (nonatomic) MGLStyleValue<NSValue *> * position;
+@property (nonatomic) MGLStyleValue<NSValue *> *position;
/**
Values describing animated transitions to `position` property.
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);