I took a look at overlays, but i am facing a problem:
The pin/droid is drawn at the location that is hardcoded. WHat i wish to do. is draw the pin/droid on screen, which was last touched. The SDK doesnt give any examples regarding that. Can you help me?
Thanks!
EDIT
I was able to come up with an idea. from this code I got (from mobiForge). It updates the lat and long in a Toast.
MODIFIED PROBLEM:
ANd I want to draw a pushpin, where I just clicked. What function sould I use for that?
Using java Syntax Highlighting
- public boolean onTouchEvent(MotionEvent event, MapView mapView){
- //---when user lifts his finger---
- if (event.getAction() == 1) {
- GeoPoint p = mapView.getProjection().fromPixels(
- (int) event.getX(),
- (int) event.getY());
- Toast.makeText(getBaseContext(),
- p.getLatitudeE6() / 1E6 + "," +
- p.getLongitudeE6() /1E6 ,
- Toast.LENGTH_SHORT).show();
- }
- return false;
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
Thanks




