react-native-map-clustering icon indicating copy to clipboard operation
react-native-map-clustering copied to clipboard

Default Pins Appear On Top of Clusters (iOS Only)

Open lucianod-airble opened this issue 3 years ago • 4 comments

I am using the following packages and platforms:

expo: "5.4.12"
react-native: "0.68.2"
react-native-map-clustering: "3.4.2"
react-native-maps:  "0.30.2"

I am seeing the following behaviour on iOS:

It seems that when a cluster of pins is created it is possible for one of the default red pins to appear (it does not always happen). Once one of the default pins appears it stays in place regardless of how much I pan or zoom on the map.

I have the following MapView:

<MapView
        initialRegion={initialRegion}
        onRegionChange={(r) => (region.current = r)}
        minPoints={4}
        extent={250}
        style={{ height: "100%" }}
        showsUserLocation={true}
        showsPointsOfInterest={false}
        showsMyLocationButton={true}
        customMapStyle={[
          {
            featureType: "poi",
            stylers: [
              {
                visibility: "off",
              },
            ],
          },
        ]}
      >
        {markerList.map((markerInfo) => {
          const { lat, lon, icon, id, airport } = markerInfo;

          return !lat || !lon ? null : (
            <Marker
              tracksViewChanges={false}
              coordinate={{
                latitude: lat as number,
                longitude: lon as number,
              }}
              key={id}
              onPress={() => {
                selectedAirport.current = airport;
                setAirportModal(true);
              }}
              image={icon}
              icon={icon}
            />
          );
        })}
      </MapView>

I have tried a couple of different methods for custom pins including using Svg components, using custom components, and using Image components from react-native, but I can't find anything that prevents these default pins from appearing or what the cause of the issue is.

lucianod-airble avatar Jul 08 '22 01:07 lucianod-airble

I have this problem too.

aeminkyr avatar Jul 25 '22 11:07 aeminkyr

Any updates on this guys?

ro-mgh avatar Aug 31 '22 14:08 ro-mgh

@lucianod-airble @aeminkyr I solved following this patch to reanimated: https://github.com/l-barbosa/react-native-maps-reanimated-issue/blob/master/patches/react-native-reanimated%2B2.8.0.patch

ro-mgh avatar Aug 31 '22 16:08 ro-mgh

@lucianod-airble @aeminkyr I solved following this patch to reanimated: https://github.com/l-barbosa/react-native-maps-reanimated-issue/blob/master/patches/react-native-reanimated%2B2.8.0.patch

Thank you @ro-mgh! I won't be able to verify this fix for awhile, but you are not seeing this issue after the patch?

ghost avatar Aug 31 '22 16:08 ghost

Have anybody found a solution for this problem? For me the patch did not worked.

vladmarintremend avatar Oct 21 '22 08:10 vladmarintremend

@vladmarintremend, check the version: "react-native-map-clustering": "3.4.2", "react-native-reanimated": "2.10.0", "react-native-maps": "0.29.3",

Copy paste them and it should work)

ro-mgh avatar Oct 21 '22 08:10 ro-mgh

For me the patch didn't work as well, even with the correct versions of the dependencies

nathan-poncet avatar Oct 27 '22 08:10 nathan-poncet

@ro-mgh Thanks! After changing the react-native-reanimated to 2.10.0 and repatched the library everything worked perfectly.

vladmarintremend avatar Oct 27 '22 08:10 vladmarintremend

Issue has been fixed.

ghost avatar Oct 27 '22 16:10 ghost

@lucianod-airble Hi, could you please give us more information on how you've resolved this ? Did you need to export Expo or not ? Thanks :-)

5ika avatar Nov 17 '22 11:11 5ika