Custom GPS Indicator
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];
![]() Default GPS indicator active |
![]() 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];
![]() Default GPS indicator inactive |
![]() Custom GPS indicator inactive |
Use the following code to set the GPS indicator to inactive:
_
gpsIndicator.setDimmed(true)
[gpsIndicator setDimmed:YES];