UI customization persists across device rotations and remains in effect until
you detach the
ConsumerController.
Customize markers
To set the marker type and its properties, use the
ConsumerMapStyle.setMarkerStyleOptions()
method. Your custom
marker options override the default values provided by the Consumer SDK.
To restore the default values, call setMarkerStyleOptions() using null
for the MarkerOptions parameter. Retrieve the active MarkerOptions
using
getMarkerStyleOptions().
Select a marker type
You can use and customize the following marker icons:
TRIP_PICKUP_POINT - Displays while following a trip
TRIP_DROPOFF_POINT - Displays while following a trip
TRIP_INTERMEDIATE_DESTINATION
TRIP_VEHICLE - Displays while following a trip
The Consumer SDK updates
the rotation of the TRIP_VEHICLE icon during trip monitoring to mimic the
behavior of the actual vehicle as it travels the route.
Select marker options
You can customize markers for your consumer app by following these steps:
Use the properties for each marker provided by Google Maps MarkerOptions.
Build MarkerOptions using its constructor.
Specify custom properties using 'Setter' style methods.
If you prefer, use your own UI element by mimicking the patterns
provided by the MarkerOptions constructor.
To turn off a marker, set the visible property to false. You can then
use your own UI element in its place.
For more information, see Google Maps
MarkerOptions.
Example marker customizations
Java
// Initializing marker options.consumerController.getConsumerMapStyle().addOnSuccessListener(consumerMapStyle->{consumerMapStyle.setMarkerStyleOptions(MarkerType.TRIP_VEHICLE,newMarkerOptions().visible(false));});// Reset marker options to default values.consumerMapStyle.setMarkerStyleOptions(MarkerType.TRIP_VEHICLE,null);
[[["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-09 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eConsumerMapStyle\u003c/code\u003e class allows you to customize markers and polylines for the consumer experience using setter and getter methods.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize the marker type, appearance, and visibility using the \u003ccode\u003esetMarkerStyleOptions()\u003c/code\u003e method and restore defaults by passing \u003ccode\u003enull\u003c/code\u003e as the \u003ccode\u003eMarkerOptions\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe available marker types include \u003ccode\u003eTRIP_PICKUP_POINT\u003c/code\u003e, \u003ccode\u003eTRIP_DROPOFF_POINT\u003c/code\u003e, \u003ccode\u003eTRIP_INTERMEDIATE_DESTINATION\u003c/code\u003e, and \u003ccode\u003eTRIP_VEHICLE\u003c/code\u003e, which dynamically rotates during trip monitoring.\u003c/p\u003e\n"],["\u003cp\u003eUse the Google Maps \u003ccode\u003eMarkerOptions\u003c/code\u003e properties to customize marker appearance and set \u003ccode\u003evisible\u003c/code\u003e to \u003ccode\u003efalse\u003c/code\u003e to hide a marker and potentially replace it with your own UI element.\u003c/p\u003e\n"],["\u003cp\u003eUI customizations persist across device rotations and remain in effect until the \u003ccode\u003eConsumerController\u003c/code\u003e is detached.\u003c/p\u003e\n"]]],[],null,[]]