Maps SDK for iOS v3.10.0 Beta

Maps SDK for iOS v3.10.0 Beta memperkenalkan fitur baru berikut untuk Anda coba:

  • Penyesuaian peta Gaya Visual Peta Berbasis Cloud
  • Penyesuaian polyline: polyline berstempel

Penyesuaian peta Gaya Visual Peta Berbasis Cloud (beta)

Sekarang Anda dapat membuat gaya kustom, dan menggunakan token untuk menetapkannya ke peta di aplikasi dan situs Anda. Untuk mengetahui informasi selengkapnya, lihat Ringkasan Penyesuaian Peta iOS.

Penyesuaian polyline: polyline berstempel

Anda dapat menetapkan tampilan polyline ke tekstur bitmap berulang menggunakan GMSTextureStyle. Gambar menutupi garis sepenuhnya, tetapi terpotong di sekitar titik akhir dan verteks.

Untuk membuat polyline berstempel, buat GMSStampStyle dari GMSTextureStyle. Kemudian, tetapkan properti ini pada objek opsi bentuk menggunakan stampStyle, seperti yang ditunjukkan di sini:

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;