Obtain coordinates by clik on a map

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Obtain coordinates by clik on a map

Postby alexbrown » Wed Jul 22, 2009 1:06 pm

Hi all :)

How can i obtain the coordinates (latitude/longitude) by a click on a map?
alexbrown
Freshman
Freshman
 
Posts: 9
Joined: Thu Jul 16, 2009 5:10 pm

Top

Postby Christoph » Wed Jul 22, 2009 3:13 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. GeoPoint gpoint = mapView.getProjection().fromPixels( x, y);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
User avatar
Christoph
Developer
Developer
 
Posts: 28
Joined: Thu Jul 02, 2009 3:34 am
Location: Bonn, Germany

Postby alexbrown » Thu Jul 23, 2009 10:53 am

Hi Christoph

i think that you haven't understand
i need to obtain the real coordinates of the point that is touched

for example, if i click to a point of new york, i need to obtain the latitude and longitude for that point

is possible?
alexbrown
Freshman
Freshman
 
Posts: 9
Joined: Thu Jul 16, 2009 5:10 pm

Postby Christoph » Thu Jul 23, 2009 3:51 pm

GeoPoint represents latitude and longitude:

http://code.google.com/intl/de-DE/andro ... Point.html

x and y will come from the MotionEvent.
User avatar
Christoph
Developer
Developer
 
Posts: 28
Joined: Thu Jul 02, 2009 3:34 am
Location: Bonn, Germany

Postby alexbrown » Mon Jul 27, 2009 5:15 pm

thank you very much!
alexbrown
Freshman
Freshman
 
Posts: 9
Joined: Thu Jul 16, 2009 5:10 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: Google [Bot] and 7 guests