Change userLocation puck color using MapBox v10

631 Views Asked by At

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?

1

There are 1 best solutions below

0
Val Moratalla On

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)