p-lr / MapView

A Fast, memory efficient Android library to display tiled maps, with support for markers, paths, and rotation.
Apache License 2.0
189 stars 38 forks source link

Marker callout disappeared when clicking or moving map view #23

Closed sana-20 closed 3 years ago

sana-20 commented 3 years ago

Hello @peterLaurence! Thank you for this great library. It really helped me a lot. But a marker callout disappeared as soon as I touch a map. Is there any way that I could keep marker callout view even though I click or move the map?

p-lr commented 3 years ago

Hi, this is intended behavior. You can turnaround this by subclassing the MapView and override onTouchEvent method, like so:

override fun onTouchEvent(event: MotionEvent): Boolean {
    return super.onTouchEvent(event)
}

However, you'll have to manage callouts visibility yourself. To remove them all, use mapView.markerLayout?.removeAllCallout(). To remove one particular callout, you can use mapView.removeCallout(view). BTW, I realize that I should add a high level API to remove all callouts.