Test clicks on MapView to display popup - 'Hit' testing

Tutorials that use the MapActivity. Many using GPS functionality.

Test clicks on MapView to display popup - 'Hit' testing

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

I just finsihed a new tutorial to address questions I'd been getting about how to test for user interactions on a Google map (MapView).

This tutorial shows you how to draw an icon to a map, listen for & test user 'clicks' to that icon, and how to draw a transparent information window much like a web-based Google map.

Here's what you'll be able to do:

Image

http://blog.pocketjourney.com

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

Happy coding,
Anthony
Last edited by biosopher on Sat Apr 05, 2008 6:12 pm, edited 1 time in total.
biosopher
Developer
Developer
 
Posts: 26
Joined: Sat Mar 15, 2008 8:14 pm
Location: San Francisco, California

Top

hi acopernicus

Postby CHAKYANAS » Thu Mar 20, 2008 10:32 am

Thankyou For Kind information.............................


Yes I got Some hint from the tutorial and i implemented it
mouse click can also recognised by the code.............

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  public boolean dispatchTouchEvent(MotionEvent ev)
  2.  
  3.   {
  4.  
  5.           int action = ev.getAction();
  6.  
  7.                 switch(action)
  8.  
  9.                         {
  10.  
  11.                                         case MotionEvent.ACTION_UP:
  12.  
  13.                                                  int X = (int)ev.getX();
  14.  
  15.                                      int Y = (int)ev.getY();
  16.  
  17.                                      checkInRange(X,Y);
  18.  
  19.                                      if( flag_for_Range==1)
  20.  
  21.                                      screencordToLat(X,Y);
  22.  
  23.                         break;
  24.  
  25.  
  26.  
  27.                         }
  28.  
  29.                  
  30.  
  31.         return false;
  32.  
  33.            }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
:roll: :P
User avatar
CHAKYANAS
Developer
Developer
 
Posts: 44
Joined: Mon Mar 03, 2008 5:08 am
Location: INDIA

Top

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest