AI-generated Key Takeaways
-
The Beta version of the Maps SDK for iOS is being deprecated and will be decommissioned; features accessed through it will be supported in a future SDK version.
-
This Beta release (v3.10.0) introduces Cloud-Based Map Styling for customizing maps in apps and websites.
-
This release also includes Polyline Customization, allowing developers to apply repeating bitmap textures to polylines using
GMSTextureStyle
.
The Maps SDK for iOS v3.10.0 Beta introduces the following new features for you to try:
- Cloud-Based Map Styling map customization
- Polyline customization: stamped polylines
Cloud-Based Map Styling map customization (beta)
You can now create custom styles, and use tokens to assign them to maps in your apps and websites. For more information, see the see the iOS Maps Customization Overview.
Polyline customization: stamped polylines
You can set the appearance of a polyline to a repeating bitmap texture by using
GMSTextureStyle
. The images cover the line completely, but are cut off
around end points and vertices.
To create a stamped polyline, create a GMSStampStyle
of GMSTextureStyle
.
Then set this property on the shape's options object by using stampStyle
, as
shown here:
Swift
let path = GMSMutablePath() path.addLatitude(-37.81319, longitude: 144.96298) path.addLatitude(-31.95285, longitude: 115.85734) let polyline = GMSPolyline(path: path) let redWithStamp = GMSStrokeStyle.solidColor(.red) let image = UIImage(named: "imageFromBundleOrAsset")! // Image could be from anywhere redWithStamp.stampStyle = GMSTextureStyle(image: image) let span = GMSStyleSpan(style: redWithStamp) polyline.spans = [span] polyline.map = mapView
Objective-C
GMSMutablePath *path = [GMSMutablePath path]; [path addLatitude:-37.81319 longitude:144.96298]; [path addLatitude:-31.95285 longitude:115.85734]; GMSPolyline *polyline = [GMSPolyline polylineWithPath:path]; GMSStrokeStyle *redWithStamp = [GMSStrokeStyle solidColor:[UIColor redColor]]; UIImage *image = [UIImage imageNamed:@"imageFromBundleOrAsset"]; // Image could be from anywhere redWithStamp.stampStyle = [GMSTextureStyle textureStyleWithImage:image]; GMSStyleSpan *span = [GMSStyleSpan spanWithStyle:redWithStamp]; polyline.spans = @[span]; polyline.map = mapView;