I want to know which specific area of my Map (ImageView) was clicked

116 views Asked by At

I am building an indoor map using an image, now I wanna know which specific area of my image was clicked so I can identify which room/corridor was selected.

I am using a "deep zoom" scalable imageview https://github.com/davemorrissey/subsampling-scale-image-view So with the panning and pinching zoom I am not sure if the x,y axis of the images would remain the same or not. Any help would be appreciated.

2

There are 2 answers

1
Peter Staranchuk On

I think viewToSourceCoord method is what you searching for.

See Extensions -> Utility methods section from documentation https://github.com/davemorrissey/subsampling-scale-image-view/wiki/10.-Extension

2
emandt On

Why not read its own Github's Documentation? Link: https://github.com/davemorrissey/subsampling-scale-image-view/wiki/09.-Events ("Using public methods on the class, you can convert the view coordinates of the event into coordinates of the source image")