-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Marker clustering ios #137
Marker clustering ios #137
Conversation
@joshblour Hi! |
@alexHlebnikov check out this branch https://github.com/joshblour/react-native-maps-1/commits/marker_clustering (it's probably what you already have) The Note: You'll then need to tell The problem with this approach is that we're limited to plain-ol' markers, and can't use custom views, which blows. It would be awesome if there was a way to provide our own marker object to |
I think here is a way to reslove the problem with clusetering markers customization in Java. |
yes, that's the approach they recommend but it's still just setting markerOptions. I haven't tried, but it seems that with AirMaps you can have completely custom marker by providing your own view. Anyone using a custom view wouldn't be able to use clustering. What we really want is to tell |
Hey, whats the status of this PR? Does the project support already marker clustering? Or maybe do you know if there is an easy way to implement it? Thanks |
Would be awesome to get this in, feels like the missing piece |
Any progress on this? |
Hey guys! Any chance you can merge this and release a new version any time soon? |
Please merge this, it would be really useful 🙏 |
+1, please merge |
I will pay for who can make clustering for both platforms. Just say the price. |
I can def sponsor as well
|
I solved this by doing the clustering in javascript, inspired by leaflet and google maps. At the moment it's very much tied into our application and not perfect yet. If you guys don't mind an javascript implementation, I'm happy to explore to open source our solution. |
@justim that would be great. I also planned to do on js side, your code would help. |
@justim I'd love to see your code too :) |
I'm also looking at javascript implementation - a possible solution might come via supercluster |
@nazywamsiepawel supercluster looks pretty sweet, my solution can't handle that kind of amounts of markers. I didn't really get to making a proper repo/PR for the clustering, but since there are people that want to cluster, I created a gist with code that I pulled from our application. There are some magic numbers and the region/bounds stuff is a bit weird, but it works alright. Maybe someone can use it :) https://gist.github.com/justim/2c834a657553f0e2531949edae03fb83 |
anyone had a luck using a supercluster? |
@veedeo We used supercluster, and it solved this problem nicely! I didn't do the implementation, but looking at the code it seems pretty simple. |
Cool thanks, will look at it later |
@i-tu Can you provide a sample of the implementation you used? More specifically how you converted the region span to a zoom level. |
Guys, if you need generalisation instead of clustering, you can use https://github.com/mourner/rbush |
@dvassilev I just noticed your message, but in case you or someone else is still working on this, here's an incomplete snippet. HTH https://gist.github.com/i-tu/05e79737adfe36935ec869125a686f82 |
@i-tu I followed your snippet and managed to get clustering in place. Big thanks for that! |
@i-tu Thanks for that, I managed to implement it but noticed that if markers change dynamically the module requires the entire list to be loaded in again which blocks the JS thread and there's a bit of a delay when getting the clusters back. It seems like a native implementation would probably be the best solution. |
@danielreuterwall or @dvassilev could either of you post a more complete example of getting clustering to work with SuperCluster? Struggling to get it working. |
Any news on this ? |
Will this be implemented any time soon? |
@yonahforst I have implemented map clustering android code from your branch https://developer.android.com/training/wearables/apps/bt-debugging.html#SetupDevices But I can't get how to connect React Native Maps markers with Cluster Markers. @yonahforst I didn't get any use of cluster markers in your branch also. cc: @alexHlebnikov Is there any working example. |
Sorry for not getting back before. So I did solve this using the supercluster from MapBox. When the region changes on the map I load places from my backend API and the invoke the clustering like this:
Inside the
The Finally I have a method that handled taps on the marker/cluster. If its a cluster is centers it and zooms in, if its a regular marker it just centers it.
Hope this helps. |
how is it going with this pr? Would love to import this to our current application! |
I have a working Hack (sofar) for doing this in android.
Maybe there where some more minor things but that is pretty much it.
I would like to collaborate on how one would do the cluster indicator in an efficent way. |
Any progress with this PR? I am dying to see this feature since I am dealing with thousands of markers and for now performance is simply tragic. Also what about clustering on Android? I've seen discussion, but this PR doesn't seem to contain any android related changes. |
@nehvaleem it looks like some others in this thread have investigated the android side of things but nothing has made it into this branch. If we can come up with a good general clustering solution that doesn't inhibit the non-clustering use case, then I am all for adding it to this library. |
My full implementation working on android using supercluster
Thanks to @danielreuterwall and @i-tu above. |
@jayesbe , |
@KajalMittal .. the map-cluster-marker is your custom marker component. did you create one ? eg
|
@jayesbe Nice code, thanks a lot. But I find that you didn't define |
You can try this. It works for me :) https://github.com/venits/react-native-map-clustering |
@yonahforst this PR is really old and sadly somehow it didn't make it in the repo. Lot of things changed in the module since then and the supercluster solution works pretty well. I will close the PR (we're trying to clean up as much as possible) but please ping me if you think you could update it to work with the last code and also android side 🤗 |
What is this.props.screenProps ? logically looks like marker list |
adds marker clustering for iOS. still trying to get it workong on Android...