Determine user clicks on your View (MapView) - Hit testing

Tutorials with advanced 'difficulty' and more Lines of Code.

Determine user clicks on your View (MapView) - Hit testing

Postby biosopher » Wed Mar 19, 2008 10:28 pm

I posted this in the Map section, but as many non-Map developers have asked a similar question, I wanted to post the info here as well.

Basically, the tutorial shows how to listen to mouse clicks on a view, determine whether the click was within the screen region you are testing for hits, and allows you to take the appropriate action.

In this case, we're listening for icon clicks in a MapView and displaying a popup window upon icon selection, but the technique is useful for any View you are creating yourself.

Image

http://blog.pocketjourney.com

Please let me know if anything in the tutorial is not clear.

Happy coding,
Anthony
biosopher
Developer
Developer
 
Posts: 26
Joined: Sat Mar 15, 2008 8:14 pm
Location: San Francisco, California

Top

Postby Draffodx » Wed Mar 04, 2009 3:39 pm

thanks for this will prove useful to me!

can I ask would it be possible to adapt this code so that it knows when the location of the phone is within the hit area?
Draffodx
Master Developer
Master Developer
 
Posts: 205
Joined: Wed Nov 12, 2008 2:31 pm

Top

Return to Advanced Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests