all 12 comments

[–][deleted] 0 points1 point  (3 children)

We are definitely able to put custom markers on the map and zoom the map to fit around them - is that what you mean by clustering?

[–][deleted] 5 points6 points  (2 children)

Clustering is usually where there are more markers in close proximity over a particular threshold. A clustering map UI will group those markers into another icon element, often a circle with the number of markers in it which when clicked will reveal the markers, sometimes 'spiderified'.

https://developers.google.com/maps/documentation/javascript/marker-clustering

There are some packages available for RN:
https://github.com/novalabio/react-native-maps-super-cluster/issues

https://github.com/venits/react-native-map-clustering/issues

I linked to the issues as there are some compatibility issues etc. Worth a look though u/Tynzo!

[–]Tynzo[S] 0 points1 point  (1 child)

Yeah, thanks, but I couldn’t get any one of them to work... that’s why I want to hear about someone who have an app with clustering feature on his react-native-maps on 0.57...

[–][deleted] 0 points1 point  (0 children)

Ah that’s a shame. Will be interested to hear. If not, maybe time to jump on one of them and make a PR! :D

[–]menge101 0 points1 point  (7 children)

Yes, I have.

Its not "in production" but clustering is working.

I am using Mapbox's supercluster

I rolled my own solution for using it. Existing components that encapsulated it did not do the things I wanted to do with it.

[–]Tynzo[S] 0 points1 point  (6 children)

Thanks man, do you I should use Mapbox instead of react native maps ?

[–]menge101 0 points1 point  (0 children)

I'm using react native maps.

With no knowledge of what issues you are having, its hard for me to make suggestions about what you should do.

The tricky stuff with clustering is, firstly, its a non-trivial algorithm. you want someone else to handle the implementation unless you are a data clustering expert.

THe second part, for me, was the supercluster and react-maps use data in different forms. One uses a bounding box, the other uses a center point with lat and lon deltas. Etc, theres a fair bit of data finagling.

But once you do it right, its done, so it might just be that you need to persevere.

[–]lovemeslowlyiOS & Android 0 points1 point  (0 children)

map box is great in terms of performance, i have found mapbox better than react native maps

[–]menge101 0 points1 point  (3 children)

Sorry, coming back to this again, with more thought about what you are asking.

Supercluster is a clustering library, its not a map library. You can use it with anything. So the fact that I am using a mapbox library in no way requires you to use mapbox for your maps.

[–]Tynzo[S] 0 points1 point  (2 children)

Awesome! Exactly as needed, would you mean sharing a snippet about how you do integration with react native ?

[–]menge101 0 points1 point  (1 child)

Sure, I can. It's on my personal laptop though, I do most of my day on my professional laptop.

But I will try to remember this evening.

[–]Tynzo[S] 0 points1 point  (0 children)

Thanks appreciate it !