diff options
Diffstat (limited to 'platform/darwin/src/MGLStyleValue_Private.h')
-rw-r--r-- | platform/darwin/src/MGLStyleValue_Private.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyleValue_Private.h b/platform/darwin/src/MGLStyleValue_Private.h index 263b54d7e5..2155c657bd 100644 --- a/platform/darwin/src/MGLStyleValue_Private.h +++ b/platform/darwin/src/MGLStyleValue_Private.h @@ -3,11 +3,13 @@ #import "MGLStyleValue.h" #import "NSValue+MGLStyleAttributeAdditions.h" +#import "NSValue+MGLAdditions.h" #import "MGLTypes.h" #import "MGLConversion.h" #include <mbgl/style/conversion/data_driven_property_value.hpp> #include <mbgl/style/conversion.hpp> +#import <mbgl/style/types.hpp> #import <mbgl/util/enum.hpp> @@ -415,6 +417,12 @@ private: // Private utilities for converting from mgl to mbgl values mbglValue.push_back(mbglElement); } } + + void getMBGLValue(NSValue *rawValue, mbgl::style::Position &mbglValue) { + auto spherical = rawValue.mgl_lightPositionArrayValue; + mbgl::style::Position position(spherical); + mbglValue = position; + } // Enumerations template <typename MBGLEnum = MBGLType, @@ -473,6 +481,12 @@ private: // Private utilities for converting from mbgl to mgl values } return array; } + + static NSValue *toMGLRawStyleValue(const mbgl::style::Position &mbglStopValue) { + std::array<float, 3> spherical = mbglStopValue.getSpherical(); + MGLSphericalPosition position = MGLSphericalPositionMake(spherical[0], spherical[1], spherical[2]); + return [NSValue valueWithMGLSphericalPosition:position]; + } // Enumerations template <typename MBGLEnum = MBGLType, typename MGLEnum = ObjCEnum> |