GLMapScaleRuler
Objective-C
@interface GLMapScaleRuler : GLMapDrawObject
Swift
class GLMapScaleRuler : GLMapDrawObject
GLMapScaleRuler
draws a scale ruler on screen
-
Initializes empty balloon that will be displayed with given drawOrder
Declaration
Objective-C
- (nonnull instancetype)initWithDrawOrder:(int32_t)drawOrder;
Swift
init(drawOrder: Int32)
Parameters
drawOrder
drawOrder of object
-
Sets text at the bottom of 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 style of text at the bottom of ruler. Defaul 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 style of the scale ruler. //Sets scale ruler position to the bottom center part of screen. And width to half of screen width [_mapView setScalePlacement: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
placement
placement of text
paddings
paddings of scale ruler
maxWidth
maxWidth of scale hit in points
-
Sets block that called when ruler value is updated. Block allows to translate units and use custom digit format inside ruler.
Declaration
Objective-C
- (void)setTextFormatterBlock:(nonnull GLMapScaleRulerTextFormatterBlock)block;
Swift
func setTextFormatterBlock(_ block: @escaping GLMapScaleRulerTextFormatterBlock)
Parameters
block
New text formatter block