Custom GPS Indicator

The Maps SDK provides the ability to change the GPS Indicator inaccuracy area color at runtime. Default behavior of the indicator consists of two states: active, when GPS signal is accurate, and inactive (dimmed).

To change both radius colors, first you need to obtain the current GPS Indicator by using the following method:

let gpsIndicator = mapview.trackingManager.currentPosition as? TTCurrentPositionTrackingObject
TTCurrentPositionTrackingObject *gpsIndicator = self.mapView.trackingManager.currentPosition

Use the following code to adjust a color of the active GPS indicator:

gpsIndicator.setInaccuracyAreaColor(GPS_ACTIVE_RADIUS_COLOR)
[gpsIndicator setInaccuracyAreaColor:GPS_ACTIVE_RADIUS_COLOR];

image

Default GPS indicator active

image

Custom GPS indicator active

Use the following code to adjust a color of the inactive GPS indicator:

gpsIndicator.setDimmedInaccuracyAreaColor(GPS_INACTIVE_RADIUS_COLOR)
[gpsIndicator setDimmedInaccuracyAreaColor:GPS_INACTIVE_RADIUS_COLOR];

image

Default GPS indicator inactive

image

Custom GPS indicator inactive

Use the following code to set the GPS indicator to inactive:

gpsIndicator.setDimmed(true)
[gpsIndicator setDimmed:YES];