-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: zIndex for Clustering #1484
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
base: main
Are you sure you want to change the base?
Conversation
@@ -906,6 +910,13 @@ protected void onClusterItemUpdated(@NonNull T item, @NonNull Marker marker) { | |||
protected void onBeforeClusterRendered(@NonNull Cluster<T> cluster, @NonNull MarkerOptions markerOptions) { | |||
// TODO: consider adding anchor(.5, .5) (Individual markers will overlap more often) | |||
markerOptions.icon(getDescriptorForCluster(cluster)); | |||
Iterator<T> iterator = cluster.getItems().iterator(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code next more explanation. What is the goal of this code and how does it work?
It also strike me as very odd. I am not used to seeing an iterator w/o a loop. This has a strange code smell to it. If the intent is to only use the second element of the cluster, this seems like a very strange way to go about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cluster.getItems()
returns Collection
.
Since there are no methods like get
in the Collection
interface, I use iterator to get the first element.
I see another way to do this:
ArrayList<T> items = new ArrayList<>(cluster.getItems());
Do you think this option would be clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Programmeister .
That solutions sounds a bit better than the current iterator one IMO.
…erRendered and onBeforeClusterItemRendered
d2658e3
to
ab01358
Compare
Add zIndex to markerOptions in onBeforeClusterRendered and onBeforeClusterItemRendered
Fixes #1424