Files
MapLibreParticleLab/platform/darwin/src/NSArray+MLNAdditions.h
mwilsnd 20d9e1028c Platform flattening overhaul (#1393)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
2023-07-26 17:50:34 +02:00

28 lines
880 B
Objective-C

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <mbgl/util/feature.hpp>
@interface NSArray (MLNAdditions)
- (std::vector<mbgl::Value>)mgl_vector;
/** Returns a string resulting from inserting a separator between each attributed string in the array */
- (NSAttributedString *)mgl_attributedComponentsJoinedByString:(NSString *)separator;
/**
Converts std::vector<CLLocationCoordinate> into an NSArray containing dictionary
representations of coordinates with the following structure:
[{"latitude": lat, "longitude": lng}]
*/
+ (NSArray *)mgl_coordinatesFromCoordinates:(std::vector<CLLocationCoordinate2D>)coords;
/**
Converts the receiver into a std::vector<CLLocationCoordinate>.
Receiver must conform to the following structure:
[{"latitude": lat, "longitude": lng}]
*/
- (std::vector<CLLocationCoordinate2D>)mgl_coordinates;
@end