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

Enhance performance by removing pointerInput modifier on markers #67

Closed p-lr closed 2 years ago

p-lr commented 2 years ago

This is something I wanted to do for a while now. Having a clickable modifier on each marker hurts performance a lot, and relying on pointerInput instead was better but still wasn't perfect. Now we rely on the pointerInput set at at highest level, which detects single-tap and double-tap (which causes single tap events to be detected after a slight delay). Having the coordinates of the tap, we can resolve which marker contains the click event.