Clustering: Breaks marker anchoring for markers not of the "pin" style.
The new Clustering() implementation appears to have a preset marker image anchor offset. Or, to be more precise, the composable passed into the clusterItemContent parameter appears to be wrapped in an offset composable when placed on the screen. I see no way to configure that anchor offset, which appears to be Offset(0.5f, 1.0f), the default assigned to markers. This does not break "pin" style markers, but breaks all other marker image types as they are not able to be centered on the point. Adding anchor configurability may be the most robust fix.
If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.
@mpfulc Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:
- Check the issue tracker - bugs and feature requests for Google Maps Platform APIs and SDKs
- Open a support case - Get 1:1 support in Cloud Console.
- Discord - chat with other developers
- StackOverflow - use the
google-mapstag
This is an automated message, feel free to ignore.
any update on this? seems quite crucial to have that configurability - otherwise clustering cannot be used with custom markers. :(
+1 to getting this fixed. Being able to change the content of the marker but not the anchor point really limits the usefulness of it.
any update? this would be a highly appreciated - this is blocker for our product launch.
Hi @cwsiteplan ,
This should be theoretically possible by implementing a custom renderer, and making sure that the MarkerOptions passed to the onBeforeClusterItemRendered() contains a specific anchor here.
A Clustering object can receive a custom Renderer, and hence the anchor could be set.
I understand this requires a significant amount of work for a single attribute, but on the other hand we need to think rigorously about introducing new parameters for our Composables. We will evaluate this.
Thanks for the workaround - will try to implement that.
Still I would see the ability of "setting anchor" as essential - having a Map SDK that does not support custom marker content (and as content varies the anchor needs to be adjusted) seems too limited.