title: Remove a marker from a GoogleMap
body: <p>In the new Google Maps API for Android, we can <a href="https://developers.google.com/maps/documentation/android/marker#add_a_marker" rel="noreferrer">add a marker</a>, but there is no way to (easily) remove one.</p>
  
  <p>My solution is to keep the markers in a map and redraw the map when I want to remove a marker, but it is not very efficient.</p>
  
  <pre class="lang-java prettyprint-override"><code>private final Map&lt;String, MarkerOptions&gt; mMarkers = new ConcurrentHashMap&lt;String, MarkerOptions&gt;();
  
  private void add(String name, LatLng ll) {
    final MarkerOptions marker = new MarkerOptions().position(ll).title(name);
    mMarkers.put(name, marker);
  
    runOnUiThread(new Runnable() {
      @Override
      public void run() {
        mMap.addMarker(marker);
      }
    });
  }
  
  private void remove(String name) {
    mMarkers.remove(name);
  
    runOnUiThread(new Runnable() {
      @Override
      public void run() {
        mMap.clear();
  
        for (MarkerOptions item : mMarkers.values()) {
          mMap.addMarker(item);
        }
      }
    });
  }
  </code></pre>
  
  <p>Does anyone have a better idea?</p>