2

here is now researching how best to draw a path in real time. Get coordinates and draws up earlier and so forth ..

Materials in the network is. But I can not understand the following. There are many examples of inheritance Overlay then implement the draw () method and draw. But this we will have a one-time, and I need to constantly draw.

Received a starting position, went to finish the position has changed to its original position and so forth. How?

Examples.

Drawing a line/path on Google Maps How can I parse out points and draw a route on a Google Map in Android?

Thanks.

Community
  • 1
  • 1
JDev
  • 1,247
  • 1
  • 20
  • 44
  • you have to take ArrayList of GeoPoint and draw path according to your for loop starting to ending position. For every position of for loop you have to swipe your value ending Geopoint to initial GeoPoint. – Maulik Feb 14 '13 at 11:37
  • This I understand. But the method I call the draw() 1 time. Every item redraw all the way? Here's what I do not understand. – JDev Feb 14 '13 at 11:46

1 Answers1

2

First of all from your tags you are pointing to Google Maps API V2 while the links you are posting are for Google Maps API V1. That's said it's means that you do not have the Overlay object to work with and neither is the GeoPoint is the object you should use to show you direction positions.

In Google maps API V2 what you could do is to add/remove Polylines to show you directions. Those Polyline will connect LatLng Points.

Now to find you directions you can use the Google Direction API. Here is a post on how to find directions and show them on Google Map API V2:

Draw driving route between 2 GeoPoints on GoogleMap SupportMapFragment

Now from that how you will implement the your location updates and your desired destination updates it's up to you:

Something important to consider: It's not officially allowed by Google Maps APIs Terms of Service to use Google Maps API for driving directions:

Google Maps/Google Earth APIs Terms of Service

  Last updated: May 27, 2009

...

10. License Restrictions. Except as expressly permitted under the Terms, or unless you  
have received prior written authorization from Google (or, as applicable, from the 
provider of particular Content), Google's licenses above are subject to your adherence 
to all of the restrictions below. Except as explicitly permitted in Section 7 or the 
Maps APIs Documentation, you must not (nor may you permit anyone else to):

...

10.9 use the Service or Content with any products, systems, or applications for or in      
connection with:

(a) real time navigation or route guidance, including but not limited to turn-by-turn   
route guidance that is synchronized to the position of a user's sensor-enabled device;


and may be disabled for certain apps (somehow, at least on Android)... FromGeocode 
scraping in .NET conversation:
This is not allowed by the API terms of use. You should not scrape Google Maps to 
generate geocodes. We will block services that do automated queries of our servers.

Bret Taylor

Product Manager, Google Maps
Community
  • 1
  • 1
Emil Adz
  • 38,699
  • 35
  • 127
  • 177