Replace #pragma - mark with comments (#736)
Co-authored-by: Ovidiu Voda <ovi.voda@gmail.com>
This commit is contained in:
@@ -24,7 +24,7 @@ static MGLNativeNetworkManager *instance = nil;
|
||||
return sessionConfiguration;
|
||||
}
|
||||
|
||||
#pragma mark - Required
|
||||
// MARK: - Required
|
||||
|
||||
- (NSURLSessionConfiguration *)sessionConfiguration {
|
||||
NSURLSessionConfiguration *configuration = [_delegate sessionConfiguration];
|
||||
|
||||
@@ -86,7 +86,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
|
||||
@implementation MGLReachability
|
||||
|
||||
#pragma mark - Class Constructor Methods
|
||||
// MARK: - Class Constructor Methods
|
||||
|
||||
+(instancetype)reachabilityWithHostName:(NSString*)hostname
|
||||
{
|
||||
@@ -180,7 +180,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
_reachabilitySerialQueue = nil;
|
||||
}
|
||||
|
||||
#pragma mark - Notifier Methods
|
||||
// MARK: - Notifier Methods
|
||||
|
||||
// Notifier
|
||||
// NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD
|
||||
@@ -242,7 +242,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
self.reachabilityObject = nil;
|
||||
}
|
||||
|
||||
#pragma mark - reachability tests
|
||||
// MARK: - reachability tests
|
||||
|
||||
// This is for the case where you flick the airplane mode;
|
||||
// you end up getting something like this:
|
||||
@@ -384,7 +384,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - reachability status stuff
|
||||
// MARK: - reachability status stuff
|
||||
|
||||
-(NetworkStatus)currentReachabilityStatus
|
||||
{
|
||||
@@ -435,7 +435,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
return reachabilityFlags([self reachabilityFlags]);
|
||||
}
|
||||
|
||||
#pragma mark - Callback function calls this method
|
||||
// MARK: - Callback function calls this method
|
||||
|
||||
-(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags
|
||||
{
|
||||
@@ -461,7 +461,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark - Debug Description
|
||||
// MARK: - Debug Description
|
||||
|
||||
- (NSString *) description
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@protocol MGLAnnotation <NSObject>
|
||||
|
||||
#pragma mark Position Attributes
|
||||
// MARK: Position Attributes
|
||||
|
||||
/**
|
||||
The center point (specified as a map coordinate) of the annotation. (required)
|
||||
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@optional
|
||||
|
||||
#pragma mark Title Attributes
|
||||
// MARK: Title Attributes
|
||||
|
||||
/**
|
||||
The string containing the annotation’s title.
|
||||
|
||||
@@ -35,7 +35,7 @@ which it is added.
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier;
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
return (mbgl::style::BackgroundLayer *)super.rawLayer;
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
- (void)setBackgroundColor:(NSExpression *)backgroundColor {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -125,7 +125,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source;
|
||||
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
// MARK: - Accessing the Layout Attributes
|
||||
|
||||
/**
|
||||
Sorts features in ascending order based on this value. Features with a higher
|
||||
@@ -142,7 +142,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, null_resettable) NSExpression *circleSortKey;
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
/**
|
||||
Amount to blur the circle. 1 blurs the circle such that only the centerpoint is
|
||||
@@ -516,7 +516,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@interface NSValue (MGLCircleStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Circle Style Layer Attribute Values
|
||||
// MARK: Working with Circle Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLCirclePitchAlignment` enumeration.
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace mbgl {
|
||||
return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()];
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
// MARK: - Accessing the Layout Attributes
|
||||
|
||||
- (void)setCircleSortKey:(NSExpression *)circleSortKey {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
@@ -111,7 +111,7 @@ namespace mbgl {
|
||||
return MGLStyleValueTransformer<float, NSNumber *>().toExpression(propertyValue);
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
- (void)setCircleBlur:(NSExpression *)circleBlur {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -73,7 +73,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source;
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
/**
|
||||
The height with which to extrude the base of this layer. Must be less than or
|
||||
@@ -368,7 +368,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@interface NSValue (MGLFillExtrusionStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Fill extrusion Style Layer Attribute Values
|
||||
// MARK: Working with Fill extrusion Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLFillExtrusionTranslationAnchor` enumeration.
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace mbgl {
|
||||
return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()];
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
- (void)setFillExtrusionBase:(NSExpression *)fillExtrusionBase {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -76,7 +76,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source;
|
||||
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
// MARK: - Accessing the Layout Attributes
|
||||
|
||||
/**
|
||||
Sorts features in ascending order based on this value. Features with a higher
|
||||
@@ -93,7 +93,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, null_resettable) NSExpression *fillSortKey;
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
/**
|
||||
Whether or not the fill should be antialiased.
|
||||
@@ -368,7 +368,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@interface NSValue (MGLFillStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Fill Style Layer Attribute Values
|
||||
// MARK: Working with Fill Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLFillTranslationAnchor` enumeration.
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace mbgl {
|
||||
return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()];
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
// MARK: - Accessing the Layout Attributes
|
||||
|
||||
- (void)setFillSortKey:(NSExpression *)fillSortKey {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
@@ -101,7 +101,7 @@ namespace mbgl {
|
||||
return MGLStyleValueTransformer<float, NSNumber *>().toExpression(propertyValue);
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
- (void)setFillAntialiased:(NSExpression *)fillAntialiased {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -20,11 +20,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
MGL_EXPORT
|
||||
@interface MGLForegroundStyleLayer : MGLStyleLayer
|
||||
|
||||
#pragma mark Initializing a Style Layer
|
||||
// MARK: Initializing a Style Layer
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("Use -init methods of concrete subclasses instead.")));
|
||||
|
||||
#pragma mark Specifying a Style Layer’s Content
|
||||
// MARK: Specifying a Style Layer’s Content
|
||||
|
||||
/**
|
||||
Identifier of the source from which the receiver obtains the data to style.
|
||||
|
||||
@@ -75,7 +75,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source;
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
/**
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()];
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
- (void)setHeatmapColor:(NSExpression *)heatmapColor {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -73,7 +73,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source;
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@interface NSValue (MGLHillshadeStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Hillshade Style Layer Attribute Values
|
||||
// MARK: Working with Hillshade Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLHillshadeIlluminationAnchor` enumeration.
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace mbgl {
|
||||
return @(self.rawLayer->getSourceID().c_str());
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
- (void)setHillshadeAccentColor:(NSExpression *)hillshadeAccentColor {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -50,7 +50,7 @@ MGL_EXPORT
|
||||
MGL_EXPORT
|
||||
@interface MGLImageSource : MGLSource
|
||||
|
||||
#pragma mark Initializing a Source
|
||||
// MARK: Initializing a Source
|
||||
|
||||
/**
|
||||
Returns a georeferenced image source with an identifier, coordinates and a URL.
|
||||
@@ -73,7 +73,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MGLCoordinateQuad)coordinateQuad image:(MGLImage *)image;
|
||||
|
||||
#pragma mark Accessing a Source’s Content
|
||||
// MARK: Accessing a Source’s Content
|
||||
|
||||
/**
|
||||
The URL to the source image.
|
||||
|
||||
@@ -135,7 +135,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source;
|
||||
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
// MARK: - Accessing the Layout Attributes
|
||||
|
||||
/**
|
||||
The display of line endings.
|
||||
@@ -249,7 +249,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, null_resettable) NSExpression *lineSortKey;
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
/**
|
||||
Blur applied to the line, in points.
|
||||
@@ -645,7 +645,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@interface NSValue (MGLLineStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Line Style Layer Attribute Values
|
||||
// MARK: Working with Line Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLLineCap` enumeration.
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace mbgl {
|
||||
return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()];
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
// MARK: - Accessing the Layout Attributes
|
||||
|
||||
- (void)setLineCap:(NSExpression *)lineCap {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
@@ -185,7 +185,7 @@ namespace mbgl {
|
||||
return MGLStyleValueTransformer<float, NSNumber *>().toExpression(propertyValue);
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
- (void)setLineBlur:(NSExpression *)lineBlur {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@optional
|
||||
|
||||
#pragma mark Configuring Location Update Precision
|
||||
// MARK: Configuring Location Update Precision
|
||||
|
||||
/**
|
||||
Specifies the minimum distance (measured in meters) a device must move horizontally
|
||||
@@ -111,7 +111,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@property (nonatomic, weak) id<MGLLocationManagerDelegate> delegate;
|
||||
|
||||
#pragma mark Requesting Authorization for Location Services
|
||||
// MARK: Requesting Authorization for Location Services
|
||||
|
||||
/**
|
||||
Returns the current localization authorization status.
|
||||
@@ -131,7 +131,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)requestWhenInUseAuthorization;
|
||||
|
||||
#pragma mark Initiating Location Updates
|
||||
// MARK: Initiating Location Updates
|
||||
|
||||
/**
|
||||
Starts the generation of location updates that reports the user's current location.
|
||||
@@ -143,7 +143,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)stopUpdatingLocation;
|
||||
|
||||
#pragma mark Initiating Heading Updates
|
||||
// MARK: Initiating Heading Updates
|
||||
|
||||
/**
|
||||
Specifies a physical device orientation.
|
||||
@@ -174,7 +174,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@protocol MGLLocationManagerDelegate <NSObject>
|
||||
|
||||
#pragma mark Responding to Location Updates
|
||||
// MARK: Responding to Location Updates
|
||||
|
||||
/**
|
||||
Notifies the delegate with the new location data.
|
||||
@@ -188,7 +188,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)locationManager:(id<MGLLocationManager>)manager
|
||||
didUpdateLocations:(NSArray<CLLocation *> *)locations;
|
||||
|
||||
#pragma mark Responding to Heading Updates
|
||||
// MARK: Responding to Heading Updates
|
||||
|
||||
/**
|
||||
Notifies the delegate with the new heading data.
|
||||
@@ -206,7 +206,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (BOOL)locationManagerShouldDisplayHeadingCalibration:(id<MGLLocationManager>)manager;
|
||||
|
||||
#pragma mark Responding to Location Updates Errors
|
||||
// MARK: Responding to Location Updates Errors
|
||||
|
||||
/**
|
||||
Notifies the delegate that the location manager was unable to retrieve
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
self.delegate = nil;
|
||||
}
|
||||
|
||||
#pragma mark - CLLocationManagerDelegate
|
||||
// MARK: - CLLocationManagerDelegate
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations {
|
||||
if ([self.delegate respondsToSelector:@selector(locationManager:didUpdateLocations:)]) {
|
||||
|
||||
@@ -73,7 +73,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithStyleURL:(nullable NSURL *)styleURL camera:(MGLMapCamera *)camera size:(CGSize)size;
|
||||
|
||||
#pragma mark - Configuring the Map
|
||||
// MARK: - Configuring the Map
|
||||
|
||||
/**
|
||||
URL of the map style to snapshot.
|
||||
@@ -106,7 +106,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic) MGLCoordinateBounds coordinateBounds;
|
||||
|
||||
#pragma mark - Configuring the Image
|
||||
// MARK: - Configuring the Image
|
||||
|
||||
/**
|
||||
The size of the output image, measured in points.
|
||||
|
||||
@@ -64,7 +64,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace";
|
||||
return sessionConfiguration;
|
||||
}
|
||||
|
||||
#pragma mark - MGLNativeNetworkDelegate
|
||||
// MARK: - MGLNativeNetworkDelegate
|
||||
|
||||
- (NSURLSession *)sessionForNetworkManager:(MGLNativeNetworkManager *)networkManager {
|
||||
// Note: this method is NOT called on the main thread.
|
||||
@@ -129,7 +129,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace";
|
||||
MGLLogError(message);
|
||||
}
|
||||
|
||||
#pragma mark - Event management
|
||||
// MARK: - Event management
|
||||
|
||||
- (void)sendEventForURLResponse:(NSURLResponse *)response withAction:(NSString *)action
|
||||
{
|
||||
@@ -184,7 +184,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace";
|
||||
};
|
||||
}
|
||||
|
||||
#pragma mark - Events dictionary access
|
||||
// MARK: - Events dictionary access
|
||||
|
||||
- (nullable NSDictionary*)eventDictionaryForKey:(nonnull NSString*)key {
|
||||
__block NSDictionary *dictionary;
|
||||
|
||||
@@ -201,7 +201,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (class, nonatomic, readonly) MGLOfflineStorage *sharedOfflineStorage;
|
||||
|
||||
#pragma mark - Accessing the Delegate
|
||||
// MARK: - Accessing the Delegate
|
||||
|
||||
/**
|
||||
The receiver’s delegate.
|
||||
@@ -213,7 +213,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property(nonatomic, weak, nullable) IBOutlet id<MGLOfflineStorageDelegate> delegate;
|
||||
|
||||
#pragma mark - Managing the Database of Offline Packs
|
||||
// MARK: - Managing the Database of Offline Packs
|
||||
|
||||
/**
|
||||
The file path at which offline packs and the ambient cache are stored.
|
||||
@@ -267,7 +267,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (void)addContentsOfURL:(NSURL *)fileURL withCompletionHandler:(nullable MGLBatchedOfflinePackAdditionCompletionHandler)completion;
|
||||
|
||||
#pragma mark - Managing Offline Packs
|
||||
// MARK: - Managing Offline Packs
|
||||
|
||||
/**
|
||||
An array of all known offline packs, in the order in which they were created.
|
||||
@@ -385,7 +385,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, readonly) unsigned long long countOfBytesCompleted;
|
||||
|
||||
#pragma mark - Managing the Ambient Cache
|
||||
// MARK: - Managing the Ambient Cache
|
||||
|
||||
/**
|
||||
Sets the maximum ambient cache size in bytes. The default maximum cache
|
||||
|
||||
@@ -214,7 +214,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Database management methods
|
||||
// MARK: Database management methods
|
||||
|
||||
- (NSString *)databasePath {
|
||||
return self.databaseURL.path;
|
||||
@@ -404,7 +404,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark Pack management methods
|
||||
// MARK: Pack management methods
|
||||
|
||||
- (void)addPackForRegion:(id <MGLOfflineRegion>)region withContext:(NSData *)context completionHandler:(MGLOfflinePackAdditionCompletionHandler)completion {
|
||||
MGLLogDebug(@"Adding packForRegion: %@ contextLength: %lu completionHandler: %@", region, (unsigned long)context.length, completion);
|
||||
@@ -544,7 +544,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio
|
||||
_mbglDatabaseFileSource->setOfflineMapboxTileCountLimit(maximumCount);
|
||||
}
|
||||
|
||||
#pragma mark - Ambient cache management
|
||||
// MARK: - Ambient cache management
|
||||
|
||||
- (void)setMaximumAmbientCacheSize:(NSUInteger)cacheSize withCompletionHandler:(void (^)(NSError * _Nullable))completion {
|
||||
_mbglDatabaseFileSource->setMaximumAmbientCacheSize(cacheSize, [&, completion](std::exception_ptr exception) {
|
||||
@@ -610,7 +610,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio
|
||||
}
|
||||
});
|
||||
}
|
||||
#pragma mark -
|
||||
// MARK: -
|
||||
|
||||
- (unsigned long long)countOfBytesCompleted {
|
||||
NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:self.databasePath error:NULL];
|
||||
|
||||
@@ -85,7 +85,7 @@ class MGLOpenGLLayerHost;
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark - Adding to and removing from a map view
|
||||
// MARK: - Adding to and removing from a map view
|
||||
- (void)addToStyle:(MGLStyle *)style belowLayer:(MGLStyleLayer *)otherLayer {
|
||||
self.style = style;
|
||||
self.style.openGLLayers[self.identifier] = self;
|
||||
|
||||
@@ -84,7 +84,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source;
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
/**
|
||||
Increase or reduce the brightness of the image. The value is the maximum
|
||||
@@ -327,7 +327,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@interface NSValue (MGLRasterStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Raster Style Layer Attribute Values
|
||||
// MARK: Working with Raster Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLRasterResamplingMode` enumeration.
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace mbgl {
|
||||
return @(self.rawLayer->getSourceID().c_str());
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
- (void)setMaximumRasterBrightness:(NSExpression *)maximumRasterBrightness {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -61,7 +61,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionTileSi
|
||||
MGL_EXPORT
|
||||
@interface MGLRasterTileSource : MGLTileSource
|
||||
|
||||
#pragma mark Initializing a Source
|
||||
// MARK: Initializing a Source
|
||||
|
||||
/**
|
||||
Returns a raster tile source initialized with an identifier and configuration
|
||||
|
||||
@@ -86,7 +86,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
|
||||
@implementation MGLReachability
|
||||
|
||||
#pragma mark - Class Constructor Methods
|
||||
// MARK: - Class Constructor Methods
|
||||
|
||||
+(instancetype)reachabilityWithHostName:(NSString*)hostname
|
||||
{
|
||||
@@ -180,7 +180,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
_reachabilitySerialQueue = nil;
|
||||
}
|
||||
|
||||
#pragma mark - Notifier Methods
|
||||
// MARK: - Notifier Methods
|
||||
|
||||
// Notifier
|
||||
// NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD
|
||||
@@ -242,7 +242,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
self.reachabilityObject = nil;
|
||||
}
|
||||
|
||||
#pragma mark - reachability tests
|
||||
// MARK: - reachability tests
|
||||
|
||||
// This is for the case where you flick the airplane mode;
|
||||
// you end up getting something like this:
|
||||
@@ -384,7 +384,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - reachability status stuff
|
||||
// MARK: - reachability status stuff
|
||||
|
||||
-(NetworkStatus)currentReachabilityStatus
|
||||
{
|
||||
@@ -435,7 +435,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
return reachabilityFlags([self reachabilityFlags]);
|
||||
}
|
||||
|
||||
#pragma mark - Callback function calls this method
|
||||
// MARK: - Callback function calls this method
|
||||
|
||||
-(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags
|
||||
{
|
||||
@@ -461,7 +461,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark - Debug Description
|
||||
// MARK: - Debug Description
|
||||
|
||||
- (NSString *) description
|
||||
{
|
||||
|
||||
@@ -30,14 +30,14 @@ typedef NS_ENUM(NSUInteger, MGLWellKnownTileServer) {
|
||||
MGL_EXPORT
|
||||
@interface MGLSettings : NSObject
|
||||
|
||||
#pragma mark Tile Server Configuration
|
||||
// MARK: Tile Server Configuration
|
||||
|
||||
/**
|
||||
Tile server options
|
||||
*/
|
||||
@property (class, copy, nullable) MGLTileServerOptions* tileServerOptions;
|
||||
|
||||
#pragma mark Authorizing Access
|
||||
// MARK: Authorizing Access
|
||||
|
||||
/**
|
||||
The API Key used by all instances of `MGLMapView` in the current application.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
@implementation MGLSettings
|
||||
|
||||
#pragma mark - Internal
|
||||
// MARK: - Internal
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
|
||||
@@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
MGL_EXPORT
|
||||
@interface MGLShape : NSObject <MGLAnnotation, NSSecureCoding>
|
||||
|
||||
#pragma mark Creating a Shape
|
||||
// MARK: Creating a Shape
|
||||
|
||||
/**
|
||||
Returns an `MGLShape` object initialized with the given data interpreted as a
|
||||
@@ -69,7 +69,7 @@ MGL_EXPORT
|
||||
*/
|
||||
+ (nullable MGLShape *)shapeWithData:(NSData *)data encoding:(NSStringEncoding)encoding error:(NSError * _Nullable *)outError;
|
||||
|
||||
#pragma mark Accessing the Shape Attributes
|
||||
// MARK: Accessing the Shape Attributes
|
||||
|
||||
/**
|
||||
The title of the shape annotation.
|
||||
@@ -105,7 +105,7 @@ MGL_EXPORT
|
||||
|
||||
#endif
|
||||
|
||||
#pragma mark Creating GeoJSON Data
|
||||
// MARK: Creating GeoJSON Data
|
||||
|
||||
/**
|
||||
Returns the GeoJSON string representation of the shape encapsulated in a data
|
||||
|
||||
@@ -186,7 +186,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionLine
|
||||
MGL_EXPORT
|
||||
@interface MGLShapeSource : MGLSource
|
||||
|
||||
#pragma mark Initializing a Source
|
||||
// MARK: Initializing a Source
|
||||
|
||||
/**
|
||||
Returns a shape source with an identifier, URL, and dictionary of options for
|
||||
@@ -302,7 +302,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier shapes:(NSArray<MGLShape *> *)shapes options:(nullable NSDictionary<MGLShapeSourceOption, id> *)options;
|
||||
|
||||
#pragma mark Accessing a Source’s Content
|
||||
// MARK: Accessing a Source’s Content
|
||||
|
||||
/**
|
||||
The contents of the source. A shape can represent a GeoJSON geometry, a
|
||||
|
||||
@@ -250,7 +250,7 @@ mbgl::Immutable<mbgl::style::GeoJSONOptions> MGLGeoJSONOptionsFromDictionary(NSD
|
||||
return MGLFeaturesFromMBGLFeatures(features);
|
||||
}
|
||||
|
||||
#pragma mark - MGLCluster management
|
||||
// MARK: - MGLCluster management
|
||||
|
||||
- (mbgl::optional<mbgl::FeatureExtensionValue>)featureExtensionValueOfCluster:(MGLShape<MGLCluster> *)cluster extension:(std::string)extension options:(const std::map<std::string, mbgl::Value>)options {
|
||||
MGLAssertStyleSourceIsValid();
|
||||
|
||||
@@ -28,7 +28,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidStyleSourceExcepti
|
||||
MGL_EXPORT
|
||||
@interface MGLSource : NSObject
|
||||
|
||||
#pragma mark Initializing a Source
|
||||
// MARK: Initializing a Source
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("Use -initWithIdentifier: instead.")));
|
||||
|
||||
@@ -44,7 +44,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier;
|
||||
|
||||
#pragma mark Identifying a Source
|
||||
// MARK: Identifying a Source
|
||||
|
||||
/**
|
||||
A string that uniquely identifies the source in the style to which it is added.
|
||||
|
||||
@@ -44,7 +44,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLRedundantSourceIdentifier
|
||||
MGL_EXPORT
|
||||
@interface MGLStyle : NSObject
|
||||
|
||||
#pragma mark Accessing Default Styles
|
||||
// MARK: Accessing Default Styles
|
||||
|
||||
/**
|
||||
Returns list of predefined styles
|
||||
@@ -67,7 +67,7 @@ MGL_EXPORT
|
||||
*/
|
||||
+ (MGLDefaultStyle*) predefinedStyle:(NSString*)withStyleName;
|
||||
|
||||
#pragma mark Accessing Metadata About the Style
|
||||
// MARK: Accessing Metadata About the Style
|
||||
|
||||
/**
|
||||
The name of the style.
|
||||
@@ -76,7 +76,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (readonly, copy, nullable) NSString *name;
|
||||
|
||||
#pragma mark Managing Sources
|
||||
// MARK: Managing Sources
|
||||
|
||||
/**
|
||||
A set containing the style’s sources.
|
||||
@@ -165,7 +165,7 @@ MGL_EXPORT
|
||||
- (BOOL)removeSource:(MGLSource *)source error:(NSError * __nullable * __nullable)outError;
|
||||
|
||||
|
||||
#pragma mark Managing Style Layers
|
||||
// MARK: Managing Style Layers
|
||||
|
||||
/**
|
||||
The layers included in the style, arranged according to their back-to-front
|
||||
@@ -292,7 +292,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (void)removeLayer:(MGLStyleLayer *)layer;
|
||||
|
||||
#pragma mark Managing a Style’s Images
|
||||
// MARK: Managing a Style’s Images
|
||||
|
||||
/**
|
||||
Returns the image associated with the given name in the style.
|
||||
@@ -345,14 +345,14 @@ MGL_EXPORT
|
||||
- (void)removeImageForName:(NSString *)name;
|
||||
|
||||
|
||||
#pragma mark Managing the Style's Light
|
||||
// MARK: Managing the Style's Light
|
||||
|
||||
/**
|
||||
Provides global light source for the style.
|
||||
*/
|
||||
@property (nonatomic, strong) MGLLight *light;
|
||||
|
||||
#pragma mark Localizing Map Content
|
||||
// MARK: Localizing Map Content
|
||||
|
||||
/**
|
||||
Attempts to localize labels in the style into the given locale.
|
||||
|
||||
@@ -86,7 +86,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou
|
||||
|
||||
@implementation MGLStyle
|
||||
|
||||
#pragma mark Predefined style URLs
|
||||
// MARK: Predefined style URLs
|
||||
|
||||
+ (NSArray<MGLDefaultStyle*>*) predefinedStyles {
|
||||
return MGLSettings.tileServerOptions.defaultStyles;
|
||||
@@ -115,7 +115,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
// MARK: -
|
||||
|
||||
- (instancetype)initWithRawStyle:(mbgl::style::Style *)rawStyle stylable:(id <MGLStylable>)stylable {
|
||||
MGLLogInfo(@"Initializing %@ with stylable: %@", NSStringFromClass([self class]), stylable);
|
||||
@@ -138,7 +138,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou
|
||||
return name.empty() ? nil : @(name.c_str());
|
||||
}
|
||||
|
||||
#pragma mark Sources
|
||||
// MARK: Sources
|
||||
|
||||
- (NSSet<__kindof MGLSource *> *)sources {
|
||||
auto rawSources = self.rawStyle->getSources();
|
||||
@@ -263,7 +263,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou
|
||||
return infos;
|
||||
}
|
||||
|
||||
#pragma mark Style layers
|
||||
// MARK: Style layers
|
||||
|
||||
- (NSArray<__kindof MGLStyleLayer *> *)layers
|
||||
{
|
||||
@@ -489,7 +489,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou
|
||||
[self didChangeValueForKey:@"layers"];
|
||||
}
|
||||
|
||||
#pragma mark Style images
|
||||
// MARK: Style images
|
||||
|
||||
- (void)setImage:(MGLImage *)image forName:(NSString *)name
|
||||
{
|
||||
@@ -529,7 +529,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou
|
||||
return styleImage ? [[MGLImage alloc] initWithMGLStyleImage:*styleImage] : nil;
|
||||
}
|
||||
|
||||
#pragma mark Style transitions
|
||||
// MARK: Style transitions
|
||||
|
||||
- (void)setTransition:(MGLTransition)transition
|
||||
{
|
||||
@@ -556,7 +556,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou
|
||||
return transitionOptions.enablePlacementTransitions;
|
||||
}
|
||||
|
||||
#pragma mark Style light
|
||||
// MARK: Style light
|
||||
|
||||
- (void)setLight:(MGLLight *)light
|
||||
{
|
||||
@@ -579,7 +579,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou
|
||||
self.URL ? [NSString stringWithFormat:@"\"%@\"", self.URL] : self.URL];
|
||||
}
|
||||
|
||||
#pragma mark Mapbox Streets source introspection
|
||||
// MARK: Mapbox Streets source introspection
|
||||
|
||||
- (void)localizeLabelsIntoLocale:(nullable NSLocale *)locale {
|
||||
NSSet<MGLVectorTileSource *> *streetsSources =
|
||||
|
||||
@@ -27,11 +27,11 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidStyleLayerExceptio
|
||||
MGL_EXPORT
|
||||
@interface MGLStyleLayer : NSObject
|
||||
|
||||
#pragma mark Initializing a Style Layer
|
||||
// MARK: Initializing a Style Layer
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("Use -init methods of concrete subclasses instead.")));
|
||||
|
||||
#pragma mark Identifying a Style Layer
|
||||
// MARK: Identifying a Style Layer
|
||||
|
||||
/**
|
||||
A string that uniquely identifies the style layer in the style to which it is
|
||||
@@ -39,7 +39,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *identifier;
|
||||
|
||||
#pragma mark Configuring a Style Layer’s Visibility
|
||||
// MARK: Configuring a Style Layer’s Visibility
|
||||
|
||||
/**
|
||||
Whether this layer is displayed. A value of `NO` hides the layer.
|
||||
|
||||
@@ -119,7 +119,7 @@ which it is added.
|
||||
<% } -%>
|
||||
|
||||
<% if (layoutProperties.length) { -%>
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
// MARK: - Accessing the Layout Attributes
|
||||
|
||||
<% for (const property of layoutProperties) { -%>
|
||||
/**
|
||||
@@ -139,7 +139,7 @@ which it is added.
|
||||
<% } -%>
|
||||
<% } -%>
|
||||
<% if (paintProperties.length) { -%>
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
<% for (const property of paintProperties) { -%>
|
||||
/**
|
||||
@@ -176,7 +176,7 @@ which it is added.
|
||||
*/
|
||||
@interface NSValue (MGL<%- camelize(type) %>StyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with <%- camelize(unhyphenate(type)) %> Style Layer Attribute Values
|
||||
// MARK: Working with <%- camelize(unhyphenate(type)) %> Style Layer Attribute Values
|
||||
|
||||
<% for (let property of enumProperties) { -%>
|
||||
/**
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace mbgl {
|
||||
|
||||
<% }} -%>
|
||||
<% if (layoutProperties.length) { -%>
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
// MARK: - Accessing the Layout Attributes
|
||||
|
||||
<% for (const property of layoutProperties) { -%>
|
||||
- (void)set<%- camelize(property.name) %>:(NSExpression *)<%- objCName(property) %> {
|
||||
@@ -177,7 +177,7 @@ namespace mbgl {
|
||||
<% } -%>
|
||||
<% } -%>
|
||||
<% if (paintProperties.length) { -%>
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
<% for (const property of paintProperties) { -%>
|
||||
|
||||
- (void)set<%- camelize(property.name) %>:(NSExpression *)<%- objCName(property) %> {
|
||||
|
||||
@@ -432,7 +432,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source;
|
||||
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
// MARK: - Accessing the Layout Attributes
|
||||
|
||||
/**
|
||||
If true, the icon will be visible even if it collides with other previously
|
||||
@@ -1714,7 +1714,7 @@ MGL_EXPORT
|
||||
|
||||
@property (nonatomic, null_resettable) NSExpression *textWritingMode __attribute__((unavailable("Use textWritingModes instead.")));
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
/**
|
||||
@@ -2305,7 +2305,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@interface NSValue (MGLSymbolStyleLayerAdditions)
|
||||
|
||||
#pragma mark Working with Symbol Style Layer Attribute Values
|
||||
// MARK: Working with Symbol Style Layer Attribute Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLIconAnchor` enumeration.
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace mbgl {
|
||||
return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()];
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Layout Attributes
|
||||
// MARK: - Accessing the Layout Attributes
|
||||
|
||||
- (void)setIconAllowsOverlap:(NSExpression *)iconAllowsOverlap {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
@@ -1053,7 +1053,7 @@ namespace mbgl {
|
||||
return self.textWritingModes;
|
||||
}
|
||||
|
||||
#pragma mark - Accessing the Paint Attributes
|
||||
// MARK: - Accessing the Paint Attributes
|
||||
|
||||
- (void)setIconColor:(NSExpression *)iconColor {
|
||||
MGLAssertStyleLayerIsValid();
|
||||
|
||||
@@ -178,7 +178,7 @@ typedef NS_ENUM(NSUInteger, MGLDEMEncoding) {
|
||||
MGL_EXPORT
|
||||
@interface MGLTileSource : MGLSource
|
||||
|
||||
#pragma mark Accessing a Source’s Content
|
||||
// MARK: Accessing a Source’s Content
|
||||
|
||||
/**
|
||||
The URL to the TileJSON configuration file that specifies the contents of the
|
||||
@@ -189,7 +189,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, copy, nullable, readonly) NSURL *configurationURL;
|
||||
|
||||
#pragma mark Accessing Attribution Strings
|
||||
// MARK: Accessing Attribution Strings
|
||||
|
||||
/**
|
||||
An array of `MGLAttributionInfo` objects that define the attribution
|
||||
|
||||
@@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
MGL_EXPORT
|
||||
@interface MGLVectorStyleLayer : MGLForegroundStyleLayer
|
||||
|
||||
#pragma mark Refining a Style Layer’s Content
|
||||
// MARK: Refining a Style Layer’s Content
|
||||
|
||||
/**
|
||||
Identifier of the layer within the source identified by the `sourceIdentifier`
|
||||
|
||||
@@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
MGL_EXPORT
|
||||
@interface MGLVectorTileSource : MGLTileSource
|
||||
|
||||
#pragma mark Initializing a Source
|
||||
// MARK: Initializing a Source
|
||||
|
||||
/**
|
||||
Returns a vector tile source initialized with an identifier and configuration
|
||||
@@ -105,7 +105,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray<NSString *> *)tileURLTemplates options:(nullable NSDictionary<MGLTileSourceOption, id> *)options NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
#pragma mark Accessing a Source’s Content
|
||||
// MARK: Accessing a Source’s Content
|
||||
|
||||
/**
|
||||
Returns an array of map features loaded by this source, restricted to the given
|
||||
|
||||
@@ -47,7 +47,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI
|
||||
*/
|
||||
@interface NSExpression (MGLAdditions)
|
||||
|
||||
#pragma mark Creating Variable Expressions
|
||||
// MARK: Creating Variable Expressions
|
||||
|
||||
/**
|
||||
`NSExpression` variable that corresponds to the
|
||||
@@ -100,7 +100,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI
|
||||
|
||||
@property (class, nonatomic, readonly) NSExpression *featurePropertiesVariableExpression __attribute__((deprecated("", "featureAttributesVariableExpression")));
|
||||
|
||||
#pragma mark Creating Conditional Expressions
|
||||
// MARK: Creating Conditional Expressions
|
||||
|
||||
/**
|
||||
Returns a conditional function expression specifying the string predicate, and
|
||||
@@ -112,7 +112,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI
|
||||
*/
|
||||
+ (instancetype)mgl_expressionForConditional:(nonnull NSPredicate *)conditionPredicate trueExpression:(nonnull NSExpression *)trueExpression falseExpresssion:(nonnull NSExpression *)falseExpression NS_SWIFT_NAME(init(forMGLConditional:trueExpression:falseExpression:));
|
||||
|
||||
#pragma mark Creating Ramp, Scale, and Curve Expressions
|
||||
// MARK: Creating Ramp, Scale, and Curve Expressions
|
||||
|
||||
/**
|
||||
Returns a step function expression specifying the stepping, from expression
|
||||
@@ -167,7 +167,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI
|
||||
*/
|
||||
+ (instancetype)mgl_expressionForAttributedExpressions:(nonnull NSArray<NSExpression *> *)attributedExpressions NS_SWIFT_NAME(init(forAttributedExpressions:));
|
||||
|
||||
#pragma mark Concatenating String Expressions
|
||||
// MARK: Concatenating String Expressions
|
||||
|
||||
/**
|
||||
Returns a constant expression appending the passed expression.
|
||||
@@ -179,7 +179,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI
|
||||
*/
|
||||
- (instancetype)mgl_expressionByAppendingExpression:(nonnull NSExpression *)expression NS_SWIFT_NAME(mgl_appending(_:));
|
||||
|
||||
#pragma mark Converting JSON Expressions
|
||||
// MARK: Converting JSON Expressions
|
||||
|
||||
/**
|
||||
Returns an expression equivalent to the given Foundation object deserialized
|
||||
@@ -214,7 +214,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI
|
||||
*/
|
||||
@property (nonatomic, readonly) id mgl_jsonExpressionObject;
|
||||
|
||||
#pragma mark Localizing the Expression
|
||||
// MARK: Localizing the Expression
|
||||
|
||||
/**
|
||||
Returns a copy of the receiver localized into the given locale.
|
||||
|
||||
@@ -1515,7 +1515,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
|
||||
return expressionObject;
|
||||
}
|
||||
|
||||
#pragma mark Localization
|
||||
// MARK: Localization
|
||||
|
||||
/**
|
||||
Returns a localized copy of the given collection.
|
||||
|
||||
@@ -4,7 +4,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NSPredicate (MGLAdditions)
|
||||
|
||||
#pragma mark Converting JSON Expressions
|
||||
// MARK: Converting JSON Expressions
|
||||
|
||||
/**
|
||||
Returns a predicate equivalent to the given Foundation object deserialized
|
||||
|
||||
@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@interface NSValue (MGLAdditions)
|
||||
|
||||
#pragma mark Working with Geographic Coordinate Values
|
||||
// MARK: Working with Geographic Coordinate Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the specified Core Location geographic
|
||||
@@ -83,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (MGLCoordinateQuad)MGLCoordinateQuadValue;
|
||||
|
||||
#pragma mark Working with Offline Map Values
|
||||
// MARK: Working with Offline Map Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLOfflinePackProgress`
|
||||
@@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@property (readonly) MGLOfflinePackProgress MGLOfflinePackProgressValue;
|
||||
|
||||
#pragma mark Working with Transition Values
|
||||
// MARK: Working with Transition Values
|
||||
|
||||
/**
|
||||
Creates a new value object containing the given `MGLTransition`
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
@implementation NSValue (MGLAdditions)
|
||||
|
||||
#pragma mark Geometry
|
||||
// MARK: Geometry
|
||||
|
||||
+ (instancetype)valueWithMGLCoordinate:(CLLocationCoordinate2D)coordinate {
|
||||
return [self valueWithBytes:&coordinate objCType:@encode(CLLocationCoordinate2D)];
|
||||
@@ -54,7 +54,7 @@
|
||||
return quad;
|
||||
}
|
||||
|
||||
#pragma mark Offline maps
|
||||
// MARK: Offline maps
|
||||
|
||||
+ (NSValue *)valueWithMGLOfflinePackProgress:(MGLOfflinePackProgress)progress {
|
||||
return [NSValue value:&progress withObjCType:@encode(MGLOfflinePackProgress)];
|
||||
@@ -66,7 +66,7 @@
|
||||
return progress;
|
||||
}
|
||||
|
||||
#pragma mark Working with Transition Values
|
||||
// MARK: Working with Transition Values
|
||||
|
||||
+ (NSValue *)valueWithMGLTransition:(MGLTransition)transition {
|
||||
return [NSValue value:&transition withObjCType:@encode(MGLTransition)];
|
||||
|
||||
@@ -43,7 +43,7 @@ using namespace std::string_literals;
|
||||
|
||||
@implementation MGLExpressionTests
|
||||
|
||||
#pragma mark - Utility
|
||||
// MARK: - Utility
|
||||
|
||||
- (NSComparisonPredicate *)equalityComparisonPredicateWithRightConstantValue:(id)rightConstantValue
|
||||
{
|
||||
@@ -56,7 +56,7 @@ using namespace std::string_literals;
|
||||
return predicate;
|
||||
}
|
||||
|
||||
#pragma mark - Objective-C Example Code for MGL Expressions
|
||||
// MARK: - Objective-C Example Code for MGL Expressions
|
||||
|
||||
- (void)testSteppingExpression {
|
||||
//#-example-code
|
||||
@@ -131,7 +131,7 @@ using namespace std::string_literals;
|
||||
NSLog(@"%s %@", __FUNCTION__, functionExpression);
|
||||
}
|
||||
|
||||
#pragma mark - Valuation tests
|
||||
// MARK: - Valuation tests
|
||||
|
||||
- (void)testStringValuation {
|
||||
MGLAssertConstantEqualsValue(@"bar", "bar"s, @"NSString should convert to std::string.");
|
||||
@@ -208,7 +208,7 @@ using namespace std::string_literals;
|
||||
MGLAssertConstantEqualsValue([NSNull null], nullValue, @"NSNull should convert to mbgl::NullValue.");
|
||||
}
|
||||
|
||||
#pragma mark - Feature type tests
|
||||
// MARK: - Feature type tests
|
||||
|
||||
- (void)testFeatureType {
|
||||
XCTAssertEqual([NSExpression expressionForConstantValue:@"Point"].mgl_featureType, mbgl::FeatureType::Point);
|
||||
@@ -227,7 +227,7 @@ using namespace std::string_literals;
|
||||
XCTAssertEqual([NSExpression expressionForConstantValue:nil].mgl_featureType, mbgl::FeatureType::Unknown);
|
||||
}
|
||||
|
||||
#pragma mark - JSON expression object tests
|
||||
// MARK: - JSON expression object tests
|
||||
|
||||
- (void)testVariableExpressionObject {
|
||||
{
|
||||
@@ -1373,7 +1373,7 @@ using namespace std::string_literals;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Localization tests
|
||||
// MARK: - Localization tests
|
||||
|
||||
- (void)testLocalization {
|
||||
{
|
||||
@@ -1548,7 +1548,7 @@ using namespace std::string_literals;
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Objective-C Example Code for Expected Failures
|
||||
// MARK: - Objective-C Example Code for Expected Failures
|
||||
|
||||
- (void)testExpectPassObjC {
|
||||
XCTAssertNotNil(@1);
|
||||
|
||||
@@ -214,7 +214,7 @@ MGLImage *MGLImageFromCurrentContext(void) {
|
||||
self.runtimeStylingActions = nil;
|
||||
}
|
||||
|
||||
#pragma mark MGLMapSnapshotterDelegate methods
|
||||
// MARK: MGLMapSnapshotterDelegate methods
|
||||
|
||||
- (void)mapSnapshotter:(MGLMapSnapshotter *)snapshotter didFinishLoadingStyle:(MGLStyle *)style {
|
||||
XCTAssertNotNil(snapshotter);
|
||||
@@ -227,7 +227,7 @@ MGLImage *MGLImageFromCurrentContext(void) {
|
||||
[self.styleLoadingExpectation fulfill];
|
||||
}
|
||||
|
||||
#pragma mark MGLOfflineStorageDelegate methods
|
||||
// MARK: MGLOfflineStorageDelegate methods
|
||||
|
||||
- (NSURL *)offlineStorage:(MGLOfflineStorage *)storage URLForResourceOfKind:(MGLResourceKind)kind withURL:(NSURL *)url {
|
||||
if (kind == MGLResourceKindGlyphs && [url.scheme isEqualToString:@"local"]) {
|
||||
|
||||
@@ -353,7 +353,7 @@
|
||||
XCTAssertEqualObjects(layers[startIndex++].identifier, layer4.identifier);
|
||||
}
|
||||
|
||||
#pragma mark Localization tests
|
||||
// MARK: Localization tests
|
||||
|
||||
- (void)testLanguageMatching {
|
||||
{
|
||||
@@ -398,7 +398,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Transition tests
|
||||
// MARK: Transition tests
|
||||
|
||||
- (void)testTransition
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
@implementation MGLAnnotationViewIntegrationTests
|
||||
|
||||
#pragma mark - Offscreen/panning selection tests
|
||||
// MARK: - Offscreen/panning selection tests
|
||||
|
||||
typedef struct PanTestData {
|
||||
CGPoint relativeCoord;
|
||||
@@ -413,7 +413,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f };
|
||||
[self internalRunTests:tests];
|
||||
}
|
||||
|
||||
#pragma mark - Selection with an offset
|
||||
// MARK: - Selection with an offset
|
||||
|
||||
- (void)testSelectingAnnotationWithCenterOffset {
|
||||
|
||||
@@ -521,7 +521,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f };
|
||||
XCTAssertEqual(originalFrame.origin.y + offset.y, offsetFrame.origin.y);
|
||||
}
|
||||
|
||||
#pragma mark - Rotating/zooming
|
||||
// MARK: - Rotating/zooming
|
||||
|
||||
- (void)testSelectingAnnotationWhenMapIsRotated {
|
||||
|
||||
@@ -782,7 +782,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f };
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Utilities
|
||||
// MARK: - Utilities
|
||||
|
||||
- (void)runRunLoop {
|
||||
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
}
|
||||
@end
|
||||
|
||||
#pragma mark - camera transitions with NaN values
|
||||
// MARK: - camera transitions with NaN values
|
||||
|
||||
@interface MGLMapView (MGLCameraTransitionFinishNaNTests)
|
||||
- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MGLMapCamera *)camera edgePadding:(UIEdgeInsets)insets;
|
||||
|
||||
@@ -331,7 +331,7 @@
|
||||
XCTAssert(delegateCallCount == 2, @"Expecting 2 regionDidChange callbacks, got %ld", (long)delegateCallCount); // Once for the setDirection and once for the reset north
|
||||
}
|
||||
|
||||
#pragma mark - Pending tests
|
||||
// MARK: - Pending tests
|
||||
|
||||
- (void)testContinuallyResettingNorthInIsChanging🙁{
|
||||
// See https://github.com/mapbox/mapbox-gl-native/pull/11614
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
@implementation MBGLIntegrationTests
|
||||
|
||||
#pragma mark - Tests
|
||||
// MARK: - Tests
|
||||
|
||||
- (void)waitForMapViewToBeRendered {
|
||||
[self waitForMapViewToBeRenderedWithTimeout:10];
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
#pragma mark - MGLMapViewDelegate
|
||||
// MARK: - MGLMapViewDelegate
|
||||
|
||||
- (MGLAnnotationView*)mapView:(MGLMapView *)mapView viewForAnnotation:(id<MGLAnnotation>)annotation {
|
||||
if (self.viewForAnnotation) {
|
||||
@@ -102,7 +102,7 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark - Utilities
|
||||
// MARK: - Utilities
|
||||
|
||||
- (void)waitForMapViewToFinishLoadingStyleWithTimeout:(NSTimeInterval)timeout {
|
||||
XCTAssertNil(self.styleLoadingExpectation);
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - test interrupting regular rendering
|
||||
// MARK: - test interrupting regular rendering
|
||||
|
||||
- (void)testSetCenterCoordinateSetHidden {
|
||||
|
||||
@@ -302,7 +302,7 @@
|
||||
addToPendingCallback:addedToPending];
|
||||
}
|
||||
|
||||
#pragma mark - Shared utility methods
|
||||
// MARK: - Shared utility methods
|
||||
|
||||
- (void)internalTestCompletionBlockAddedToPendingForTestName:(NSString *)testName
|
||||
transition:(void (^)(dispatch_block_t))transition
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - MGLNetworkConfiguration delegate
|
||||
// MARK: - MGLNetworkConfiguration delegate
|
||||
|
||||
@implementation MGLNetworkConfigurationTestDelegate
|
||||
- (NSURLSession *)sessionForNetworkConfiguration:(MGLNetworkConfiguration *)configuration {
|
||||
@@ -325,7 +325,7 @@
|
||||
}
|
||||
@end
|
||||
|
||||
#pragma mark - NSURLSession delegate
|
||||
// MARK: - NSURLSession delegate
|
||||
|
||||
@implementation MGLNetworkConfigurationSessionDelegate
|
||||
- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler {
|
||||
@@ -338,7 +338,7 @@
|
||||
}
|
||||
@end
|
||||
|
||||
#pragma mark - NSURLSession data delegate
|
||||
// MARK: - NSURLSession data delegate
|
||||
|
||||
@implementation MGLNetworkConfigurationSessionDataDelegate
|
||||
- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - Quick actions
|
||||
// MARK: - Quick actions
|
||||
|
||||
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler {
|
||||
completionHandler([self handleShortcut:shortcutItem]);
|
||||
|
||||
@@ -37,7 +37,7 @@ static CGFloat const tipWidth = 10.0;
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - API
|
||||
// MARK: - API
|
||||
|
||||
- (void)presentCalloutFromRect:(CGRect)rect inView:(nonnull UIView *)view constrainedToRect:(__unused CGRect)constrainedRect animated:(BOOL)animated
|
||||
{
|
||||
@@ -78,7 +78,7 @@ static CGFloat const tipWidth = 10.0;
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
|
||||
#pragma mark - internals
|
||||
// MARK: - internals
|
||||
|
||||
- (void)drawRect:(CGRect)rect
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
self.delegate = nil;
|
||||
}
|
||||
|
||||
#pragma mark - Location Updates
|
||||
// MARK: - Location Updates
|
||||
|
||||
- (void)loadRouteCoordinates
|
||||
{
|
||||
|
||||
@@ -63,13 +63,13 @@ typedef NS_ENUM(NSInteger, MBXEmbeddedControl) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark UIScrollViewDelegate methods
|
||||
// MARK: UIScrollViewDelegate methods
|
||||
|
||||
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
|
||||
return self.mapView;
|
||||
}
|
||||
|
||||
#pragma mark Class method
|
||||
// MARK: Class method
|
||||
|
||||
+ (NSString *)titleForControl:(MBXEmbeddedControl) control {
|
||||
switch (control) {
|
||||
|
||||
@@ -142,7 +142,7 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Table view data source
|
||||
// MARK: - Table view data source
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return [MGLOfflineStorage sharedOfflineStorage].packs.count;
|
||||
@@ -209,7 +209,7 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Table view delegate
|
||||
// MARK: - Table view delegate
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
@@ -240,7 +240,7 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Offline pack delegate
|
||||
// MARK: - Offline pack delegate
|
||||
|
||||
- (void)offlinePackProgressDidChange:(NSNotification *)notification {
|
||||
MGLOfflinePack *pack = notification.object;
|
||||
|
||||
@@ -229,7 +229,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
UIEdgeInsets _originalContentInsets;
|
||||
}
|
||||
|
||||
#pragma mark - Setup & Teardown
|
||||
// MARK: - Setup & Teardown
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
@@ -319,7 +319,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
#pragma mark - Debugging Interface
|
||||
// MARK: - Debugging Interface
|
||||
|
||||
- (IBAction)showSettings:(__unused id)sender
|
||||
{
|
||||
@@ -793,7 +793,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Debugging Actions
|
||||
// MARK: - Debugging Actions
|
||||
|
||||
- (void)parseFeaturesAddingCount:(NSUInteger)featuresCount usingViews:(BOOL)useViews
|
||||
{
|
||||
@@ -1714,7 +1714,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
return backupImage;
|
||||
}
|
||||
|
||||
#pragma mark - Random World Tour
|
||||
// MARK: - Random World Tour
|
||||
|
||||
- (void)addAnnotations:(NSInteger)numAnnotations aroundCoordinate:(CLLocationCoordinate2D)coordinate radius:(CLLocationDistance)radius {
|
||||
NSMutableArray *annotations = [[NSMutableArray alloc] initWithCapacity:numAnnotations];
|
||||
@@ -1860,7 +1860,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - User Actions
|
||||
// MARK: - User Actions
|
||||
|
||||
- (void)handleSingleTap:(UITapGestureRecognizer *)singleTap {
|
||||
[self.navigationController setNavigationBarHidden:!self.navigationController.navigationBarHidden animated:YES];
|
||||
@@ -1968,7 +1968,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
[sender setAccessibilityValue:nextAccessibilityValue];
|
||||
}
|
||||
|
||||
#pragma mark - UIViewDelegate
|
||||
// MARK: - UIViewDelegate
|
||||
|
||||
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
|
||||
{
|
||||
@@ -1985,7 +1985,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - MGLMapViewDelegate
|
||||
// MARK: - MGLMapViewDelegate
|
||||
|
||||
- (MGLAnnotationView *)mapView:(MGLMapView *)mapView viewForAnnotation:(id<MGLAnnotation>)annotation
|
||||
{
|
||||
@@ -2270,7 +2270,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
|
||||
[self.hudLabel setTitle:hudString forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
#pragma mark - MGLComputedShapeSourceDataSource
|
||||
// MARK: - MGLComputedShapeSourceDataSource
|
||||
|
||||
- (NSArray<id <MGLFeature>>*)featuresInCoordinateBounds:(MGLCoordinateBounds)bounds zoomLevel:(NSUInteger)zoom {
|
||||
double gridSpacing;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
@interface MGLMapView (Experimental)
|
||||
|
||||
#pragma mark Rendering Performance Measurement
|
||||
// MARK: Rendering Performance Measurement
|
||||
|
||||
/** Enable rendering performance measurement. */
|
||||
@property (nonatomic) BOOL experimental_enableFrameRateMeasurement;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
@implementation MBXBenchViewController
|
||||
|
||||
#pragma mark - Setup
|
||||
// MARK: - Setup
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark UIAccessibility methods
|
||||
// MARK: UIAccessibility methods
|
||||
|
||||
- (UIAccessibilityTraits)accessibilityTraits {
|
||||
return UIAccessibilityTraitAdjustable;
|
||||
|
||||
@@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
MGL_EXPORT
|
||||
@interface MGLAnnotationImage : NSObject <NSSecureCoding>
|
||||
|
||||
#pragma mark Initializing and Preparing the Image Object
|
||||
// MARK: Initializing and Preparing the Image Object
|
||||
|
||||
/**
|
||||
Initializes and returns a new annotation image object.
|
||||
@@ -31,7 +31,7 @@ MGL_EXPORT
|
||||
*/
|
||||
+ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(NSString *)reuseIdentifier;
|
||||
|
||||
#pragma mark Getting and Setting Attributes
|
||||
// MARK: Getting and Setting Attributes
|
||||
|
||||
/** The image to be displayed for the annotation. */
|
||||
@property (nonatomic, strong, nullable) UIImage *image;
|
||||
|
||||
@@ -55,7 +55,7 @@ typedef NS_ENUM(NSUInteger, MGLAnnotationViewDragState) {
|
||||
MGL_EXPORT
|
||||
@interface MGLAnnotationView : UIView <NSSecureCoding>
|
||||
|
||||
#pragma mark Initializing and Preparing the View
|
||||
// MARK: Initializing and Preparing the View
|
||||
|
||||
/**
|
||||
Initializes and returns a new annotation view object.
|
||||
@@ -137,7 +137,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) NSString *reuseIdentifier;
|
||||
|
||||
#pragma mark Configuring the Appearance
|
||||
// MARK: Configuring the Appearance
|
||||
|
||||
/**
|
||||
The offset, measured in points, at which to place the center of the view.
|
||||
@@ -191,7 +191,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL rotatesToMatchCamera;
|
||||
|
||||
#pragma mark Managing the Selection State
|
||||
// MARK: Managing the Selection State
|
||||
|
||||
/**
|
||||
A Boolean value indicating whether the annotation view is currently selected.
|
||||
@@ -240,7 +240,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, assign, getter=isEnabled) BOOL enabled;
|
||||
|
||||
#pragma mark Supporting Drag Operations
|
||||
// MARK: Supporting Drag Operations
|
||||
|
||||
/**
|
||||
A Boolean value indicating whether the annotation view is draggable.
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
_lastAppliedRotationTransform = newRotationTransform;
|
||||
}
|
||||
|
||||
#pragma mark - Draggable
|
||||
// MARK: - Draggable
|
||||
|
||||
- (void)setDraggable:(BOOL)draggable
|
||||
{
|
||||
@@ -345,7 +345,7 @@
|
||||
return otherGestureRecognizer == _longPressRecognizer || otherGestureRecognizer == _panGestureRecognizer;
|
||||
}
|
||||
|
||||
#pragma mark UIAccessibility methods
|
||||
// MARK: UIAccessibility methods
|
||||
|
||||
- (BOOL)isAccessibilityElement {
|
||||
return !self.hidden;
|
||||
|
||||
@@ -191,7 +191,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLUserLocationAnnotationTyp
|
||||
MGL_EXPORT
|
||||
@interface MGLMapView : UIView <MGLStylable>
|
||||
|
||||
#pragma mark Creating Instances
|
||||
// MARK: Creating Instances
|
||||
|
||||
/**
|
||||
Initializes and returns a newly allocated map view with the specified frame
|
||||
@@ -225,7 +225,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (instancetype)initWithFrame:(CGRect)frame styleURL:(nullable NSURL *)styleURL;
|
||||
|
||||
#pragma mark Accessing the Delegate
|
||||
// MARK: Accessing the Delegate
|
||||
|
||||
/**
|
||||
The receiver’s delegate.
|
||||
@@ -237,7 +237,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property(nonatomic, weak, nullable) IBOutlet id<MGLMapViewDelegate> delegate;
|
||||
|
||||
#pragma mark Configuring the Map’s Appearance
|
||||
// MARK: Configuring the Map’s Appearance
|
||||
|
||||
/**
|
||||
The style currently displayed in the receiver.
|
||||
@@ -449,7 +449,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL prefetchesTiles;
|
||||
|
||||
#pragma mark Displaying the User’s Location
|
||||
// MARK: Displaying the User’s Location
|
||||
|
||||
/**
|
||||
The object that this map view uses to start and stop the delivery of
|
||||
@@ -671,7 +671,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (void)setTargetCoordinate:(CLLocationCoordinate2D)targetCoordinate animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
|
||||
|
||||
#pragma mark Configuring How the User Interacts with the Map
|
||||
// MARK: Configuring How the User Interacts with the Map
|
||||
|
||||
/**
|
||||
A Boolean value that determines whether the user may zoom the map in and
|
||||
@@ -772,7 +772,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property(nonatomic) CGFloat decelerationRate;
|
||||
|
||||
#pragma mark Manipulating the Viewpoint
|
||||
// MARK: Manipulating the Viewpoint
|
||||
|
||||
/**
|
||||
The geographic coordinate at the center of the map view.
|
||||
@@ -1453,7 +1453,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (void)setContentInset:(UIEdgeInsets)contentInset animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
|
||||
|
||||
#pragma mark Converting Geographic Coordinates
|
||||
// MARK: Converting Geographic Coordinates
|
||||
|
||||
/**
|
||||
Converts a point in the given view’s coordinate system to a geographic
|
||||
@@ -1540,7 +1540,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (MGLMapProjection*)mapProjection;
|
||||
|
||||
#pragma mark Annotating the Map
|
||||
// MARK: Annotating the Map
|
||||
|
||||
/**
|
||||
The complete list of annotations associated with the receiver. (read-only)
|
||||
@@ -1678,7 +1678,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (nullable NSArray<id <MGLAnnotation>> *)visibleAnnotationsInRect:(CGRect)rect;
|
||||
|
||||
#pragma mark Managing Annotation Selections
|
||||
// MARK: Managing Annotation Selections
|
||||
|
||||
/**
|
||||
The currently selected annotations.
|
||||
@@ -1763,7 +1763,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (void)deselectAnnotation:(nullable id <MGLAnnotation>)annotation animated:(BOOL)animated;
|
||||
|
||||
#pragma mark Overlaying the Map
|
||||
// MARK: Overlaying the Map
|
||||
|
||||
/**
|
||||
The complete list of overlays associated with the receiver. (read-only)
|
||||
@@ -1813,7 +1813,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (void)removeOverlays:(NSArray<id <MGLOverlay>> *)overlays;
|
||||
|
||||
#pragma mark Accessing the Underlying Map Data
|
||||
// MARK: Accessing the Underlying Map Data
|
||||
|
||||
/**
|
||||
Returns an array of rendered map features that intersect with a given point.
|
||||
@@ -2026,7 +2026,7 @@ MGL_EXPORT
|
||||
*/
|
||||
- (NSArray<id <MGLFeature>> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:));
|
||||
|
||||
#pragma mark Debugging the Map
|
||||
// MARK: Debugging the Map
|
||||
|
||||
/**
|
||||
The options that determine which debugging aids are shown on the map.
|
||||
|
||||
@@ -351,7 +351,7 @@ public:
|
||||
NSString *viewReuseIdentifier;
|
||||
};
|
||||
|
||||
#pragma mark - Private -
|
||||
// MARK: - Private -
|
||||
|
||||
@interface MGLMapView () <UIGestureRecognizerDelegate,
|
||||
MGLLocationManagerDelegate,
|
||||
@@ -503,7 +503,7 @@ public:
|
||||
CFTimeInterval _frameDurations;
|
||||
}
|
||||
|
||||
#pragma mark - Setup & Teardown -
|
||||
// MARK: - Setup & Teardown -
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
@@ -974,7 +974,7 @@ public:
|
||||
return _mbglView.get();
|
||||
}
|
||||
|
||||
#pragma mark - Layout -
|
||||
// MARK: - Layout -
|
||||
|
||||
+ (BOOL)requiresConstraintBasedLayout
|
||||
{
|
||||
@@ -1378,7 +1378,7 @@ public:
|
||||
return CGPointMake(CGRectGetMidX(contentFrame), CGRectGetMidY(contentFrame));
|
||||
}
|
||||
|
||||
#pragma mark - Pending completion blocks
|
||||
// MARK: - Pending completion blocks
|
||||
|
||||
- (void)processPendingBlocks
|
||||
{
|
||||
@@ -1406,7 +1406,7 @@ public:
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark - Life Cycle -
|
||||
// MARK: - Life Cycle -
|
||||
|
||||
- (void)updateFromDisplayLink:(CADisplayLink *)displayLink
|
||||
{
|
||||
@@ -1846,7 +1846,7 @@ public:
|
||||
[self updateFromDisplayLink:self.displayLink];
|
||||
}
|
||||
|
||||
#pragma mark - Application lifecycle
|
||||
// MARK: - Application lifecycle
|
||||
- (void)willResignActive:(NSNotification *)notification
|
||||
{
|
||||
MGLAssertIsMainThread();
|
||||
@@ -1953,7 +1953,7 @@ public:
|
||||
[self resumeRenderingIfNecessary];
|
||||
}
|
||||
|
||||
#pragma mark - GL / display link wake/sleep
|
||||
// MARK: - GL / display link wake/sleep
|
||||
|
||||
- (EAGLContext *)context {
|
||||
return _mbglView->getEAGLContext();
|
||||
@@ -2091,7 +2091,7 @@ public:
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - Gestures -
|
||||
// MARK: - Gestures -
|
||||
|
||||
- (void)touchesBegan:(__unused NSSet<UITouch *> *)touches withEvent:(__unused UIEvent *)event
|
||||
{
|
||||
@@ -2914,7 +2914,7 @@ public:
|
||||
return angleInDegrees;
|
||||
}
|
||||
|
||||
#pragma mark - Attribution -
|
||||
// MARK: - Attribution -
|
||||
|
||||
- (void)showAttribution:(id)sender
|
||||
{
|
||||
@@ -2961,7 +2961,7 @@ public:
|
||||
self.attributionController = attributionController;
|
||||
}
|
||||
|
||||
#pragma mark - Properties -
|
||||
// MARK: - Properties -
|
||||
|
||||
static void *windowScreenContext = &windowScreenContext;
|
||||
|
||||
@@ -3207,7 +3207,7 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
return self.mbglMap.getPrefetchZoomDelta() > 0 ? YES : NO;
|
||||
}
|
||||
|
||||
#pragma mark - Accessibility -
|
||||
// MARK: - Accessibility -
|
||||
|
||||
- (NSString *)accessibilityValue
|
||||
{
|
||||
@@ -3736,7 +3736,7 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
_accessibilityValueAnnouncementIsPending = YES;
|
||||
}
|
||||
|
||||
#pragma mark - Geography -
|
||||
// MARK: - Geography -
|
||||
|
||||
+ (NSSet<NSString *> *)keyPathsForValuesAffectingCenterCoordinate
|
||||
{
|
||||
@@ -4544,14 +4544,14 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
return [[MGLMapProjection alloc] initWithMapView:self];
|
||||
}
|
||||
|
||||
#pragma mark - Camera Change Reason -
|
||||
// MARK: - Camera Change Reason -
|
||||
|
||||
- (void)resetCameraChangeReason
|
||||
{
|
||||
self.cameraChangeReasonBitmask = MGLCameraChangeReasonNone;
|
||||
}
|
||||
|
||||
#pragma mark - Annotations -
|
||||
// MARK: - Annotations -
|
||||
|
||||
- (nullable NSArray<id <MGLAnnotation>> *)annotations
|
||||
{
|
||||
@@ -5798,7 +5798,7 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark Annotation Image Delegate
|
||||
// MARK: Annotation Image Delegate
|
||||
|
||||
- (void)annotationImageNeedsRedisplay:(MGLAnnotationImage *)annotationImage
|
||||
{
|
||||
@@ -5846,7 +5846,7 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - User Location -
|
||||
// MARK: - User Location -
|
||||
|
||||
- (void)setLocationManager:(nullable id<MGLLocationManager>)locationManager
|
||||
{
|
||||
@@ -6554,7 +6554,7 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Data
|
||||
// MARK: Data
|
||||
|
||||
- (NSArray<id <MGLFeature>> *)visibleFeaturesAtPoint:(CGPoint)point
|
||||
{
|
||||
@@ -6629,7 +6629,7 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
return MGLFeaturesFromMBGLFeatures(features);
|
||||
}
|
||||
|
||||
#pragma mark - Utility -
|
||||
// MARK: - Utility -
|
||||
|
||||
- (void)animateWithDelay:(NSTimeInterval)delay animations:(void (^)(void))animations
|
||||
{
|
||||
@@ -7383,7 +7383,7 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
return _annotationViewReuseQueueByIdentifier[identifier];
|
||||
}
|
||||
|
||||
#pragma mark - Snapshot image -
|
||||
// MARK: - Snapshot image -
|
||||
|
||||
- (void)attemptBackgroundSnapshot {
|
||||
static NSTimeInterval lastSnapshotTime = 0.0;
|
||||
@@ -7419,7 +7419,7 @@ static void *windowScreenContext = &windowScreenContext;
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - IBAdditions methods
|
||||
// MARK: - IBAdditions methods
|
||||
|
||||
@implementation MGLMapView (IBAdditions)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@optional
|
||||
|
||||
#pragma mark Responding to Map Position Changes
|
||||
// MARK: Responding to Map Position Changes
|
||||
|
||||
/**
|
||||
Asks the delegate whether the map view should be allowed to change from the
|
||||
@@ -173,7 +173,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)mapView:(MGLMapView *)mapView regionDidChangeWithReason:(MGLCameraChangeReason)reason animated:(BOOL)animated;
|
||||
|
||||
#pragma mark Loading the Map
|
||||
// MARK: Loading the Map
|
||||
|
||||
/**
|
||||
Tells the delegate that the map view will begin to load.
|
||||
@@ -292,7 +292,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (BOOL)mapView:(MGLMapView *)mapView shouldRemoveStyleImage:(NSString *)imageName;
|
||||
|
||||
#pragma mark Tracking User Location
|
||||
// MARK: Tracking User Location
|
||||
|
||||
/**
|
||||
Tells the delegate that the map view will begin tracking the user’s location.
|
||||
@@ -391,7 +391,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)mapView:(MGLMapView *)mapView didChangeLocationManagerAuthorization:(id<MGLLocationManager>)manager API_AVAILABLE(ios(14));
|
||||
|
||||
#pragma mark Managing the Appearance of Annotations
|
||||
// MARK: Managing the Appearance of Annotations
|
||||
|
||||
/**
|
||||
Returns an annotation image object to mark the given point annotation object on
|
||||
@@ -496,7 +496,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (CGFloat)mapView:(MGLMapView *)mapView lineWidthForPolylineAnnotation:(MGLPolyline *)annotation;
|
||||
|
||||
#pragma mark Managing Annotation Views
|
||||
// MARK: Managing Annotation Views
|
||||
|
||||
/**
|
||||
Returns a view object to mark the given point annotation object on the map.
|
||||
@@ -542,7 +542,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)mapView:(MGLMapView *)mapView didAddAnnotationViews:(NSArray<MGLAnnotationView *> *)annotationViews;
|
||||
|
||||
#pragma mark Selecting Annotations
|
||||
// MARK: Selecting Annotations
|
||||
|
||||
/**
|
||||
Returns a Boolean value indicating whether the shape annotation can be selected.
|
||||
@@ -621,7 +621,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)mapView:(MGLMapView *)mapView didDeselectAnnotationView:(MGLAnnotationView *)annotationView;
|
||||
|
||||
#pragma mark Managing Callout Views
|
||||
// MARK: Managing Callout Views
|
||||
|
||||
/**
|
||||
Returns a Boolean value indicating whether the annotation is able to display
|
||||
|
||||
@@ -223,7 +223,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary
|
||||
[self addZeroLabel];
|
||||
}
|
||||
|
||||
#pragma mark - Dimensions
|
||||
// MARK: - Dimensions
|
||||
|
||||
- (void)setBorderWidth:(CGFloat)borderWidth {
|
||||
_borderWidth = borderWidth;
|
||||
@@ -260,7 +260,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary
|
||||
return [self usesMetricSystem] ? self.metersPerPoint : self.metersPerPoint * MGLFeetPerMeter;
|
||||
}
|
||||
|
||||
#pragma mark - Convenience methods
|
||||
// MARK: - Convenience methods
|
||||
|
||||
- (BOOL)usesRightToLeftLayout {
|
||||
if (self.testingRightToLeftOverride) {
|
||||
@@ -302,7 +302,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Dark Mode Changes
|
||||
// MARK: - Dark Mode Changes
|
||||
|
||||
- (void)setShouldShowDarkStyles:(BOOL)shouldShowDarkStyles {
|
||||
|
||||
@@ -318,7 +318,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Setters
|
||||
// MARK: - Setters
|
||||
|
||||
- (void)setUsesMetricSystem:(BOOL)usesMetricSystem {
|
||||
|
||||
@@ -454,7 +454,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary
|
||||
_row = row;
|
||||
}
|
||||
|
||||
#pragma mark - Views
|
||||
// MARK: - Views
|
||||
|
||||
- (NSArray<UIView *> *)bars {
|
||||
if (!_bars) {
|
||||
@@ -469,7 +469,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary
|
||||
return _bars;
|
||||
}
|
||||
|
||||
#pragma mark - Labels
|
||||
// MARK: - Labels
|
||||
|
||||
- (void)addZeroLabel {
|
||||
NSDecimalNumber *zeroNumber = [NSDecimalNumber decimalNumberWithString:@"0"];
|
||||
@@ -542,7 +542,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Layout
|
||||
// MARK: - Layout
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
|
||||
@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
MGL_EXPORT
|
||||
@interface MGLUserLocation : NSObject <MGLAnnotation, NSSecureCoding>
|
||||
|
||||
#pragma mark Determining the User’s Position
|
||||
// MARK: Determining the User’s Position
|
||||
|
||||
/**
|
||||
The current location of the device. (read-only)
|
||||
@@ -44,7 +44,7 @@ MGL_EXPORT
|
||||
*/
|
||||
@property (nonatomic, readonly, nullable) CLHeading *heading;
|
||||
|
||||
#pragma mark Accessing the User Annotation Text
|
||||
// MARK: Accessing the User Annotation Text
|
||||
|
||||
/** The title to display for the user location annotation. */
|
||||
@property (nonatomic, copy) NSString *title;
|
||||
|
||||
@@ -240,7 +240,7 @@ static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReu
|
||||
XCTAssert(self.mapView.selectedAnnotations.count == 0, @"There should be 0 selected annotations");
|
||||
}
|
||||
|
||||
#pragma mark - MGLMapViewDelegate -
|
||||
// MARK: - MGLMapViewDelegate -
|
||||
|
||||
- (MGLAnnotationView *)mapView:(MGLMapView *)mapView viewForAnnotation:(id<MGLAnnotation>)annotation
|
||||
{
|
||||
|
||||
@@ -80,7 +80,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
#pragma mark Lifecycle
|
||||
// MARK: Lifecycle
|
||||
|
||||
+ (void)load {
|
||||
[MGLSettings useWellKnownTileServer:MGLMapTiler];
|
||||
@@ -155,7 +155,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
|
||||
[self.offlinePacksArrayController unbind:@"content"];
|
||||
}
|
||||
|
||||
#pragma mark Services
|
||||
// MARK: Services
|
||||
|
||||
- (void)handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent {
|
||||
// geo:29.95,-90.066667,3000
|
||||
@@ -215,7 +215,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
|
||||
[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:NULL];
|
||||
}
|
||||
|
||||
#pragma mark Offline pack management
|
||||
// MARK: Offline pack management
|
||||
|
||||
- (IBAction)showOfflinePacksPanel:(id)sender {
|
||||
[self.offlinePacksPanel makeKeyAndOrderFront:sender];
|
||||
@@ -288,7 +288,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
|
||||
[[NSSound soundNamed:@"Basso"] play];
|
||||
}
|
||||
|
||||
#pragma mark Help methods
|
||||
// MARK: Help methods
|
||||
|
||||
- (IBAction)showShortcuts:(id)sender {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
@@ -316,7 +316,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark User interface validation
|
||||
// MARK: User interface validation
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||
if (menuItem.action == @selector(showShortcuts:)) {
|
||||
@@ -337,7 +337,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask";
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark NSWindowDelegate methods
|
||||
// MARK: NSWindowDelegate methods
|
||||
|
||||
- (void)windowWillClose:(NSNotification *)notification {
|
||||
NSWindow *window = notification.object;
|
||||
|
||||
@@ -105,7 +105,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
MGLMapSnapshotter *_snapshotter;
|
||||
}
|
||||
|
||||
#pragma mark Lifecycle
|
||||
// MARK: Lifecycle
|
||||
|
||||
- (NSString *)windowNibName {
|
||||
return @"MapDocument";
|
||||
@@ -153,7 +153,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark NSWindowDelegate methods
|
||||
// MARK: NSWindowDelegate methods
|
||||
|
||||
- (void)window:(NSWindow *)window willEncodeRestorableState:(NSCoder *)state {
|
||||
[state encodeObject:self.mapView.styleURL forKey:@"MBXMapViewStyleURL"];
|
||||
@@ -165,7 +165,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
_isLocalizingLabels = [state decodeBoolForKey:@"MBXLocalizeLabels"];
|
||||
}
|
||||
|
||||
#pragma mark Services
|
||||
// MARK: Services
|
||||
|
||||
- (IBAction)showShareMenu:(id)sender {
|
||||
NSSharingServicePicker *picker = [[NSSharingServicePicker alloc] initWithItems:@[self.shareURL]];
|
||||
@@ -183,7 +183,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
camera.heading, camera.pitch]];
|
||||
}
|
||||
|
||||
#pragma mark File methods
|
||||
// MARK: File methods
|
||||
|
||||
- (IBAction)import:(id)sender {
|
||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||
@@ -311,7 +311,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark View methods
|
||||
// MARK: View methods
|
||||
|
||||
- (IBAction)showStyle:(id)sender {
|
||||
NSInteger tag = -1;
|
||||
@@ -522,7 +522,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
self.displayName = [NSString stringWithFormat:@"%@ @ %f", coordinateString, _mapView.zoomLevel];
|
||||
}
|
||||
|
||||
#pragma mark Debug methods
|
||||
// MARK: Debug methods
|
||||
|
||||
- (IBAction)toggleTileBoundaries:(id)sender {
|
||||
self.mapView.debugMask ^= MGLMapDebugTileBoundariesMask;
|
||||
@@ -903,7 +903,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
[self.mapView.style insertLayer:hillshadeLayer atIndex:hillshadeIndex];
|
||||
}
|
||||
|
||||
#pragma mark Offline packs
|
||||
// MARK: Offline packs
|
||||
|
||||
- (IBAction)addOfflinePack:(id)sender {
|
||||
self.offlinePackNameField.stringValue = @"";
|
||||
@@ -952,7 +952,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
[self.window endSheet:self.addOfflinePackWindow returnCode:[sender tag] ? NSModalResponseOK : NSModalResponseCancel];
|
||||
}
|
||||
|
||||
#pragma mark Mouse events
|
||||
// MARK: Mouse events
|
||||
|
||||
- (void)handlePressGesture:(NSPressGestureRecognizer *)gestureRecognizer {
|
||||
if (gestureRecognizer.state == NSGestureRecognizerStateBegan) {
|
||||
@@ -1123,7 +1123,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
[self.mapView addAnnotations:flattenedFeatures];
|
||||
}
|
||||
|
||||
#pragma mark User interface validation
|
||||
// MARK: User interface validation
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||
if (menuItem.action == @selector(showStyle:)) {
|
||||
@@ -1339,7 +1339,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark NSSharingServicePickerDelegate methods
|
||||
// MARK: NSSharingServicePickerDelegate methods
|
||||
|
||||
- (NSArray<NSSharingService *> *)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker sharingServicesForItems:(NSArray *)items proposedSharingServices:(NSArray<NSSharingService *> *)proposedServices {
|
||||
NSURL *shareURL = self.shareURL;
|
||||
@@ -1360,7 +1360,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
return sharingServices;
|
||||
}
|
||||
|
||||
#pragma mark NSMenuDelegate methods
|
||||
// MARK: NSMenuDelegate methods
|
||||
|
||||
- (void)menuWillOpen:(NSMenu *)menu {
|
||||
if (menu == self.mapViewContextMenu) {
|
||||
@@ -1369,7 +1369,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark NSSplitViewDelegate methods
|
||||
// MARK: NSSplitViewDelegate methods
|
||||
|
||||
- (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview {
|
||||
return subview != self.mapView;
|
||||
@@ -1379,7 +1379,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark MGLMapViewDelegate methods
|
||||
// MARK: MGLMapViewDelegate methods
|
||||
|
||||
- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style {
|
||||
[self updateLabels];
|
||||
@@ -1439,7 +1439,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
return 0.8;
|
||||
}
|
||||
|
||||
#pragma mark MGLMapSnapshotterDelegate methods
|
||||
// MARK: MGLMapSnapshotterDelegate methods
|
||||
|
||||
- (void)mapSnapshotter:(MGLMapSnapshotter *)snapshotter didFinishLoadingStyle:(MGLStyle *)style {
|
||||
[style localizeLabelsIntoLocale:_isLocalizingLabels ? nil : [NSLocale localeWithLocaleIdentifier:@"mul"]];
|
||||
@@ -1460,7 +1460,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - MGLComputedShapeSourceDataSource
|
||||
// MARK: - MGLComputedShapeSourceDataSource
|
||||
- (NSArray<id <MGLFeature>>*)featuresInCoordinateBounds:(MGLCoordinateBounds)bounds zoomLevel:(NSUInteger)zoom {
|
||||
double gridSpacing;
|
||||
if(zoom >= 13) {
|
||||
|
||||
@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
MGL_EXPORT
|
||||
@interface MGLAnnotationImage : NSObject <NSSecureCoding>
|
||||
|
||||
#pragma mark Initializing and Preparing the Image Object
|
||||
// MARK: Initializing and Preparing the Image Object
|
||||
|
||||
/**
|
||||
Initializes and returns a new annotation image object.
|
||||
@@ -26,7 +26,7 @@ MGL_EXPORT
|
||||
*/
|
||||
+ (instancetype)annotationImageWithImage:(NSImage *)image reuseIdentifier:(NSString *)reuseIdentifier;
|
||||
|
||||
#pragma mark Getting and Setting Attributes
|
||||
// MARK: Getting and Setting Attributes
|
||||
|
||||
/** The image to display for the annotation. */
|
||||
@property (nonatomic, readonly) NSImage *image;
|
||||
|
||||
@@ -67,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
MGL_EXPORT IB_DESIGNABLE
|
||||
@interface MGLMapView : NSView <MGLStylable>
|
||||
|
||||
#pragma mark Creating Instances
|
||||
// MARK: Creating Instances
|
||||
|
||||
/**
|
||||
Initializes and returns a newly allocated map view with the specified frame and
|
||||
@@ -90,7 +90,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
*/
|
||||
- (instancetype)initWithFrame:(NSRect)frame styleURL:(nullable NSURL *)styleURL;
|
||||
|
||||
#pragma mark Accessing the Delegate
|
||||
// MARK: Accessing the Delegate
|
||||
|
||||
/**
|
||||
The receiver’s delegate.
|
||||
@@ -102,7 +102,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
*/
|
||||
@property (nonatomic, weak, nullable) IBOutlet id <MGLMapViewDelegate> delegate;
|
||||
|
||||
#pragma mark Configuring the Map’s Appearance
|
||||
// MARK: Configuring the Map’s Appearance
|
||||
|
||||
/**
|
||||
The style currently displayed in the receiver.
|
||||
@@ -199,7 +199,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
@property (nonatomic, assign) BOOL prefetchesTiles;
|
||||
|
||||
|
||||
#pragma mark Manipulating the Viewpoint
|
||||
// MARK: Manipulating the Viewpoint
|
||||
|
||||
/**
|
||||
The geographic coordinate at the center of the map view.
|
||||
@@ -691,7 +691,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
*/
|
||||
- (void)setContentInsets:(NSEdgeInsets)contentInsets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
|
||||
|
||||
#pragma mark Configuring How the User Interacts with the Map
|
||||
// MARK: Configuring How the User Interacts with the Map
|
||||
|
||||
/**
|
||||
A Boolean value that determines whether the user may zoom the map in and out,
|
||||
@@ -751,7 +751,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
*/
|
||||
@property (nonatomic, getter=isPitchEnabled) BOOL pitchEnabled;
|
||||
|
||||
#pragma mark Annotating the Map
|
||||
// MARK: Annotating the Map
|
||||
|
||||
/**
|
||||
The complete list of annotations associated with the receiver. (read-only)
|
||||
@@ -853,7 +853,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
*/
|
||||
- (nullable NSArray<id <MGLAnnotation>> *)visibleAnnotationsInRect:(CGRect)rect;
|
||||
|
||||
#pragma mark Managing Annotation Selections
|
||||
// MARK: Managing Annotation Selections
|
||||
|
||||
/**
|
||||
The currently selected annotations.
|
||||
@@ -906,7 +906,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
*/
|
||||
@property (nonatomic, strong, null_resettable) IBOutlet NSViewController *calloutViewController;
|
||||
|
||||
#pragma mark Finding Annotations
|
||||
// MARK: Finding Annotations
|
||||
|
||||
/**
|
||||
Returns a point annotation located at the given point.
|
||||
@@ -918,7 +918,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
*/
|
||||
- (id <MGLAnnotation>)annotationAtPoint:(NSPoint)point;
|
||||
|
||||
#pragma mark Overlaying the Map
|
||||
// MARK: Overlaying the Map
|
||||
|
||||
/**
|
||||
The complete list of overlays associated with the receiver. (read-only)
|
||||
@@ -969,7 +969,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
*/
|
||||
- (void)removeOverlays:(NSArray<id <MGLOverlay>> *)overlays;
|
||||
|
||||
#pragma mark Accessing the Underlying Map Data
|
||||
// MARK: Accessing the Underlying Map Data
|
||||
|
||||
/**
|
||||
Returns an array of rendered map features that intersect with a given point.
|
||||
@@ -1164,7 +1164,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
*/
|
||||
- (NSArray<id <MGLFeature>> *)visibleFeaturesInRect:(NSRect)rect inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:));
|
||||
|
||||
#pragma mark Converting Geographic Coordinates
|
||||
// MARK: Converting Geographic Coordinates
|
||||
|
||||
/**
|
||||
Converts a geographic coordinate to a point in the given view’s coordinate
|
||||
@@ -1234,7 +1234,7 @@ MGL_EXPORT IB_DESIGNABLE
|
||||
*/
|
||||
- (CLLocationDistance)metersPerPointAtLatitude:(CLLocationDegrees)latitude;
|
||||
|
||||
#pragma mark Debugging the Map
|
||||
// MARK: Debugging the Map
|
||||
|
||||
/**
|
||||
The options that determine which debugging aids are shown on the map.
|
||||
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
MGLReachability *_reachability;
|
||||
}
|
||||
|
||||
#pragma mark Lifecycle
|
||||
// MARK: Lifecycle
|
||||
|
||||
+ (void)initialize {
|
||||
if (self == [MGLMapView class]) {
|
||||
@@ -628,7 +628,7 @@ public:
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
#pragma mark Style
|
||||
// MARK: Style
|
||||
|
||||
+ (NSSet<NSString *> *)keyPathsForValuesAffectingStyle {
|
||||
return [NSSet setWithObject:@"styleURL"];
|
||||
@@ -676,7 +676,7 @@ public:
|
||||
return _rendererFrontend->getRenderer();
|
||||
}
|
||||
|
||||
#pragma mark View hierarchy and drawing
|
||||
// MARK: View hierarchy and drawing
|
||||
|
||||
- (void)viewWillMoveToWindow:(NSWindow *)newWindow {
|
||||
[self deselectAnnotation:self.selectedAnnotation];
|
||||
@@ -995,7 +995,7 @@ public:
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark Printing
|
||||
// MARK: Printing
|
||||
|
||||
- (void)print:(__unused id)sender {
|
||||
_isPrinting = YES;
|
||||
@@ -1010,7 +1010,7 @@ public:
|
||||
[op runOperation];
|
||||
}
|
||||
|
||||
#pragma mark Viewport
|
||||
// MARK: Viewport
|
||||
|
||||
+ (NSSet<NSString *> *)keyPathsForValuesAffectingCenterCoordinate {
|
||||
return [NSSet setWithObjects:@"latitude", @"longitude", @"camera", nil];
|
||||
@@ -1489,7 +1489,7 @@ public:
|
||||
[self setCenterCoordinate:oldCenter animated:animated completionHandler:completion];
|
||||
}
|
||||
|
||||
#pragma mark Mouse events and gestures
|
||||
// MARK: Mouse events and gestures
|
||||
|
||||
- (BOOL)acceptsFirstResponder {
|
||||
return YES;
|
||||
@@ -1767,7 +1767,7 @@ public:
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark NSGestureRecognizerDelegate methods
|
||||
// MARK: NSGestureRecognizerDelegate methods
|
||||
- (BOOL)gestureRecognizer:(NSGestureRecognizer *)gestureRecognizer shouldAttemptToRecognizeWithEvent:(NSEvent *)event {
|
||||
if (gestureRecognizer == _singleClickRecognizer) {
|
||||
if (!self.selectedAnnotation) {
|
||||
@@ -1781,7 +1781,7 @@ public:
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark Keyboard events
|
||||
// MARK: Keyboard events
|
||||
|
||||
- (void)keyDown:(NSEvent *)event {
|
||||
// This is the recommended way to handle arrow key presses, causing
|
||||
@@ -1873,7 +1873,7 @@ public:
|
||||
_compass.hidden = !rotateEnabled;
|
||||
}
|
||||
|
||||
#pragma mark Ornaments
|
||||
// MARK: Ornaments
|
||||
|
||||
/// Updates the zoom controls’ enabled state based on the current zoom level.
|
||||
- (void)updateZoomControls {
|
||||
@@ -1892,7 +1892,7 @@ public:
|
||||
[self setDirection:-sender.doubleValue animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark Annotations
|
||||
// MARK: Annotations
|
||||
|
||||
- (nullable NSArray<id <MGLAnnotation>> *)annotations {
|
||||
if (_annotationContextsByAnnotationTag.empty()) {
|
||||
@@ -2658,7 +2658,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark MGLMultiPointDelegate methods
|
||||
// MARK: MGLMultiPointDelegate methods
|
||||
|
||||
- (double)alphaForShapeAnnotation:(MGLShape *)annotation {
|
||||
if (_delegateHasAlphasForShapeAnnotations) {
|
||||
@@ -2688,7 +2688,7 @@ public:
|
||||
return 3.0;
|
||||
}
|
||||
|
||||
#pragma mark MGLPopoverDelegate methods
|
||||
// MARK: MGLPopoverDelegate methods
|
||||
|
||||
- (void)popoverDidShow:(__unused NSNotification *)notification {
|
||||
id <MGLAnnotation> annotation = self.selectedAnnotation;
|
||||
@@ -2709,7 +2709,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Overlays
|
||||
// MARK: Overlays
|
||||
|
||||
- (nonnull NSArray<id <MGLOverlay>> *)overlays
|
||||
{
|
||||
@@ -2758,7 +2758,7 @@ public:
|
||||
[self removeAnnotations:overlays];
|
||||
}
|
||||
|
||||
#pragma mark Tooltips and cursors
|
||||
// MARK: Tooltips and cursors
|
||||
|
||||
- (void)updateAnnotationTrackingAreas {
|
||||
if (_wantsToolTipRects) {
|
||||
@@ -2828,7 +2828,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Data
|
||||
// MARK: Data
|
||||
|
||||
- (NSArray<id <MGLFeature>> *)visibleFeaturesAtPoint:(NSPoint)point {
|
||||
MGLLogDebug(@"Querying visibleFeaturesAtPoint: %@", NSStringFromPoint(point));
|
||||
@@ -2901,13 +2901,13 @@ public:
|
||||
return MGLFeaturesFromMBGLFeatures(features);
|
||||
}
|
||||
|
||||
#pragma mark User interface validation
|
||||
// MARK: User interface validation
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark Interface Builder methods
|
||||
// MARK: Interface Builder methods
|
||||
|
||||
- (void)prepareForInterfaceBuilder {
|
||||
[super prepareForInterfaceBuilder];
|
||||
@@ -2929,7 +2929,7 @@ public:
|
||||
self.layer.contentsScale = [NSScreen mainScreen].backingScaleFactor;
|
||||
}
|
||||
|
||||
#pragma mark Geometric methods
|
||||
// MARK: Geometric methods
|
||||
|
||||
- (NSPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(nullable NSView *)view {
|
||||
if (!CLLocationCoordinate2DIsValid(coordinate)) {
|
||||
@@ -3024,7 +3024,7 @@ public:
|
||||
return mbgl::Projection::getMetersPerPixelAtLatitude(latitude, self.zoomLevel);
|
||||
}
|
||||
|
||||
#pragma mark Debugging
|
||||
// MARK: Debugging
|
||||
|
||||
- (MGLMapDebugMaskOptions)debugMask {
|
||||
mbgl::MapDebugOptions options = _mbglMap->getDebug();
|
||||
|
||||
@@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@optional
|
||||
|
||||
#pragma mark Responding to Map Viewpoint Changes
|
||||
// MARK: Responding to Map Viewpoint Changes
|
||||
|
||||
/**
|
||||
Tells the delegate that the viewpoint depicted by the map view is about to
|
||||
@@ -87,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (BOOL)mapView:(MGLMapView *)mapView shouldChangeFromCamera:(MGLMapCamera *)oldCamera toCamera:(MGLMapCamera *)newCamera;
|
||||
|
||||
#pragma mark Loading the Map
|
||||
// MARK: Loading the Map
|
||||
|
||||
/**
|
||||
Tells the delegate that the map view will begin to load.
|
||||
@@ -197,7 +197,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (BOOL)mapView:(MGLMapView *)mapView shouldRemoveStyleImage:(NSString *)imageName;
|
||||
|
||||
#pragma mark Managing the Appearance of Annotations
|
||||
// MARK: Managing the Appearance of Annotations
|
||||
|
||||
/**
|
||||
Returns an annotation image object to mark the given point annotation object on
|
||||
@@ -270,7 +270,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (CGFloat)mapView:(MGLMapView *)mapView lineWidthForPolylineAnnotation:(MGLPolyline *)annotation;
|
||||
|
||||
#pragma mark Selecting Annotations
|
||||
// MARK: Selecting Annotations
|
||||
|
||||
/**
|
||||
Returns a Boolean value indicating whether the shape annotation can be selected.
|
||||
@@ -304,7 +304,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)mapView:(MGLMapView *)mapView didDeselectAnnotation:(id <MGLAnnotation>)annotation;
|
||||
|
||||
#pragma mark Managing Callout Popovers
|
||||
// MARK: Managing Callout Popovers
|
||||
|
||||
/**
|
||||
Returns a Boolean value indicating whether the annotation is able to display
|
||||
|
||||
@@ -80,7 +80,7 @@ void Map::triggerRepaint() {
|
||||
impl->onUpdate();
|
||||
}
|
||||
|
||||
#pragma mark - Style
|
||||
// MARK: - Style
|
||||
|
||||
style::Style& Map::getStyle() {
|
||||
return *impl->style;
|
||||
@@ -99,7 +99,7 @@ void Map::setStyle(std::unique_ptr<Style> style) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Transitions
|
||||
// MARK: - Transitions
|
||||
|
||||
void Map::cancelTransitions() {
|
||||
impl->transform.cancelTransitions();
|
||||
@@ -127,7 +127,7 @@ bool Map::isPanning() const {
|
||||
return impl->transform.isPanning();
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
// MARK: -
|
||||
|
||||
CameraOptions Map::getCameraOptions(const optional<EdgeInsets>& padding) const {
|
||||
return impl->transform.getCameraOptions(padding);
|
||||
@@ -293,7 +293,7 @@ LatLngBounds Map::latLngBoundsForCameraUnwrapped(const CameraOptions& camera) co
|
||||
return bounds;
|
||||
}
|
||||
|
||||
#pragma mark - Bounds
|
||||
// MARK: - Bounds
|
||||
|
||||
void Map::setBounds(const BoundOptions& options) {
|
||||
bool changeCamera = false;
|
||||
@@ -350,7 +350,7 @@ BoundOptions Map::getBounds() const {
|
||||
.withMaxPitch(impl->transform.getState().getMaxPitch() * util::RAD2DEG_D);
|
||||
}
|
||||
|
||||
#pragma mark - Map options
|
||||
// MARK: - Map options
|
||||
|
||||
void Map::setSize(const Size size) {
|
||||
impl->transform.resize(size);
|
||||
@@ -383,7 +383,7 @@ MapOptions Map::getMapOptions() const {
|
||||
.withPixelRatio(impl->pixelRatio));
|
||||
}
|
||||
|
||||
#pragma mark - Projection mode
|
||||
// MARK: - Projection mode
|
||||
|
||||
void Map::setProjectionMode(const ProjectionMode& options) {
|
||||
impl->transform.setProjectionMode(options);
|
||||
@@ -394,7 +394,7 @@ ProjectionMode Map::getProjectionMode() const {
|
||||
return impl->transform.getProjectionMode();
|
||||
}
|
||||
|
||||
#pragma mark - Projection
|
||||
// MARK: - Projection
|
||||
|
||||
ScreenCoordinate Map::pixelForLatLng(const LatLng& latLng) const {
|
||||
// If the center and point longitudes are not in the same side of the
|
||||
@@ -427,13 +427,13 @@ std::vector<LatLng> Map::latLngsForPixels(const std::vector<ScreenCoordinate>& s
|
||||
return ret;
|
||||
}
|
||||
|
||||
#pragma mark - Transform
|
||||
// MARK: - Transform
|
||||
|
||||
TransformState Map::getTransfromState() const {
|
||||
return impl->transform.getState();
|
||||
}
|
||||
|
||||
#pragma mark - Annotations
|
||||
// MARK: - Annotations
|
||||
|
||||
void Map::addAnnotationImage(std::unique_ptr<style::Image> image) {
|
||||
if (LayerManager::annotationsEnabled) {
|
||||
@@ -478,7 +478,7 @@ void Map::removeAnnotation(AnnotationID annotation) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Toggles
|
||||
// MARK: - Toggles
|
||||
|
||||
void Map::setDebug(MapDebugOptions debugOptions) {
|
||||
impl->debugOptions = debugOptions;
|
||||
|
||||
@@ -32,7 +32,7 @@ Map::Impl::~Impl() {
|
||||
rendererFrontend.reset();
|
||||
};
|
||||
|
||||
#pragma mark - Map::Impl StyleObserver
|
||||
// MARK: - Map::Impl StyleObserver
|
||||
|
||||
void Map::Impl::onSourceChanged(style::Source& source) {
|
||||
observer.onSourceChanged(source);
|
||||
@@ -109,7 +109,7 @@ void Map::Impl::onStyleError(std::exception_ptr error) {
|
||||
observer.onDidFailLoadingMap(type, description);
|
||||
}
|
||||
|
||||
#pragma mark - Map::Impl RendererObserver
|
||||
// MARK: - Map::Impl RendererObserver
|
||||
|
||||
void Map::Impl::onInvalidate() {
|
||||
onUpdate();
|
||||
|
||||
@@ -43,7 +43,7 @@ Transform::Transform(MapObserver& observer_,
|
||||
: observer(observer_), state(constrainMode, viewportMode) {
|
||||
}
|
||||
|
||||
#pragma mark - Map View
|
||||
// MARK: - Map View
|
||||
|
||||
void Transform::resize(const Size size) {
|
||||
if (size.isEmpty()) {
|
||||
@@ -65,7 +65,7 @@ void Transform::resize(const Size size) {
|
||||
observer.onCameraDidChange(MapObserver::CameraChangeMode::Immediate);
|
||||
}
|
||||
|
||||
#pragma mark - Camera
|
||||
// MARK: - Camera
|
||||
|
||||
CameraOptions Transform::getCameraOptions(const optional<EdgeInsets>& padding) const {
|
||||
return state.getCameraOptions(padding);
|
||||
@@ -341,7 +341,7 @@ void Transform::flyTo(const CameraOptions& camera, const AnimationOptions& anima
|
||||
duration);
|
||||
}
|
||||
|
||||
#pragma mark - Position
|
||||
// MARK: - Position
|
||||
|
||||
void Transform::moveBy(const ScreenCoordinate& offset, const AnimationOptions& animation) {
|
||||
ScreenCoordinate centerOffset = {offset.x, offset.y};
|
||||
@@ -355,13 +355,13 @@ LatLng Transform::getLatLng(LatLng::WrapMode wrap) const {
|
||||
return state.getLatLng(wrap);
|
||||
}
|
||||
|
||||
#pragma mark - Zoom
|
||||
// MARK: - Zoom
|
||||
|
||||
double Transform::getZoom() const {
|
||||
return state.getZoom();
|
||||
}
|
||||
|
||||
#pragma mark - Bounds
|
||||
// MARK: - Bounds
|
||||
|
||||
void Transform::setLatLngBounds(LatLngBounds bounds) {
|
||||
if (!bounds.valid()) {
|
||||
@@ -400,7 +400,7 @@ void Transform::setMaxPitch(const double maxPitch) {
|
||||
state.setMaxPitch(maxPitch * util::DEG2RAD_D);
|
||||
}
|
||||
|
||||
#pragma mark - Bearing
|
||||
// MARK: - Bearing
|
||||
|
||||
void Transform::rotateBy(const ScreenCoordinate& first,
|
||||
const ScreenCoordinate& second,
|
||||
@@ -426,13 +426,13 @@ double Transform::getBearing() const {
|
||||
return state.getBearing();
|
||||
}
|
||||
|
||||
#pragma mark - Pitch
|
||||
// MARK: - Pitch
|
||||
|
||||
double Transform::getPitch() const {
|
||||
return state.getPitch();
|
||||
}
|
||||
|
||||
#pragma mark - North Orientation
|
||||
// MARK: - North Orientation
|
||||
|
||||
void Transform::setNorthOrientation(NorthOrientation orientation) {
|
||||
state.setNorthOrientation(orientation);
|
||||
@@ -447,7 +447,7 @@ NorthOrientation Transform::getNorthOrientation() const {
|
||||
return state.getNorthOrientation();
|
||||
}
|
||||
|
||||
#pragma mark - Constrain mode
|
||||
// MARK: - Constrain mode
|
||||
|
||||
void Transform::setConstrainMode(mbgl::ConstrainMode mode) {
|
||||
state.setConstrainMode(mode);
|
||||
@@ -462,7 +462,7 @@ ConstrainMode Transform::getConstrainMode() const {
|
||||
return state.getConstrainMode();
|
||||
}
|
||||
|
||||
#pragma mark - Viewport mode
|
||||
// MARK: - Viewport mode
|
||||
|
||||
void Transform::setViewportMode(mbgl::ViewportMode mode) {
|
||||
state.setViewportMode(mode);
|
||||
@@ -472,7 +472,7 @@ ViewportMode Transform::getViewportMode() const {
|
||||
return state.getViewportMode();
|
||||
}
|
||||
|
||||
#pragma mark - Projection mode
|
||||
// MARK: - Projection mode
|
||||
|
||||
void Transform::setProjectionMode(const ProjectionMode& options) {
|
||||
state.setProperties(TransformStateProperties()
|
||||
@@ -488,7 +488,7 @@ ProjectionMode Transform::getProjectionMode() const {
|
||||
.withYSkew(state.getYSkew());
|
||||
}
|
||||
|
||||
#pragma mark - Transition
|
||||
// MARK: - Transition
|
||||
|
||||
void Transform::startTransition(const CameraOptions& camera,
|
||||
const AnimationOptions& animation,
|
||||
@@ -620,7 +620,7 @@ void Transform::setGestureInProgress(bool inProgress) {
|
||||
state.setGestureInProgress(inProgress);
|
||||
}
|
||||
|
||||
#pragma mark Conversion and projection
|
||||
// MARK: Conversion and projection
|
||||
|
||||
ScreenCoordinate Transform::latLngToScreenCoordinate(const LatLng& latLng) const {
|
||||
ScreenCoordinate point = state.latLngToScreenCoordinate(latLng);
|
||||
|
||||
@@ -83,7 +83,7 @@ void TransformState::setProperties(const TransformStateProperties& properties) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Matrix
|
||||
// MARK: - Matrix
|
||||
|
||||
void TransformState::matrixFor(mat4& matrix, const UnwrappedTileID& tileID) const {
|
||||
const uint64_t tileScale = 1ull << tileID.canonical.z;
|
||||
@@ -349,7 +349,7 @@ const mat4& TransformState::getInvertedMatrix() const {
|
||||
return invertedMatrix;
|
||||
}
|
||||
|
||||
#pragma mark - Dimensions
|
||||
// MARK: - Dimensions
|
||||
|
||||
Size TransformState::getSize() const {
|
||||
return size;
|
||||
@@ -362,7 +362,7 @@ void TransformState::setSize(const Size& size_) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - North Orientation
|
||||
// MARK: - North Orientation
|
||||
|
||||
NorthOrientation TransformState::getNorthOrientation() const {
|
||||
return orientation;
|
||||
@@ -387,7 +387,7 @@ double TransformState::getNorthOrientationAngle() const {
|
||||
return angleOrientation;
|
||||
}
|
||||
|
||||
#pragma mark - Constrain mode
|
||||
// MARK: - Constrain mode
|
||||
|
||||
ConstrainMode TransformState::getConstrainMode() const {
|
||||
return constrainMode;
|
||||
@@ -400,7 +400,7 @@ void TransformState::setConstrainMode(const ConstrainMode val) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - ViewportMode
|
||||
// MARK: - ViewportMode
|
||||
|
||||
ViewportMode TransformState::getViewportMode() const {
|
||||
return viewportMode;
|
||||
@@ -413,7 +413,7 @@ void TransformState::setViewportMode(ViewportMode val) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Camera options
|
||||
// MARK: - Camera options
|
||||
|
||||
CameraOptions TransformState::getCameraOptions(const optional<EdgeInsets>& padding) const {
|
||||
return CameraOptions()
|
||||
@@ -424,7 +424,7 @@ CameraOptions TransformState::getCameraOptions(const optional<EdgeInsets>& paddi
|
||||
.withPitch(pitch * util::RAD2DEG_D);
|
||||
}
|
||||
|
||||
#pragma mark - EdgeInsets
|
||||
// MARK: - EdgeInsets
|
||||
|
||||
void TransformState::setEdgeInsets(const EdgeInsets& val) {
|
||||
if (edgeInsets != val) {
|
||||
@@ -433,7 +433,7 @@ void TransformState::setEdgeInsets(const EdgeInsets& val) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Position
|
||||
// MARK: - Position
|
||||
|
||||
LatLng TransformState::getLatLng(LatLng::WrapMode wrapMode) const {
|
||||
return {util::RAD2DEG_D * (2 * std::atan(std::exp(y / Cc)) - 0.5 * M_PI), -x / Bc, wrapMode};
|
||||
@@ -449,7 +449,7 @@ double TransformState::pixel_y() const {
|
||||
return center + y;
|
||||
}
|
||||
|
||||
#pragma mark - Zoom
|
||||
// MARK: - Zoom
|
||||
|
||||
double TransformState::getZoom() const {
|
||||
return scaleZoom(scale);
|
||||
@@ -463,7 +463,7 @@ double TransformState::getZoomFraction() const {
|
||||
return getZoom() - getIntegerZoom();
|
||||
}
|
||||
|
||||
#pragma mark - Bounds
|
||||
// MARK: - Bounds
|
||||
|
||||
void TransformState::setLatLngBounds(LatLngBounds bounds_) {
|
||||
if (bounds_ != bounds) {
|
||||
@@ -525,7 +525,7 @@ double TransformState::getMaxPitch() const {
|
||||
return maxPitch;
|
||||
}
|
||||
|
||||
#pragma mark - Scale
|
||||
// MARK: - Scale
|
||||
double TransformState::getScale() const {
|
||||
return scale;
|
||||
}
|
||||
@@ -537,7 +537,7 @@ void TransformState::setScale(double val) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Positions
|
||||
// MARK: - Positions
|
||||
|
||||
double TransformState::getX() const {
|
||||
return x;
|
||||
@@ -561,7 +561,7 @@ void TransformState::setY(double val) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Rotation
|
||||
// MARK: - Rotation
|
||||
|
||||
double TransformState::getBearing() const {
|
||||
return bearing;
|
||||
@@ -625,7 +625,7 @@ void TransformState::setAxonometric(bool val) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - State
|
||||
// MARK: - State
|
||||
|
||||
bool TransformState::isChanging() const {
|
||||
return rotating || scaling || panning || gestureInProgress;
|
||||
@@ -647,7 +647,7 @@ bool TransformState::isGestureInProgress() const {
|
||||
return gestureInProgress;
|
||||
}
|
||||
|
||||
#pragma mark - Projection
|
||||
// MARK: - Projection
|
||||
|
||||
double TransformState::zoomScale(double zoom) const {
|
||||
return roundForAccuracy(std::pow(2.0, zoom));
|
||||
@@ -727,7 +727,7 @@ mat4 TransformState::getPixelMatrix() const {
|
||||
return m;
|
||||
}
|
||||
|
||||
#pragma mark - (private helper functions)
|
||||
// MARK: - (private helper functions)
|
||||
|
||||
bool TransformState::rotatedNorth() const {
|
||||
using NO = NorthOrientation;
|
||||
|
||||
Reference in New Issue
Block a user