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 items with exact same lat/lang position are always bound together as a cluster #384

Closed
usergoodvery opened this issue Apr 7, 2017 · 12 comments
Assignees
Labels
needs more info This issue needs more information from the customer to proceed. priority: p2 Moderately-important priority. Fix may not be included in next release. stale

Comments

@usergoodvery
Copy link

usergoodvery commented Apr 7, 2017

Summary:
Cluster items with exact same lat/lang position are always bound together as a cluster and do not separate away as individual items even at the lowest zoom level.

Steps to reproduce:
Add items with same lat/lang

Expected behavior:
items should seperate

Observed behavior:
items stay clumped together and rendered as cluster

Device and Android version:
lib 0.4.3. Samsung Galaxy S6

@menismu
Copy link

menismu commented Jul 29, 2017

I´ve developed a quick workaround, you can find here.

In general, ClusterManager class is extended to include a method to check if markers in a cluster have the same location, if that´s the case, the implementation of OnClusterClickListener distribute the markers around the cluster location an hides the original cluster.

This workaround only works if the user is in the maximum zoom level and all the markers in the cluster have exact the same location (lat/lng). Also, when the user zooms out all the markers bring back to the original cluster.

@stale
Copy link

stale bot commented Oct 3, 2019

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!

@stale stale bot added the stale label Oct 3, 2019
@stale
Copy link

stale bot commented Nov 2, 2019

Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution.

@stale stale bot closed this as completed Nov 2, 2019
@barbeau
Copy link
Collaborator

barbeau commented Nov 8, 2019

Re-opening, there is a fix proposed in #413.

@barbeau barbeau reopened this Nov 8, 2019
@stale stale bot removed stale labels Nov 8, 2019
@barbeau barbeau added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Nov 8, 2019
@agent10
Copy link

agent10 commented Feb 29, 2020

Has the same issue.

@stale
Copy link

stale bot commented Jun 28, 2020

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!

@stale stale bot added the stale label Jun 28, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution.

@stale stale bot closed this as completed Dec 25, 2020
@september669
Copy link

Same problem with versions:
implementation "com.google.android.gms:play-services-maps:18.0.0"
implementation 'com.google.maps.android:android-maps-utils:2.2.3'

@barbeau barbeau reopened this Dec 1, 2021
@stale stale bot removed the stale label Dec 1, 2021
@barbeau
Copy link
Collaborator

barbeau commented Dec 1, 2021

Reading this issue again, it's not clear to me if the feature request is 1) to show clusters are individual markers (but still stacked on the same lat/lon), or 2) to somehow visualize markers with the same lat/lon as "unstacked" so they are separate and don't appear exactly on the same lat/lon.

@september669 @agent10 @menismu @usergoodvery Could you clarify which of the two above you're looking for?

If 1), you can actually accomplish this with the new method shouldRender() that was added in 2.3.0, along with shouldRenderAsCluster(). See the ZoomClusteringDemoActivity for an example, which implements a ZoomBasedRenderer that overrides these methods.

I tested this demo activity with the same marker locations as follows:

        clusterManager.addItem(new MyItem(18.545723, 73.797726, "Loc1", snippet));
        clusterManager.addItem(new MyItem(18.545723, 73.797726, "Loc2", snippet));
        clusterManager.addItem(new MyItem(18.545723, 73.797726, "Loc3", snippet));
        clusterManager.addItem(new MyItem(18.545723, 73.797726, "Loc4", snippet));
        clusterManager.addItem(new MyItem(18.545723, 73.797726, "Loc5", snippet));
        clusterManager.addItem(new MyItem(18.545723, 73.797726, "Loc6", snippet));
        clusterManager.addItem(new MyItem(18.545723, 73.797726, "Loc7", snippet));

...and when you zoom in you can see the individual markers instead of a cluster, although they are all stacked on top of each other. When you tap on the marker, it does cycle through all 7 of them and show the corresponding text in the popup balloon.

Please take a look and let me know if that accomplishes what you're looking for, or if you're looking for a solution to visualize markers with the same lat/lon in a different way.

@barbeau barbeau added the needs more info This issue needs more information from the customer to proceed. label Dec 1, 2021
@barbeau barbeau assigned barbeau and unassigned arriolac Dec 1, 2021
@september669
Copy link

IMHO, @menismu workaround above looks good and it will be a good UI solution.
I mean if you tap on cluster of markers with same location it splits around, and with zoom out splited markers clustered again.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!

@stale stale bot added the stale label Apr 16, 2022
@stale
Copy link

stale bot commented Nov 2, 2022

Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution.

@stale stale bot closed this as completed Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info This issue needs more information from the customer to proceed. priority: p2 Moderately-important priority. Fix may not be included in next release. stale
Projects
None yet
Development

No branches or pull requests

6 participants