Lớp phủ bitmap có căn giữa ở đỉnh bắt đầu hoặc kết thúc của Polyline, được định hướng theo hướng của cạnh đầu tiên hoặc cạnh cuối cùng của dòng và được điều chỉnh theo tỷ lệ theo chiều rộng nét của đường kẻ. Có thể áp dụng CustomCap cho Polyline bằng mẫu vẽ bất kỳ.
Phần mô tả của bitmap cần được phủ lên ở đỉnh bắt đầu hoặc kết thúc.
public
cuối cùng
float
refWidth
Chiều rộng nét tham chiếu (tính bằng pixel) – chiều rộng nét vẽ mà bitmap giới hạn ở kích thước gốc được thiết kế. Độ rộng nét vẽ tham chiếu mặc định là 10 pixel.
Công ty xây dựng công cộng
public
CustomCap(BitmapDescriptor bitmapDescriptor, float refWidth)
Tạo một CustomCap mới.
Các tham số
bitmapDescriptor
Phần mô tả của bitmap được sử dụng. Không được là null.
refWidth
Chiều rộng nét (tính bằng pixel) mà bitmap giới hạn ở kích thước gốc được thiết kế. Phải dương.
[[["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-03-21 UTC."],[[["`CustomCap` allows you to customize the start and end points of a `Polyline` on a map using a bitmap image."],["It uses a `BitmapDescriptor` to define the image and a `refWidth` to scale the image relative to the `Polyline`'s stroke width."],["You can create a `CustomCap` with a custom reference width or use the default value of 10 pixels."],["The bitmap image is centered and oriented based on the direction of the `Polyline`'s first or last edge."]]],["`CustomCap` overlays a bitmap at a `Polyline`'s start or end, adjusting its orientation and scaling based on the line's stroke width. Key actions include creating a `CustomCap` using a `BitmapDescriptor` and optionally a reference stroke width (`refWidth`). The `bitmapDescriptor` defines the bitmap to use and the refWidth is for scaling. There are methods such as `toString`, `equals`, and `hashCode` for information purposes.\n"]]