Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

RNMaps beta support #259

Open
ChromeQ opened this issue Jul 9, 2023 · 0 comments
Open

RNMaps beta support #259

ChromeQ opened this issue Jul 9, 2023 · 0 comments

Comments

@ChromeQ
Copy link

ChromeQ commented Jul 9, 2023

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch react-native-map-clustering@3.4.2 for the project I'm working on.

I upgraded to using Expo SDK 49 which upgraded react-native-maps to v1.7.1. However this broke the app due to this issue expo/expo#23396 and react-native-maps/react-native-maps#4788.
Both of which are down to the root cause described here: react-native-maps/react-native-maps#4487

React native maps have a version 2 beta, which in beta.10 fixed the above problem: https://github.com/react-native-maps/react-native-maps/releases/tag/v2.0.0-beta.10. However beta.10 contains changes from beta.7 https://github.com/react-native-maps/react-native-maps/releases/tag/v2.0.0-beta.7 which changed animated option to duration option.

The current version of react-native-map-clustering will work but use the default duration of zero. This is not ideal, so there are two options, either set a duration (as per my diff below) or allow a dev to set a new prop clusterPressAnimationDuration or similar.

There may be other small changes required from the breaking changes on RNMaps but here is the diff that solved my problem:

diff --git a/node_modules/react-native-map-clustering/lib/ClusteredMapView.js b/node_modules/react-native-map-clustering/lib/ClusteredMapView.js
index 9e44320..67a5d30 100644
--- a/node_modules/react-native-map-clustering/lib/ClusteredMapView.js
+++ b/node_modules/react-native-map-clustering/lib/ClusteredMapView.js
@@ -165,6 +166,7 @@ const ClusteredMapView = forwardRef(
 
       mapRef.current.fitToCoordinates(coordinates, {
         edgePadding: restProps.edgePadding,
+        duration: 750,
       });
 
       onClusterPress(cluster, children);

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant