0

I want to show 2 or more paths between 2 locations similar to "Suggested Routes" in Google Maps. I am able to draw 1 path through this link J2ME Map Route Provider . Now i want to show 2 paths simultaneously.

Community
  • 1
  • 1
Guri Jagat
  • 51
  • 1
  • 8

2 Answers2

0

You can use the J2ME Map Route Provider, you just need to change/remove this line of code:

 Handler mHandler = new Handler() {
  public void handleMessage(android.os.Message msg) {
   TextView textView = (TextView) findViewById(R.id.description);
   textView.setText(mRoad.mName + " " + mRoad.mDescription);
   MapOverlay mapOverlay = new MapOverlay(mRoad, mapView);
   List<Overlay> listOfOverlays = mapView.getOverlays();

listOfOverlays.clear();

   listOfOverlays.add(mapOverlay);
   mapView.invalidate();
  };
 };

You don't want to clear the map with each new overlay, just add it to the existing set of overlays.

Scott
  • 2,593
  • 1
  • 22
  • 23
0

This link worked perfectly for me. i called the method twice in main activity and the new overlay din`t replace the previous one.

Guri Jagat
  • 51
  • 1
  • 8