Is there a way to add marker on an ImageView

2.7k Views Asked by At

I want to replicate this great iOS library (SMCalloutView) on Android?

In it's example, a marker (pin on iOS) is created and added on a scrollable, zoomable imageView. And when the marker is clicked, an infoWindow (callout view on iOS) is shown. How do I achieve this behaviour? Is there a similar library to this? Should I draw the marker and show info window manually? Is there at least any way to use Marker and it's infoWindow on an ImageView.

SMCalloutView example

2

There are 2 best solutions below

3
osrl On BEST ANSWER

Best choice I could find is this library It has a pin sample you could use.

Add pin as a bitmap, override add an OnPinClickListener interface (see samples for where to invoke the onPinClick method).

if (pinRect.contains((int)touchCoord.x, (int)touchCoord.y)) {
    onPinClickListener.onPinClicked(i);
}

I still have no answer for info window.

1
snachmsm On

sorry, there is no native View with this "pinning" feature as I know, but you might check this library and maybe this stack question

for popup you might use default Android Popup or QuickAction lib (one of two) from here