2

I have an image in my app, the image is a map and my client have requested I made each area within the image clickable. I have not been able to find anything any good solutions (barely any, even).

Here's an image of what I imagine

solutions

To the left there is the nicest solution and to the right is all I can imagine right now getting working, although my map is a bit more complicated than that. I am also not sure how/if this will work well with different sized screens.

Does anyone have a good solution they can point me to?

The map is a static image, by the way.

jontelang
  • 589
  • 4
  • 17
  • You can use gridlayout dividing the map image into a grid, in which you can span certain columns as required or create a finer grid to cover the desired area. Sort of..@JonathanWingerLang – Akash Amin Jun 06 '16 at 05:15
  • If you want more precission then trap the press in all the image, define in memory some polygons with the shapes you need and then check if the point is inside one of these polygons. Take a look at this: http://stackoverflow.com/questions/217578/how-can-i-determine-whether-a-2d-point-is-within-a-polygon – Gusman Jun 06 '16 at 11:15
  • @AkashAmin Thanks I will look at this. – jontelang Jun 06 '16 at 11:47
  • @Gusman This led me to touch gestures, which I had totally forgot about. I might go with this if I can find an drop-in polygon algorithm. – jontelang Jun 06 '16 at 11:48
  • Did you ever solved this ? I am facing the exact same problem now and how no clue on how to start on this. I tried gestures but the tapped event does not provides me with the position that was tapped, how did you do it ? – GuidoG Dec 21 '22 at 14:47
  • Hi, I don't remember, sorry. – jontelang Dec 26 '22 at 13:10

0 Answers0