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 các tính năng mới sau đây để bạn dùng thử:
Định kiểu bản đồ dựa trên đám mây/Tuỳ chỉnh Maps
Tuỳ chỉnh đường đa tuyến: đường đa tuyến được đóng dấu
Định kiểu bản đồ/tuỳ chỉnh Maps dựa trên đám mây (thử nghiệm)
Giờ đây, bạn có thể tạo kiểu tuỳ chỉnh và sử dụng mã thông báo để chỉ định 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ề việc tuỳ chỉnh Maps cho iOS.
Tuỳ chỉnh đường đa tuyến: đường đa tuyến được đóng dấu
Bạn có thể đặt giao diện của một đường đa tuyến thành hoạ tiết bitmap lặp lại bằng cách sử dụng GMSTextureStyle.
Hình ảnh bao phủ toàn bộ đường kẻ, nhưng sẽ bị cắt ở các điểm cuối và đỉnh.
Để tạo một đường đa tuyến được đóng dấu, hãy tạo một GMSStampStyle của GMSTextureStyle.
Sau đó, hãy đặt thuộc tính này trên đối tượng tuỳ chọn của hình dạng bằng cách sử dụng stampStyle, như minh hoạ dưới đâ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: 2025-06-13 UTC."],[[["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 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"]]