1

I am trying to place markers on an image (using ImageView), the image doesn't fit the screen so have scroll views for that. I am wondering how I would get with a listener the coordinates when user taps so I can add a marker or text, I am hoping I can do this with a vector.

Any help will be appreciated.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Darren
  • 75
  • 6
  • i think, this can be achived dynamically adding text on imageview. the position of text will be based on the tap position, check out this link to get the position https://stackoverflow.com/questions/3476779/how-to-get-the-touch-position-in-android – Mohd Asif Ahmed Nov 10 '17 at 09:54
  • I can't i need 15 points, but thank you it was really helpful :) – Darren Nov 11 '17 at 07:20

1 Answers1

1

Check this library PhotoView and it has setOnPhotoTapListener((imageView, x, y) listener which will give you particular X and Y position.

Here is small snippet of my project,

private PhotoView mMap;
mMap.setOnPhotoTapListener((imageView, x, y) ->
                processTap((int) (mOriginalMap.getWidth() * x),
                        (int) (mOriginalMap.getHeight() * y))
);
Kuls
  • 2,047
  • 21
  • 39