Search code examples
javaandroidmapboxmapbox-marker

Android MapBox change style of MyLocation marker


I'm using the MapBox API for Android (v5.1). I managed to get it to work all fine and I'm using a custom style (the light style but slightly modified).
I've enabled MyLocation and it is also working just fine. But the dot (or marker) that displays my location on the map (in GoogleMaps it's blue) has is light grey so it's barely visible on the map. Screenshot of the map with marker Is there any way to change it's color? I already tried to get the belongong layer but I couldn't find it, neither in the MapBox Studio nor in Android. Where can I customize it?

I found one possible solution (althoug it's meant for Google Maps) that would also work but that is - in my opinion - not a good solution.


Solution

  • You should be able to change those settings through the MyLocationViewSettings object and the method setForegroundTintColor.

    If you already have a MapboxMap, you can configure it through MapboxMapOptions when calling newInstance, but you may only change the accuracy tint color.