GLMapVectorStyle
Objective-C
@interface GLMapVectorStyle : NSObject
Swift
class GLMapVectorStyle : NSObject
GLMapVectorStyle
is used to define appearance of text inside GLMapMarkerLayer
or GLMapView
.
Style is used to render a map, which is stored inside DefaultStyle.bundle/Style.mapcss file. Detailed MapCSS specification is located at: http://www.mapcss.org
-
Unavailable
Please use
[GLMapVectorStyle createStyle:]
and[GLMapVectorStyle createStyle:error:]
Plain -init is disabled
Declaration
Objective-C
- (nonnull instancetype)init;
-
Creates style object.
GLMapVectorStyle *style = [GLMapVectorStyle createStyle(@"{font-size:12;}"];
Declaration
Objective-C
+ (nullable instancetype)createStyle:(nonnull NSString *)style;
Swift
class func createStyle(_ style: String) -> Self?
Parameters
style
NSString with style rule in MapCSS format
Return Value
New
GLMapVectorStyle
object -
Creates style object.
Declaration
Objective-C
+ (nullable instancetype)createStyle:(nonnull NSString *)style error:(NSError *_Nullable *_Nullable)error;
Swift
class func createStyle(_ style: String, error: ()) throws -> Self
Parameters
style
NSString with style rule in MapCSS format
error
Error is filled if object cannot be created
Return Value
New
GLMapVectorStyle
object -
Adds custom function
Declaration
Objective-C
+ (void)addCustomFunctionWitName:(nonnull NSString *)name flags:(FunctionFlag)flags callback:(nonnull GLMapFunction)callback;
Swift
class func addCustomFunctionWitName(_ name: String, flags: FunctionFlag, callback: @escaping GLMapFunction)
Parameters
name
name of function
flags
flags of function
callback
function callback
-
Creates style with given iconName and iconTint
Declaration
Objective-C
- (nonnull instancetype)initWithIconName:(nonnull NSString *)iconName andIconTint:(GLMapColor)iconTint;
Swift
init(iconName: String, andIconTint iconTint: GLMapColor)
Parameters
iconName
name of icon
iconTint
tint color of icon
Return Value
New
GLMapVectorStyle
object -
Resolved value of ‘icon-image’ attribute.
Declaration
Objective-C
@property (readonly) GLMapValue *_Nullable iconName;
Swift
var iconName: GLMapValue? { get }
-
Resolved value of ‘icon-tint’ attribute.
Declaration
Objective-C
@property (readonly) GLMapColor iconTint;
Swift
var iconTint: GLMapColor { get }
-
Resolved value of ‘icon-scale’ attribute.
Declaration
Objective-C
@property (readonly) CGFloat iconScale;
Swift
var iconScale: CGFloat { get }
-
Resolved value of ‘text’ attribute.
Declaration
Objective-C
@property (readonly) GLMapValue *_Nullable text;
Swift
var text: GLMapValue? { get }
-
Subset of parameters that defines only text style
Declaration
Objective-C
@property (readonly) GLMapVectorStyle *_Nullable textStyleSubset;
Swift
var textStyleSubset: GLMapVectorStyle? { get }
-
Resolved value of ‘details-text’ attribute.
Declaration
Objective-C
@property (readonly) GLMapValue *_Nullable detailsText;
Swift
var detailsText: GLMapValue? { get }
-
Resolved value of ‘details-description’ attribute.
Declaration
Objective-C
@property (readonly) GLMapValue *_Nullable detailsDescription;
Swift
var detailsDescription: GLMapValue? { get }