New basemap styling is coming soon to Google Maps Platform. This update to map styling includes a new default color palette, modernized pins, and improvements to map experiences and usability. All map styles will be automatically updated in March 2025. For more information on availability and how to opt in earlier, see New map style for Google Maps Platform.
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-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"]]