GLMapStyleParser
@interface GLMapStyleParser : NSObject
GLMapStyleParser
is calss to parse style and analyze result of parsing
-
Loads resource from path.
Declaration
Objective-C
+ (GLMapResource)loadResourceFromPath:(nonnull NSString *)path name:(nonnull NSString *)name screenScale:(CGFloat)screenScale;
Parameters
path
Directory from where resource will be loaded
name
Name of resource
screenScale
scale of screen
-
Initialize parser without resources
Declaration
Objective-C
- (nonnull instancetype)init;
-
Initialize parser with resources stored in bundle
Declaration
Objective-C
- (nonnull instancetype)initWithBundle:(nonnull NSBundle *)bundle;
Parameters
bundle
Bundle object with Style.mapcss and images
-
Initialize parser with resources stored in paths First it tries to find resource in first path, then in second and so on.
Declaration
Objective-C
- (nonnull instancetype)initWithPaths:(nonnull NSArray<NSString *> *)paths;
Parameters
paths
Paths where style will search for resources
-
Initialize parser with resource block
Declaration
Objective-C
- (nonnull instancetype)initWithBlock:(nonnull GLMapResourceBlock)resourceBlock;
Parameters
resourceBlock
block that will provide resources
-
mask to clamp zoom levels
Declaration
Objective-C
@property (atomic, assign, unsafe_unretained, readwrite) uint32_t clampZoomMask;
-
All options for @if tests found while parsing.
Declaration
Objective-C
@property (atomic, readonly) NSSet<NSString *> *_Nullable allOptions;
-
Error happened while parsing
Declaration
Objective-C
@property (atomic, readonly) NSError *_Nullable error;
-
Sets style options
Declaration
Objective-C
- (void)setOptions:(nonnull NSDictionary<NSString *, NSString *> *)options defaultValue:(BOOL)defaultValue;
Parameters
options
values for options
defaultValue
value used for not set options
-
Parses next chunk of style
Declaration
Objective-C
- (BOOL)parseNextBuffer:(nonnull NSData *)data;
Parameters
data
chunk of style to parse
-
Parses next chunk of style
Declaration
Objective-C
- (BOOL)parseNextString:(nonnull NSString *)string;
Parameters
string
chunk of style to parse
-
Finishes parsing @returns returns result of parsing. If error happened returned value is nil. Check error for details
Declaration
Objective-C
- (GLMapVectorCascadeStyle *_Nullable)finish;
-
Appends data from
Style.mapcss
in resources and finish parsing @returns returns result of parsing. If error happened returned value is nil. Check error for detailsDeclaration
Objective-C
- (GLMapVectorCascadeStyle *_Nullable)parseFromResources;