On Thu, Nov 11, 2010 at 12:06 PM, ZQ <zhiqiang....@gmail.com> wrote: > Hi TreKing, > > Thank you for replying. I tried drawing a marker on the map with the > code below, but i can't get it to draw anything when i click on the > map. Could u advice me? Thank you > > @Override > public boolean onTouchEvent(MotionEvent event, MapView > mapView) > { > mapOverlays = mapView.getOverlays(); > drawable = > getResources().getDrawable(R.drawable.androidmarker); > HelloItemizedOverlay itemizedoverlay = new > HelloItemizedOverlay(drawable); > > //---when user lifts his finger--- > if (event.getAction() == 1) { > GeoPoint p = > mapView.getProjection().fromPixels( > (int) event.getX(), > (int) event.getY()); > > GeoPoint point3 = new > GeoPoint(p.getLatitudeE6(), > p.getLongitudeE6()); > OverlayItem overlayitem3 = new > OverlayItem(point3, "", ""); > itemizedoverlay.addOverlay(overlayitem3); > } > return false; > } >
A) Please respond to the whole group. B) Try invalidating the mapview. ------------------------------------------------------------------------------------------------- TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en