Can you customize the current location marker in react native maps?

MonkeyBonkey picture MonkeyBonkey · May 7, 2018 · Viewed 7.2k times · Source

I'd like to use a custom marker image instead of the pulsing blue dot - is there a way to customize this in react native maps using apple maps for ios and google maps for Android?

Answer

Phil Mok picture Phil Mok · May 7, 2018

As far as I know, you cannot change the default current location dot. A work around is to pass the user's location into a <Marker /> with your custom image and turn off showsUserLocation to hide the default blue dot. Here are the Marker docs.

Then you can track the user's location using Geolocation.watchPosition. If you set the user's location to state it will trigger a rerender when the user moves.