summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLStyleValue_Private.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLStyleValue_Private.h')
-rw-r--r--platform/darwin/src/MGLStyleValue_Private.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/platform/darwin/src/MGLStyleValue_Private.h b/platform/darwin/src/MGLStyleValue_Private.h
index 84d7ccccec..3bb8892d42 100644
--- a/platform/darwin/src/MGLStyleValue_Private.h
+++ b/platform/darwin/src/MGLStyleValue_Private.h
@@ -307,10 +307,8 @@ private: // Private utilities for converting from mbgl to mgl values
// Enumerations
template <typename MBGLEnum = MBGLType, typename MGLEnum = ObjCEnum>
- static NSValue *toMGLRawStyleValue(const MBGLEnum &value) {
- auto str = mbgl::Enum<MBGLEnum>::toString(value);
- MGLEnum mglType = *mbgl::Enum<MGLEnum>::toEnum(str);
- return [NSValue value:&mglType withObjCType:@encode(MGLEnum)];
+ static NSString *toMGLRawStyleValue(const MBGLEnum &value) {
+ return @(mbgl::Enum<MBGLEnum>::toString(value));
}
/// Converts all types of mbgl property values into an equivalent NSExpression.
@@ -327,7 +325,7 @@ private: // Private utilities for converting from mbgl to mgl values
*/
template <typename MBGLEnum = MBGLType,
class = typename std::enable_if<!std::is_enum<MBGLEnum>::value>::type,
- typename MGLEnum = ObjCEnum,
+ typename MGLEnum = ObjCType,
class = typename std::enable_if<!std::is_enum<MGLEnum>::value>::type>
NSExpression *operator()(const MBGLType &value) const {
id constantValue = toMGLRawStyleValue(value);