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

Ability to change rotation on ClusterItem #548

Open
cwsiteplan opened this issue Apr 11, 2024 · 2 comments
Open

Ability to change rotation on ClusterItem #548

cwsiteplan opened this issue Apr 11, 2024 · 2 comments
Labels
triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@cwsiteplan
Copy link

I do show labels on the map which should follow the camera bearing (map rotation). Similar to street names in GoogleMap - they rotate with the map.

by only exposing clusterItemContent we are not able to change the rotation of the Marker.

Applying the rotation on the composable content

clusterItemContent = {
            MyLabel(
                it.label,
                modifier = Modifier.rotate(rotation)
            )
        }

does not work as it then exceeds the bounds of the rendered marker - see below:
image

@cwsiteplan cwsiteplan added triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Apr 11, 2024
@cwsiteplan
Copy link
Author

would be nice if someone can take a look at this

@kikoso
Copy link
Collaborator

kikoso commented Dec 4, 2024

Hi @cwsiteplan . I think this could probably be solved using the function marker.rotation(float value), but there is no easy access to it. It would also require changes on android-maps-utils.

The DefaultClusterRenderer provides a function to be overridden, onClusterItemUpdated. This function receives a marker that could potentially be modified.

How to pass this all the way-up it is an open question. Custom Renderers can now be created, so an option could be to override it (similar to this sample in the android-maps-utils) and provide an option to rotate the marker. That could theoretically work, but we would also need to somehow keep the relationship about which markers get which rotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants