'Change userLocation puck color using MapBox v10

I’m working on migrating my MapBox version from v6.4 to v10.

I have been able to migrate almost everything, only issue I have at the moment is changing the userLocation puck tintColor.

What I was doing on v6.4 was changing the color in mapView.tintColor where mapView is an object of MKMapView class. Right now, changing the tintColor will only update the attributionButton color.

Do you have any suggestion?



Solution 1:[1]

As of Mapbox v10.4.3, the solution that works for me is by adding a custom circle image with solid color instead.

 let configuration = Puck2DConfiguration(topImage: UIImage(named: "circleSolidColor"))
 mapView.location.options.puckType = .puck2D(configuration)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Val Moratalla