moagrius / TileView

TileView is a subclass of android.view.ViewGroup that asynchronously displays, pans and zooms tile-based images. Plugins are available for features like markers, hotspots, and path drawing.
MIT License
1.46k stars 337 forks source link

Prevent closure of the callout marker #471

Closed Amattia closed 6 years ago

Amattia commented 6 years ago

I have implemented a function that add a marker in a tileView when the screen is touched.

When I touch a marker a callout is opened, I need that this callout remain opened until an event linked to a botton is triggered.

Actually I have no idea to how prevent the closure of the callout marker.

moagrius commented 6 years ago

the only difference between a "marker" and a "callout" is that callouts are removed when a touch event occurs on the TileView: https://github.com/moagrius/TileView/blob/master/tileview/src/main/java/com/qozix/tileview/markers/CalloutLayout.java (source) https://github.com/moagrius/TileView/blob/master/tileview/src/main/java/com/qozix/tileview/TileView.java#L807 (the one line of touch event code)

(also, it's a layer higher, but you can manage that manually)

just use the marker api instead of the callout api if you don't want them destroyed on touch.

Amattia commented 6 years ago

just use the marker api instead of the callout api if you don't want them destroyed on touch.

Could you explain to me how please ? sorry but i don't understand...

What I would like to achieve is: Insert in the tileview of the markers, to each marker associate a sort of "dialog" (callout), the dialog is a custom window in which there are data, the dialog can be closed with the push of a button.

p.s. Or it would be interesting to be able to understand when a callout (window) is closed

moagrius commented 6 years ago

i showed you the line where callouts are closed.

both markers and callouts are just Views. if you use addMarker, it's a marker. if you use addCallout, it's a callout.

the only difference between a "marker" and a "callout" is a that callouts are destroyed onTouch. if you don't want that, use a marker instead: addMarker(someView, ...)