GLMapBalloon
Objective-C
@interface GLMapBalloon : GLMapDrawable
Swift
class GLMapBalloon : GLMapDrawable
GLMapBalloon
is used to draw a balloon with text on the map.
-
Initializes an empty balloon that will be displayed with the given drawOrder.
Declaration
Objective-C
- (nonnull instancetype)initWithDrawOrder:(int32_t)drawOrder;
Swift
init(drawOrder: Int32)
Parameters
drawOrder
The drawOrder of the object.
-
Sets the background image of the balloon.
Declaration
Objective-C
- (void)setBackgroundImage:(nonnull PlatformImage *)image insets:(PlatformEdgeInsets)insets;
Swift
func setBackgroundImage(_ image: NSImage, insets: PlatformEdgeInsets)
Parameters
image
The image to set.
insets
The insets of the background image.
-
Sets the text of the balloon.
See
Declaration
Objective-C
- (void)setText:(nonnull NSString *)text withStyle:(nonnull GLMapVectorStyle *)style insets:(PlatformEdgeInsets)insets completion:(dispatch_block_t _Nullable)completion;
Swift
func setText(_ text: String, with style: GLMapVectorStyle, insets: PlatformEdgeInsets) async
Parameters
text
The new text.
style
The style object used for the text.
insets
The insets of the text.
completion
A block called when the balloon is ready to draw with the new text.
-
Sets the reference angle to detect the direction of the balloon.
Declaration
Objective-C
- (void)setReferenceAngle:(float)referenceAngle;
Swift
func setReferenceAngle(_ referenceAngle: Float)
Parameters
referenceAngle
The reference angle.
-
Sets the positions where the balloon can be displayed.
Declaration
Objective-C
- (void)setPossiblePositions:(nonnull const GLTrackSampleResult *)positions count:(NSUInteger)count;
Swift
func setPossiblePositions(_ positions: UnsafePointer<GLTrackSampleResult>, count: UInt)
Parameters
positions
The positions to set.
count
The number of positions.
-
If set to
true
, the position nearest to the center of the screen will be selected.Declaration
Objective-C
- (void)setPlaceToCenter:(BOOL)placeToCenter;
Swift
func setPlaceToCenter(_ placeToCenter: Bool)
Parameters
placeToCenter
The value to set.