summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLOpenGLStyleLayer.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLOpenGLStyleLayer.mm')
-rw-r--r--platform/darwin/src/MGLOpenGLStyleLayer.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/darwin/src/MGLOpenGLStyleLayer.mm
index 678bf15bfc..945348cb03 100644
--- a/platform/darwin/src/MGLOpenGLStyleLayer.mm
+++ b/platform/darwin/src/MGLOpenGLStyleLayer.mm
@@ -107,6 +107,16 @@ private:
return (mbgl::style::CustomLayer *)super.rawLayer;
}
+#if TARGET_OS_IPHONE
+- (EAGLContext *)context {
+ return self.style.mapView.context;
+}
+#else
+- (CGLContextObj)context {
+ return self.style.mapView.context;
+}
+#endif
+
#pragma mark - Adding to and removing from a map view
- (void)addToStyle:(MGLStyle *)style belowLayer:(MGLStyleLayer *)otherLayer {
self.style = style;