title: How to reset Map or remove the MapRoute from Here Map
body: <p>I am working on Basic Positioning and Navigation. I have used Bottom Navigation Tabs.</p>
  
  <p>In MainActivity I have added MapFragment in XML file. This MapFragment is I am calling from Click of Tabs.</p>
  
  <p>When I am clicking Location first time current location displayed correct. After I am clicking to Trip (Navigation),
  Navigation is displayed correct, this scenario working fine.</p>
  
  <p>But when I am clicking on Location, Navigation route is not removed. As shown figure.</p>
  
  <p>Also I have used static variable of <strong>MapRoute</strong></p>
  
  <pre><code>private static MapRoute mapRoute;
  </code></pre>
  
  <p>I have remove Map Object as following code snippet.</p>
  
  <pre><code> if (map != null &amp;&amp; mapRoute != null) {
          map.removeMapObject(mapRoute1);
          mapRoute = null;
      }
  </code></pre>
  
  <p>Now my question id how can remove or restart the static <strong>MapFragment</strong>.</p>
  
  <p><a href="https://i.stack.imgur.com/SVpC2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SVpC2.png" alt="Current Location"></a></p>
  
  <p>For Current Location I have used CurrentLocationFragmentView class as follow code snippet.</p>
  
  <pre><code>public class CurrentLocationFragmentView {
  private    MapFragment m_mapFragment=null;
  private Activity m_activity;
  private   Map map=null;
  private double langitude, latitude;
  private static MapRoute mapRoute;
  public CurrentLocationFragmentView(Activity activity,Double  Lat, Double lang) {
      m_activity = activity; 
      latitude=Lat;
      langitude=lang;
      initialize();
  
  }
  private void initialize() {
  
      // Search for the map fragment to finish setup by calling init().
      m_mapFragment = (MapFragment) m_activity.getFragmentManager().findFragmentById(R.id.mapfragment);
      m_mapFragment.init(new OnEngineInitListener() {
          @Override
          public void onEngineInitializationCompleted(OnEngineInitListener.Error error) {
              if (error == OnEngineInitListener.Error.NONE) {
                  map=null;
                  map = m_mapFragment.getMap();
  
                  if (map != null &amp;&amp; mapRoute != null) {
                      map.removeMapObject(mapRoute1);
                      mapRoute= null;
                  } 
                  map.setCenter(new GeoCoordinate(latitude, langitude, 0.0),
                          Map.Animation.NONE);
                  map.setZoomLevel((map.getMaxZoomLevel() + map.getMinZoomLevel()) / 2); 
                  map.getPositionIndicator().setVisible(true);  
              }  
          }
      });
  }
  </code></pre>
  
  <p>How to remove this <strong>Route on Map</strong> in Here Maps.</p>