pramod J B
pramod J B

Reputation: 77

How to change GoogleMap marker pin and dot color using react native

how can i change marker pin dot color. i changed marker pin color but dot color is not changed. please help me.

<Marker
   coordinate={destination} centerOffset={{ x: -18, y: -60 }} anchor={{
   x: 0.69, y: 1 }} pinColor={colors.zyberia.primary} />:null}
   {destination != null? <MapViewDirections origin={origin}
   destination={destination} apikey={apiKey} strokeWidth={3}
   strokeColor={colors.zyberia.primary} />:null}enter code here
   </MapView.Animated>

Upvotes: 0

Views: 867

Answers (1)

Panicum
Panicum

Reputation: 824

What you mean by ,,marker dot color''?

Below I am pasting code that is working to change marker style with color in my app, I am using 'react-native-maps' library:

<Marker
   coordinate={spot.coords}>
   title={spot.name}
   <View style={styles.marker}>
      <Entypo name="location-pin" size={24} color="#344163"/>
   </View>
</Marker>

And styles.marker :

marker: {
 width: 40,
 height: 40,
 borderRadius: 40,
 justifyContent: 'center',
 alignItems: 'center',
 borderWidth: 1,
 borderColor: '#FFF',
},

And marker created by this code looks like this: enter image description here

Upvotes: 1

Related Questions