diff options
Diffstat (limited to 'platform/darwin/src/MGLOpenGLStyleLayer.mm')
-rw-r--r-- | platform/darwin/src/MGLOpenGLStyleLayer.mm | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/darwin/src/MGLOpenGLStyleLayer.mm index 745eacbf4e..5d81eb85ea 100644 --- a/platform/darwin/src/MGLOpenGLStyleLayer.mm +++ b/platform/darwin/src/MGLOpenGLStyleLayer.mm @@ -4,6 +4,7 @@ #import "MGLStyle_Private.h" #import "MGLStyleLayer_Private.h" +#include <mbgl/map/map.hpp> #include <mbgl/style/layers/custom_layer.hpp> #include <mbgl/math/wrap.hpp> @@ -52,10 +53,19 @@ void MGLFinishCustomStyleLayer(void *context) { } /** - An `MGLOpenGLStyleLayer` is a style layer that is rendered by OpenGL code in - Objective-C blocks or Swift closures that you specify. You may initialize a new - OpenGL style layer to add to an `MGLStyle` or obtain one from an `MGLMapView`’s - current style using the `-[MGLStyle layerWithIdentifier:]` method. + An `MGLOpenGLStyleLayer` is a style layer that is rendered by OpenGL code that + you provide. + + By default, this class does nothing. You can subclass this class to provide + custom OpenGL drawing code that is run on each frame of the map. Your subclass + should override the `-didMoveToMapView:`, `-willMoveFromMapView:`, and + `-drawInMapView:withContext:` methods. + + You can access an existing OpenGL style layer using the + `-[MGLStyle layerWithIdentifier:]` method if you know its identifier; + otherwise, find it using the `MGLStyle.layers` property. You can also create a + new OpenGL style layer and add it to the style using a method such as + `-[MGLStyle addLayer:]`. @warning This API is undocumented and therefore unsupported. It may change at any time without notice. |