I am using google-maps-react and I implemented my custom styles to the map. However, when I select a location and the marker is displayed, the styles are being overriden by default map styles.
This is my Map component:
<Map
google={google}
zoom={showMarker ? 18 : 7}
initialCenter={{ lat, lng }}
center={{ lat, lng }}
styles={MapStyleOfficial}
>
{showMarker && <Marker position={{ lat, lng }} />}
</Map>
And this is how I determine if marker should be displayed in my parent component:
setShowMarker(history?.address?.lat !== undefined && history?.address?.lon !== undefined);
Any ideas why are my styles being overriden?
Thank you in advance