p-lr / MapCompose

A fast, memory efficient Jetpack Compose library to display tiled maps, with support for markers, paths, and rotation.
Apache License 2.0
224 stars 20 forks source link

Add "callback" cluster click behaviour #115

Closed cwsiteplan closed 7 months ago

cwsiteplan commented 7 months ago

It would be nice to have a click behaviour that performs the default zoom action but acts as a callback too. (so apps can perform certain side-effects when clusters are clicked.

p-lr commented 7 months ago

The name "Callback" doesn't convey that the default behavior is also triggered (even though the documentation is explicit). I would rather add a parameter to the existing Custom case, instead of introducing a new behavior:

internal data class Custom(withDefaultBehavior: Boolean = false, val onClick : (ClusterInfo) -> Unit) : ClusterClickBehavior

This would be an api change. However, cluster api is still experimental -- so this is acceptable. What do you think?

cwsiteplan commented 7 months ago

Yep, thought of that as well. Sounds good - will adapt my PR. 👍

p-lr commented 7 months ago

Thanks!