* [ios, macos] Replaced custom style layer API with MGLOpenGLStyleLayer Replaced the custom style layer API on MGLMapView with an equally unsupported MGLOpenGLStyleLayer API that nonetheless is consistent with the broader runtime styling API and is compatible with macOS. Fixed an unrecognized selector crash when wrapping a layer of unrecognized type coming from mbgl. * [macos] Added lime green layer demo to macosapp Reprised the demo removed from iosapp in #5091. * [ios, macos] Rationalized MGLOpenGLStyleLayer API MGLStyle now strongly references any MGLOpenGLStyleLayer object that’s added to it, in order to prevent pointers from going stale and make it easy for layer drawing code to get more information about the map view. Replaced the MGLOpenGLStyleLayer callback blocks with overridable instance methods. Added internal documentation for each method. Subclassed MGLOpenGLStyleLayer as LimeGreenStyleLayer inside macosapp. Consolidated -addToMapView: into -addToMapView:belowLayer: to ensure that MGLRedundantLayerException gets raised even if the layer is being inserted rather than added to the bottom of the stack. * [core] Clarified that rendering happens on the main thread * [ios, macos] Fixed removing and re-adding MGLOpenGLStyleLayer Don’t allow index-based layer removal to circumvent -removeFromMapView:, which MGLOpenGLStyleLayer relies on to synchronize the style’s array of MGLOpenGLStyleLayers. When obtaining an MGLOpenGLStyleLayer, get the instance already added to the style instead of creating a new one to wrap the underlying CustomLayer.
31 lines
1.0 KiB
Objective-C
31 lines
1.0 KiB
Objective-C
#import "MGLMapView.h"
|
|
|
|
#import <mbgl/mbgl.hpp>
|
|
|
|
@interface MGLMapView (Private)
|
|
|
|
/// True if the view or application is in a state where it is not expected to be
|
|
/// actively drawing.
|
|
@property (nonatomic, readonly, getter=isDormant) BOOL dormant;
|
|
|
|
// These properties exist because initially, both the latitude and longitude are
|
|
// NaN. You have to set both the latitude and longitude simultaneously. If you
|
|
// set the latitude but reuse the current longitude, and the current longitude
|
|
// happens to be NaN, there will be no change because the resulting coordinate
|
|
// pair is invalid.
|
|
|
|
/// Center latitude set independently of the center longitude in an inspectable.
|
|
@property (nonatomic) CLLocationDegrees pendingLatitude;
|
|
/// Center longitude set independently of the center latitude in an inspectable.
|
|
@property (nonatomic) CLLocationDegrees pendingLongitude;
|
|
|
|
/// Asynchronously render a frame of the map.
|
|
- (void)setNeedsGLDisplay;
|
|
|
|
/// Synchronously render a frame of the map.
|
|
- (void)renderSync;
|
|
|
|
- (mbgl::Map *)mbglMap;
|
|
|
|
@end
|