Bitmap overlay centered at the start or end vertex of a Polyline, orientated according to
the direction of the line's first or last edge and scaled with respect to the line's stroke
width. CustomCap can be applied to Polyline with any stroke pattern.
Descriptor of the bitmap to be overlaid at the start or end vertex.
public
final
float
refWidth
Reference stroke width (in pixels) - the stroke width for which the cap bitmap at its native
dimension is designed. The default reference stroke width is 10 pixels.
Public Constructors
public
CustomCap(BitmapDescriptor bitmapDescriptor, float refWidth)
Constructs a new CustomCap.
Parameters
bitmapDescriptor
Descriptor of the bitmap to be used. Must not be null.
refWidth
Stroke width, in pixels, for which the cap bitmap at its native dimension is
designed. Must be positive.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-15 UTC."],[[["\u003cp\u003e\u003ccode\u003eCustomCap\u003c/code\u003e allows you to customize the start and end points of a \u003ccode\u003ePolyline\u003c/code\u003e on a map using a bitmap image.\u003c/p\u003e\n"],["\u003cp\u003eIt uses a \u003ccode\u003eBitmapDescriptor\u003c/code\u003e to define the image and a \u003ccode\u003erefWidth\u003c/code\u003e to scale the image relative to the \u003ccode\u003ePolyline\u003c/code\u003e's stroke width.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a \u003ccode\u003eCustomCap\u003c/code\u003e with a custom reference width or use the default value of 10 pixels.\u003c/p\u003e\n"],["\u003cp\u003eThe bitmap image is centered and oriented based on the direction of the \u003ccode\u003ePolyline\u003c/code\u003e's first or last edge.\u003c/p\u003e\n"]]],["`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"],null,[]]