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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster can not explose markers when markers are too near each other #38

Open
devransimsek opened this issue Nov 18, 2023 · 3 comments
Open

Comments

@devransimsek
Copy link

I also get an error when I press the Cluster.

RPReplay_Final1700322898.mov

The example geojson;
[ { "type": "Feature", "properties": { "id": 3560, "lat_y": 38.257204, "long_x": -121.3739 }, "geometry": { "type": "Point", "coordinates": [ -121.3739, 38.257204 ] } }, { "type": "Feature", "properties": { "id": 1949, "lat_y": 38.257204, "long_x": -121.373203 }, "geometry": { "type": "Point", "coordinates": [ -121.373203, 38.257204 ] } }, ]

radius of Clusterer is 18

"react-native": "0.72.4",
"react-native-clusterer": "^1.3.0",
"react-native-maps": "^1.8.0",

Can you please help? @JiriHoffmann

@JiriHoffmann
Copy link
Owner

I am unable to reproduce the error with the example points you provided. However, if you have multiple points with the exact same coordinate (in this case both have 38.257204 latitude), the expansion Region will have a delta of 0 resulting in react-native-maps not animating the zoom and just centering the cluster. I would suggest replacing the latitudeDelta with a small value such as 0.001 and the camera will zoom in during the animation. You can adjust at what zoom all clusters turn into points with the minZoom options property.

@devransimsek
Copy link
Author

Hi, @JiriHoffmann
Thank you for the answer!
I changed the initialRegion's latitudeDelta to 0.001 and played with minZoom but It did not work!
Is there anything else that can affect this problem?

@JiriHoffmann
Copy link
Owner

In this case, you would use maxZoom, because you are zooming in and thus the zoom value is higher. There was a bug with maxZoom, but it should be fixed in v2.0.0. Let me know if that resolves the issue.

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

2 participants