SDK Bản đồ dành cho iOS phiên bản 3.10.0 Beta
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
SDK bản đồ dành cho iOS phiên bản 3.10.0 Beta giới thiệu những tính năng mới sau đây để bạn dùng thử:
Tuỳ chỉnh bản đồ bằng tính năng Định kiểu bản đồ dựa trên đám mây
Tuỳ chỉnh đường nhiều đoạn: đường nhiều đoạn được đóng dấu
Tuỳ chỉnh bản đồ bằng tính năng Định kiểu bản đồ dựa trên đám mây (bản thử nghiệm)
Giờ đây, bạn có thể tạo kiểu tuỳ chỉnh và dùng mã thông báo để chỉ định các kiểu đó cho bản đồ trong ứng dụng và trang web của mình. Để biết thêm thông tin, hãy xem bài viết Tổng quan về hoạt động tuỳ chỉnh Maps trên iOS.
Tuỳ chỉnh đường nhiều đoạn: đường nhiều đoạn được đóng dấu
Bạn có thể đặt giao diện của một hình nhiều đường thành một hoạ tiết bitmap lặp lại bằng cách sử dụng GMSTextureStyle. Các hình ảnh này bao phủ hoàn toàn đường kẻ, nhưng bị cắt ở các điểm cuối và đỉnh.
Để tạo một đường nhiều đoạn được đóng dấu, hãy tạo một GMSStampStyle gồm GMSTextureStyle.
Sau đó, hãy đặt thuộc tính này trên đối tượng lựa chọn của hình dạng bằng cách sử dụng stampStyle, như minh hoạ ở đây:
Swift
letpath=GMSMutablePath()path.addLatitude(-37.81319,longitude:144.96298)path.addLatitude(-31.95285,longitude:115.85734)letpolyline=GMSPolyline(path:path)letredWithStamp=GMSStrokeStyle.solidColor(.red)letimage=UIImage(named:"imageFromBundleOrAsset")!// Image could be from anywhereredWithStamp.stampStyle=GMSTextureStyle(image:image)letspan=GMSStyleSpan(style:redWithStamp)polyline.spans=[span]polyline.map=mapView
Objective-C
GMSMutablePath*path=[GMSMutablePathpath];[pathaddLatitude:-37.81319longitude:144.96298];[pathaddLatitude:-31.95285longitude:115.85734];GMSPolyline*polyline=[GMSPolylinepolylineWithPath:path];GMSStrokeStyle*redWithStamp=[GMSStrokeStylesolidColor:[UIColorredColor]];UIImage*image=[UIImageimageNamed:@"imageFromBundleOrAsset"];// Image could be from anywhereredWithStamp.stampStyle=[GMSTextureStyletextureStyleWithImage:image];GMSStyleSpan*span=[GMSStyleSpanspanWithStyle:redWithStamp];polyline.spans=@[span];polyline.map=mapView;
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2026-05-20 UTC."],[],["The Beta SDK is deprecated and unavailable for new use. The Maps SDK for iOS v3.10.0 Beta introduces cloud-based map styling, allowing custom style creation and token assignment. It also introduces stamped polyline customization. To create a stamped polyline, a `GMSStampStyle` of `GMSTextureStyle` must be created and applied to the shape's options using `stampStyle`. Code examples in Swift and Objective-C demonstrate setting a repeating bitmap texture on a polyline.\n"]]