3

I implemented Google Maps using import MapView from 'react-native-map-clustering'. By default, when I add markers, clusters start blinking. Similarly, if I place a marker with custom content, it blinks regardless of setting tracksViewChanges={false}.

When I use this Marker configuration (react-native-maps):

   <Marker
      tracksViewChanges={false}
      key={`marker-${val.id}`}
      onPress={() => addressDetailsSelected(val)}
      coordinate={{
        latitude: val.latitude!,
        longitude: val.longitude!,
      }}
      image={require('./../../theme/assets/png/image.png')} // not blinking
      style={{ borderWidth: 1 }}
    />

it works fine. But if I try to add content inside the Marker like:

<Marker
  tracksViewChanges={false}
  key={`marker-${val.id}`}
  onPress={() => addressDetailsSelected(val)}
  coordinate={{
    latitude: val.latitude!,
    longitude: val.longitude!,
  }}
  style={{ borderWidth: 1 }}
>
  <Image
    source={require('./../../theme/assets/png/image.png')}  // start blinking
  />
</Marker>

it displays correctly but blinks. The same issue occurs with clusters, as I want custom clusters showing the number of markers inside, but I can't achieve this using the image prop in the Marker

1
  • It is an open issue, I hope it will get fix in upcoming releases of react-native-maps library, already commented on the issue, would suggest you to follow the thread for the fix: Thread Commented Jul 29 at 7:41

0

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.