GLMapVectorCascadeStyle

Objective-C


@interface GLMapVectorCascadeStyle : NSObject

Swift

class GLMapVectorCascadeStyle : NSObject

GLMapVectorCascadeStyle is used to define appearance of GLMapVectorObject. One style could be used with many GLMapVectorObjects. Style is used to render a map, which is stored inside DefaultStyle.bundle/Style.mapcss. Detailed MapCSS specification is located at: http://www.mapcss.org MapCSS examples: Any point with tag natural=peak, should be displayed on zoom level 11+ with trangle icon tinted with brown color.

node|z11-[natural=peak] {
icon-image:"triangle.svg";
icon-tint:brown;
}

Any point with tag natural=peak, should display it’s localized name on zoom level 13+.

node|z13-[natural=peak] {
text: eval( locTag('name') );
text-color:brown;
font-size:12;
}
  • Unavailable

    Please use [GLMapVectorCascadeStyle createStyle:] or [GLMapVectorCascadeStyle createStyle:error:]

    Unavailable. Please use [GLMapVectorCascadeStyle createStyle:] or [GLMapVectorCascadeStyle createStyle:error:].

    Declaration

    Objective-C

    - (instancetype _Nonnull)init;
  • Helper to parse style wihtout GLMapVectorCascadeStyle *style = [GLMapVectorCascadeStyle createStyle(@"area{fill-color:#10106050;}"];

    Declaration

    Objective-C

    + (instancetype _Nullable)createStyle:(nonnull NSString *)style;

    Swift

    class func createStyle(_ style: String) -> Self?

    Parameters

    style

    NSString with style rules in MapCSS format

    Return Value

    New GLMapVectorCascadeStyle object

  • Create optimized version of style with resolved zoom tests

    Declaration

    Objective-C

    - (nonnull GLMapVectorCascadeStyle *)opimizedForZoomRange:(NSRange)range;

    Swift

    func opimized(forZoom range: NSRange) -> GLMapVectorCascadeStyle

    Parameters

    range

    valid zooms range

    Return Value

    optimzed version of style

  • Sets custom tint function for loading svg files

    Declaration

    Objective-C

    - (void)setTintFunction:(nonnull TintFunctionBlock)function
                   cacheKey:(nonnull NSString *)cacheKey;

    Swift

    func setTintFunction(_ function: @escaping TintFunctionBlock, cacheKey: String)

    Parameters

    function

    custom tint function

    cacheKey

    unique key used for caching

  • Updates draw attributes of vector object. @mapView view where object is displayed @mapState map state to calulate all parameters or null to leave them as is @zoomLevel zoom level to test

    Declaration

    Objective-C

    - (BOOL)updateDrawAttributesOfVectorObject:(nonnull GLMapVectorObject *)object
                                      mapState:(GLMapViewState *_Nullable)mapState
                                  forZoomLevel:(int)zoomLevel;

    Swift

    func updateDrawAttributes(of object: GLMapVectorObject, mapState: GLMapViewState?, forZoomLevel zoomLevel: Int32) -> Bool

    Return Value

    true if visible

  • Returns all “icon-image” from style

    Declaration

    Objective-C

    - (nonnull NSSet<NSString *> *)allIconNames;

    Swift

    func allIconNames() -> Set<String>

    Return Value

    all “icon-image” from style