Cant remove overlay from map
<p>Working on a MapView app with Itemized overlays where i load a bunch of markers. 
This part works well, but im also adding a marker/overlay where you tap on the map..
that also works, but i want the last marker to be removed when i tap the map again but that seems impossible.</p>

<p>For ex i load some markers like this</p>

<pre><code>OverlayItem itemAnnat = new OverlayItem(point, sitesList.getName().get(i), sitesList.getName().get(i));
            Drawable marker4 = getResources().getDrawable(R.drawable.annat);
            marker4.setBounds(0, 0, getResources().getDrawable(R.drawable.annat).getIntrinsicWidth(), getResources().getDrawable(R.drawable.annat).getIntrinsicHeight());
            itemAnnat.setMarker(marker4);
            locationOverlay.addOverlayItem(itemAnnat);
</code></pre>

<p>And when i tap on the map i add a marker like this</p>

<p><code>
mapView.invalidate();</p>

<p>mapView.getOverlays().remove(itemWarning);</p>

<p>GeoPoint newpoint = new GeoPoint(markerLatitude, markerLongitude);<br>
OverlayItem witemWarning = new OverlayItem(newpoint, "add rub", "desc");
itemWarning.addOverlayItem(witemWarning);
mapView.getOverlays().add(itemWarning);</code></p>

<p>But the overlay "itemwarning" dont gets removed when i tap the map and ad new ones
I searched and tried to fix this for days but i cant figure it out... </p>

<p>mapView.getOverlays().remove(0);
Clears everything, but i dont want that, i only wanna clear the ones called "itemwarning"</p>

<p>any ideas what im missing ?</p>

<p>Here is all the code for the overlays. </p>

<p><code>public class LocationOverlay extends ItemizedOverlay  {</p>

<pre>        private ArrayList&lt;OverlayItem&gt; overLayList = new ArrayList&lt;OverlayItem&gt;();
        private MapView mapView;


        public LocationOverlay(MapView mapView, Drawable defaultMarker) {
             super(boundCenterBottom(defaultMarker));
             setLastFocusedIndex(-1);
             populate();
             this.mapView = mapView; // need it for onTap
        }

        @Override
        protected OverlayItem createItem(int i) {
             return overLayList.get(i);
        }

        @Override
        public int size() {
             return overLayList.size();
        }

        public void addOverlayItem(OverlayItem overlayItem) {
             if(!overLayList.contains(overlayItem)){
                  overLayList.add(overlayItem);
             }
             setLastFocusedIndex(-1);
             populate();
        }

        public void clear(){
             overLayList.clear();
        }  

        @Override
            public boolean onTap(int pIndex) {
            OverlayItem item = overLayList.get(pIndex);
            item.getTitle();
                    mapView.getController().animateTo(item.getPoint());
                    Toast.makeText(mapView.getContext(), item.getTitle(), Toast.LENGTH_SHORT).show();      
              return false;
            }
        public void draw( Canvas c, MapView m, boolean shadow ) {
            super.draw( c, m, false );
            }



        public boolean onTouchEvent(MotionEvent arg0, MapView arg1) {
            // TODO onTouchEvent

            int Action = arg0.getAction();
            if (Action == MotionEvent.ACTION_UP){

             if(!MoveMap)
             {
              Projection proj = mapView.getProjection(); 
              GeoPoint loc = proj.fromPixels((int)arg0.getX(), (int)arg0.getY());
              CenterLocation(loc);
             }


            }
            else if (Action == MotionEvent.ACTION_DOWN){

             MoveMap = false;

            }
            else if (Action == MotionEvent.ACTION_MOVE){    
             MoveMap = true;
            }
            //return MoveMap;
            return super.onTouchEvent(arg0, arg1);
            //return false;
           }

      //CenterLocation(loc);

        private void CenterLocation(GeoPoint centerGeoPoint)
        {

            mapController.animateTo(centerGeoPoint);

             myLongitude.setText("Longitude: "+
                       String.valueOf((float)centerGeoPoint.getLongitudeE6()/1E6));
                      myLatitude.setText("Latitude: "+
                       String.valueOf((float)centerGeoPoint.getLatitudeE6()/1E6));
                //    Toast.makeText(HelloMapView.this, "yeeey "+centerGeoPoint.getLatitudeE6(), 12).show();
         placeMarker(centerGeoPoint.getLatitudeE6(), 
           centerGeoPoint.getLongitudeE6());

        };

    private void placeMarker(int markerLatitude, int markerLongitude){
    LocationOverlay itemWarning = new LocationOverlay(mapView, getResources().getDrawable(R.drawable.marker));

    mapView.invalidate();
    mapView.getOverlays().remove(itemWarning);

    GeoPoint newpoint = new GeoPoint(markerLatitude, markerLongitude);  
    OverlayItem witemWarning = new OverlayItem(newpoint, "add rub", "desc");
    itemWarning.addOverlayItem(witemWarning);
    mapView.getOverlays().add(itemWarning);

        }

    }&lt;/code&gt;
</code></pre>
