AI-generated Key Takeaways
-
GMSSpriteStyledefines how stamp images are drawn overGMSStyleSpanon a map, using transparent backgrounds. -
It requires enabling Metal rendering framework through
GMSServices::setMetalRendererEnabled:(BOOL)for proper functionality. -
If Metal is not enabled, the stamp might not render and the
GMSStyleSpanwill fallback to its color or a default color. -
You can create a
GMSSpriteStyleinstance usingspriteStyleWithImage:orinitWithImage:by providing aUIImage. -
GMSMapView::mapCapabilitiescan be used to check if aGMSMapViewsupportsGMSSpriteStyle.
GMSSpriteStyle
@interface GMSSpriteStyle : GMSStampStyleDescribes the drawing style for a stamp image over a GMSStyleSpan.
Note
Only supports transparent background. If any color is set to the GMSStyleSpan it will
only be treated as a fallback.
Note
Use of GMSSpriteStyle requires Metal rendering framework. See
GMSServices::setMetalRendererEnabled:(BOOL) to learn how to enable Metal. If GMSStyleSpan is
added to a map without Metal being enabled, the stamp will not render and instead the polyline
span will attempt to fallback to any set color. If no color is set, it will fallback to the
default polyline color, [UIColor blueColor].
Note
Use GMSMapView::mapCapabilities property to query if a GMSMapView supports
GMSSpriteStyle.
-
Returns a sprite stamp style with the given image.
Declaration
Objective-C
+ (nonnull instancetype)spriteStyleWithImage:(nonnull UIImage *)image;Parameters
imageA
UIImageobject to use as the stamp image.Return Value
An initialized sprite stamp style.
-
Returns an initialized sprite stamp style with the given image.
Declaration
Swift
init(image: UIImage)Objective-C
- (nonnull instancetype)initWithImage:(nonnull UIImage *)image;Parameters
imageA
UIImageobject to use as the stamp image.Return Value
An initialized sprite stamp style.