Not compatible with Expo SDK 52 on Android
The markers are unvisible if you're using the the new expo 52+ versions on Android
You might have to disable the new architecture for React Native on Android.
You can do this by adding this flag for Android in your app.json file:
"android": {
"newArchEnabled": false,
}
Hello everyone, are there any updates on this? I have installed SDK 52 and the clustering no longer works at all. Only when I zoom in very close my markers are displayed but no clusters. Even if I zoom out, the markers are no longer displayed.
I use SDK 52
Hey there, having the same issue with expo, SDK 52. Even when I manage to display the clusters on android, through extensive code lines, they flicker. Any alternative?
The markers are unvisible if you're using the the new expo 52+ versions on Android
Hey @BauerKristof, is it happening only on Android, or on iOS as well?
here are two patches to make the lib work on android and iOS on RN 0.78.
@tomekvenits I may be able to take over the maintenance of the library if you want.
react-native-map-clustering+3.4.2.patch react-native-maps+1.20.1.patch
It would be nice, because the only alternative to this is the Supercluster lib, but i found it soooo complex that i give up and i will try to fix the map-clustering
@rafx01 you can use patch-package lib to apply both of my patches to make it work.
@HugoGresse Yeah, i solved the problem by setting the newArchEnabled to false in the gradle.properties. But i was talking about you maintaining the lib, because this lib is so much simpler to work with
@rafx01 you can use patch-package lib to apply both of my patches to make it work.
Thank you for your patch, it works mostly under Expo 53 / Android (I'm still testing iOS). However, I have a small display error, the cluster is only 1/4 visible:
Du you have an idea how to fix this?
@rafx01 you can use patch-package lib to apply both of my patches to make it work.
Thank you for your patch, it works mostly under Expo 53 / Android (I'm still testing iOS). However, I have a small display error, the cluster is only 1/4 visible:
Du you have an idea how to fix this?
Use the react-native-maps 1.20.1 patch to fix an issue with newArchitecture react-native-maps+1.20.1.patch
See https://github.com/react-native-maps/react-native-maps/pull/5103
@rafx01 you can use patch-package lib to apply both of my patches to make it work.
Thank you for your patch, it works mostly under Expo 53 / Android (I'm still testing iOS). However, I have a small display error, the cluster is only 1/4 visible:
Du you have an idea how to fix this?
Use the
react-native-maps1.20.1 patch to fix an issue with newArchitecture react-native-maps+1.20.1.patch See react-native-maps/react-native-maps#5103
Thank you, I already applied both patches from your post above. I'm using a Custom Marker, which is also cut off (about 40x40px are shown, my Image is 30x44px). I will investigate and report.
Edit: Works great on development build. Not working in Expo Go, which makes sense. Thank you!
@iuvabo check this issue : https://github.com/react-native-maps/react-native-maps/issues/5247 I'm having this error too, my custom markers are only showing 40x40px... still waiting for someone to solve this
@iuvabo check this issue : react-native-maps/react-native-maps#5247 I'm having this error too, my custom markers are only showing 40x40px... still waiting for someone to solve this
Tested it in development build and store version in Expo 53 - works great with the supplied patches, both iOS and Android.
@HugoGresse Do you know why a patch is needed for react-native-maps 1.20.1? It works great with just the react-native-map-clusturing patch.
@Sultron to fix the issue on android for the marker having different sizes, as demonstrated by https://github.com/tomekvenits/react-native-map-clustering/issues/279#issuecomment-2850121810 And PR here on maps : https://github.com/react-native-maps/react-native-maps/pull/5103
@HugoGresse Could you please tell us how to use the patch? Thanks
@STASIA-Digital using patch-package https://www.npmjs.com/package/patch-package
@HugoGresse Thanks :) I can confirm that the patch works and the marker is shown completely and not cutted.
For more details on the steps:
- Add the patch file to a folder named patches
- You need to install patch-package https://www.npmjs.com/package/patch-package like Hugo said
- You can add "postinstall": "patch-package" to your scripts in the package.json for manual install. Note that during each npm install, the patch will be installed automatically
I have downloaded the patch, put it in it's own folder called patches, downloaded the npm i patch-package and nothing seems to work. i've tried many alternatives too but my map marker keeps getting cut off on android. I'm running on Expo 53, does anybody have a fix? @HugoGresse
I have downloaded the patch, put it in it's own folder called patches, downloaded the npm i patch-package and nothing seems to work. i've tried many alternatives too but my map marker keeps getting cut off on android. I'm running on Expo 53, does anybody have a fix? @HugoGresse
did you download both patches? did you update the postinstall script?
scripts: {
"postinstall": "patch-package",
}
and runned npm i?
I have downloaded the patch, put it in it's own folder called patches, downloaded the npm i patch-package and nothing seems to work. i've tried many alternatives too but my map marker keeps getting cut off on android. I'm running on Expo 53, does anybody have a fix? @HugoGresse
did you download both patches? did you update the postinstall script?
scripts: { "postinstall": "patch-package", }and runned
npm i?
I have yes, I get an error
Error: Patch file found for package react-native-map-clustering which is not present at node_modules/react-native-map-clustering
patch-package finished with 1 error
I have downloaded the patch, put it in it's own folder called patches, downloaded the npm i patch-package and nothing seems to work. i've tried many alternatives too but my map marker keeps getting cut off on android. I'm running on Expo 53, does anybody have a fix? @HugoGresse
did you download both patches? did you update the postinstall script?
scripts: { "postinstall": "patch-package", }and runned
npm i?I have yes, I get an error
Error: Patch file found for package react-native-map-clustering which is not present at node_modules/react-native-map-clustering
patch-package finished with 1 error
maybe read the error? It is written in plain letters. Another solution would be to get the help from some AI, like Claude or ChatGPT...
I have downloaded the patch, put it in it's own folder called patches, downloaded the npm i patch-package and nothing seems to work. i've tried many alternatives too but my map marker keeps getting cut off on android. I'm running on Expo 53, does anybody have a fix? @HugoGresse
did you download both patches? did you update the postinstall script?
scripts: { "postinstall": "patch-package", }and runned
npm i?I have yes, I get an error
Error: Patch file found for package react-native-map-clustering which is not present at node_modules/react-native-map-clustering
patch-package finished with 1 error
maybe read the error? It is written in plain letters. Another solution would be to get the help from some AI, like Claude or ChatGPT...
You are right the error is clear lol. I've been going crazy trying to find a fix for the markers getting cut off. ChatGPT doesn't seem to be any help what so ever.
Now, even after putting the patch file into the folder, my map markers are still being cut off. On my emulator, Pixel 7 API 34 the map markers look fine but, on my physical android device which is a A13 API 36 the map markers are being cut off still. My A13 is android 13 and the emulator is 14
Do you want a support invoice? >< The code of the map-clustering is open source, which allow you to digg into the problem fairly easily.
https://www.npmjs.com/package/@allisonadam81/react-native-super-clusters
I forked this, and it's working for my app out of the box on RN .79.2, React 19, latest react native maps, etc. Feel free to use. I'll be updating it over the next few weeks. Just needed to get something working and published today because I like the API for the app I'm working on.
I am using RN 79.1. In my app after adding patches .. clusters are visible in Ios devices but clusters are not visible in Android device.. tough they are there are if i click of any cluster position markers are showing after zooming in.. but clusters are not showing in map.
Edit: After adding tracksViewChanges: true in MapView component.. Clusters are visible in android also but they are getting cropped in android.. however in Ios it is visible correctly.. see the image below.. how it is looking in android.
I am using RN 79.1. In my app after adding patches .. clusters are visible in Ios devices but clusters are not visible in Android device.. tough they are there are if i click of any cluster position markers are showing after zooming in.. but clusters are not showing in map.
Edit: After adding tracksViewChanges: true in MapView component.. Clusters are visible in android also but they are getting cropped in android.. however in Ios it is visible correctly.. see the image below.. how it is looking in android.
Apply the patch mentioned above. Note that it only displays correctly when using a development build or APK.
The newest version (4.0.0) two days ago seems to have the same problem in Expo 53
Can confirm, having the same issue with v4.0.0 and cut off clusters when applying the patch (modified for v4.0.0).
Setting tracksViewChanges={Platform.OS === "android"} on the ClusteringMapView solved the issue for me, but it's not ideal. The clusters are flickering every few seconds and there's probably some performance / battery usage impact.
I've scheduled to test the v4 next week, I'll let you know.