0

I spent a lot of time to find a working example of drawing a path between 2 points in google map.

I finally find one but it isn't draw the path.

can someone help me understand why (or to give me another code example)? this is the code:

https://github.com/frogermcs/RoutePathExample

Thank you.

  • See this previous post, it looks like the same topic: http://stackoverflow.com/questions/2176397/drawing-a-line-path-on-google-maps – crocboy Oct 22 '12 at 22:29

1 Answers1

0

this link explains how to do it more clearly http://csie-tw.blogspot.in/2009/06/android-driving-direction-route-path.html Are you aware of google earth kml ? https://developers.google.com/kml/documentation/kml_tut I used it once to plot route from 1 point to another on google map. once you parse it you can plot these points as mapView.getProjection().toPixels(start, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pin); canvas.drawBitmap(bmp, screenPts.x, screenPts.y, null);
Point screenPts2 = new Point(); mapView.getProjection().toPixels(end, screenPts2);

//---add the marker--- Bitmap bmp2 = BitmapFactory.decodeResource(getResources(), R.drawable.pin);// pin is a resource you have to add canvas.drawBitmap(bmp2, screenPts2.x, screenPts2.y, null);

Bhanu Kaushik
  • 876
  • 6
  • 25