0

Markers (whether custom or default) aren't showing on my map. I tried using custom markers using Image and view components too.. still no success. Please help...ask me for more details if you want..

My RN version = 0.80.1 react-native-maps = 1.21.0 newArchEnabled false

my code is as under

import MapView {Marker, PROVIDER_GOOGLE} from 'react-native-maps';

//other part of the code

return(
<View style={{ flex: 1, backgroundColor: '#0000' }}>
      <MapView
        ref={mapRef}
        style={StyleSheet.absoluteFillObject}
        provider={PROVIDER_GOOGLE}
        initialRegion={{
          latitude: 20.5937,
          longitude: 78.9629,
          latitudeDelta: 40,
          longitudeDelta: 40,
        }}
        onMapReady={() => {
          console.log('---MAP_READY---', agentLoc);
          if (agentLoc?.latitude && agentLoc?.longitude) {
            setTimeout(() => animateTo(agentLoc, 'READY_TO_AGENT'), 200);
          }
        }}
        onLayout={() => {
          console.log('---MAP_LAYOUT---', agentLoc);
          if (agentLoc?.latitude && agentLoc?.longitude) {
            setTimeout(() => animateTo(agentLoc, 'LAYOUT_TO_AGENT'), 200);
          }
        }}
      >
        {agentLoc && (
          <Marker
           identifier="agent"
           coordinate={{ latitude: Number(agentLoc.latitude), longitude:Number(agentLoc.longitude) }}
          title="Agent"
          pinColor="tomato"
          />
         )} 
      </MapView>
  </View>
)
4
  • Have you tried to go back to 1.20.1 at least or older to get oldArch support? Commented Oct 24 at 11:48
  • I just did! before reading your comment.. just about a min ago i switched to 1.18.0 and it worked! You should have Answered it instead of commenting. I would have given you a green tick lol Commented Oct 24 at 12:08
  • 1
    I wasn't sure it was going to work, so I preferred to put a comment. Glad it worked out for you. Commented Oct 24 at 12:14
  • kept my promise Commented Oct 24 at 12:23

1 Answer 1

1

You need to use an older version of react-native-maps that support eh old architecture.

The version 1.20.1 or lower will make the markers appear again.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you so much!! i switched to 1.18.0 and it worked!!
i tried everything from 1.20 onwards, nothing worked but switching back to 1.18.0 did

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.