Real-time path drawing

Tutorials that use the MapActivity. Many using GPS functionality.

Real-time path drawing

Postby curro » Sat Mar 20, 2010 7:37 pm

Hello. I've been trying to make an app that shows a MapView and, using the GPS, shows the route you are following in real time. For example, if you are moving in your car in the city, it will show for which streets you have passed.

I tried doing this using the ItemizedOverlay but when adding more than 50 points it gets VERY slow and the app becomes unresponsive, I think this is not the solution as far as I've tried.

What I'm thinking to do is collect points every 2 seconds from the GPS, save them in an ArrayList and every X time (lets say 20 seconds) draw lines between each point in a simple Overlay and this way I don't have to add a marker for each point, I can just add the lines drawn in a Canvas. This way I avoid the memory consumption of a marker (drawing shadow, tap) and also this way I'm not drawing everytime, only every 20 seconds or something.

Hopefully, this way we can have a real time path tracking system. I know there are some applications in the market that do this but I need that funcionality in my own app.


Does this sound good to you guys?
Is there a better solution for this? (faster dev)

I've done some research but found nothing! just want a high performance map drawing method for path tracking!

If you guys think this could be a good method I can develop it and post it here.

Thanks for your opinions!!
Posts: 7
Joined: Thu Mar 04, 2010 3:17 pm


Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest