title: Location change and put Marker on Click in openstreetmap
body: <p>I am new to Open Street Map map. I want to put the marker on map where i Tapped. I want to delete previous marker also. Please help me.
  Thanks in advance. Here is my code </p>
  
  <pre><code>Overlay touchOverlay = new Overlay(this) {
      ItemizedIconOverlay&lt;OverlayItem&gt; anotherItemizedIconOverlay = null;
  
      @Override
      protected void draw(Canvas arg0, MapView arg1, boolean arg2) {
  
      }
  
      @Override
      public boolean onSingleTapConfirmed(final MotionEvent e,
              final MapView mapView) {
          Projection proj = mapView.getProjection();
          GeoPoint loc = (GeoPoint) proj.fromPixels((int) e.getX(),
                  (int) e.getY());
          String longitude = Double
                  .toString(((double) loc.getLongitudeE6()) / 1000000);
          String latitude = Double
                  .toString(((double) loc.getLatitudeE6()) / 1000000);
          ArrayList&lt;OverlayItem&gt; overlayArray = new ArrayList&lt;OverlayItem&gt;();
          OverlayItem mapItem = new OverlayItem("", "", new GeoPoint(
                  (((double) loc.getLatitudeE6()) / 1000000),
                  (((double) loc.getLongitudeE6()) / 1000000)));
          Drawable marker = null;
          mapItem.setMarker(marker);
          overlayArray.add(mapItem);
          if (anotherItemizedIconOverlay == null) {
              anotherItemizedIconOverlay = new ItemizedIconOverlay&lt;OverlayItem&gt;(
                      getApplicationContext(), overlayArray, null);
              mapView.getOverlays().add(anotherItemizedIconOverlay);
              mapView.invalidate();
          } else {
              mapView.getOverlays().remove(anotherItemizedIconOverlay);
              mapView.invalidate();
              anotherItemizedIconOverlay = new ItemizedIconOverlay&lt;OverlayItem&gt;(
                      getApplicationContext(), overlayArray, null);
              mapView.getOverlays().add(anotherItemizedIconOverlay);
          }
  
          return true;
      }
  };
  </code></pre>