GLMapScaleRuler
Objective-C
@interface GLMapScaleRuler : GLMapDrawObject
Swift
class GLMapScaleRuler : GLMapDrawObject
GLMapScaleRuler draws a scale ruler on the screen.
-
Initializes an empty scale ruler that will be displayed with the given drawOrder.
Declaration
Objective-C
- (nonnull instancetype)initWithDrawOrder:(int32_t)drawOrder;Swift
init(drawOrder: Int32)Parameters
drawOrderThe drawOrder of the object.
-
Sets the text at the bottom of the ruler. It’s used to display map center coordinates or any other useful information.
Declaration
Objective-C
- (void)setBottomText:(NSString *_Nullable)text;Swift
func setBottomText(_ text: String?) -
Sets the style of the text at the bottom of the ruler. The default is “{font-size:11; text-color:black; fill-color:#000000B2; font-stroke-width:2pt; font-stroke-color:#FFFFFF99;}”
Declaration
Objective-C
- (void)setBottomTextStyle:(nonnull GLMapVectorStyle *)style;Swift
func setBottomTextStyle(_ style: GLMapVectorStyle) -
Sets the scale ruler placement and maximum width. Example:
[_scaleRuler setPlacement:GLMapPlacement_BottomLeft paddings:CGPointMake(5, 5) maxWidth:300];Declaration
Objective-C
- (void)setPlacement:(GLMapPlacement)placement paddings:(CGPoint)paddings maxWidth:(float)maxWidth;Swift
func setPlacement(_ placement: GLMapPlacement, paddings: CGPoint, maxWidth: Float)Parameters
placementThe placement of the text.
paddingsPadding from the screen edge in points.
maxWidthMaximum width of the scale in points.
Install in Dash