Good afternoon guys, I’d like to know if there’s any way I can trace a path that I go through with my corona application connected … More precisely, I’ll be inside a bus running my application all the way from start to finish order, and then needed the trace of the entire busway. Thanks for listening
It sounds like you will want to read the GPS location on a timer.
Eg: Every 2 minutes, save your Lat/Lon location.
A search of the documentation for GPS will get your part 1. A search of the documentation for TIMER will get you what you need for part 2. The delay will be based upon how often you get coordinates. Don’t forget that it will use up your battery power if you do it a lot.
Documentation can be found at https://docs.coronalabs.com
That should get you well on the way.
Graham
Thanks for the reply graham07. I had already thought about this, but my biggest doubt would be how would I draw the full line and after tracing it, how could I do to pull the result out of the application? Thank you
A google of “draw route with lat/lon” provided me with some info that should give you an idea on how to proceed.
https://developers.google.com/maps/documentation/javascript/examples/polyline-simple
Without knowing how you wish to display the route, its trickier to answer. If you want to see the output on a map, the google map API (per the link) may provide you with an answer by using simple Polylines. The link will require some reading and adapting to Corona, but the basics are there.
If you need to do it natively, you’ll need to determine how to break down lat/lon to a manageable scale and draw it that way.
Graham09, Thank you very much, you helped me a lot Doubt solved !!
It sounds like you will want to read the GPS location on a timer.
Eg: Every 2 minutes, save your Lat/Lon location.
A search of the documentation for GPS will get your part 1. A search of the documentation for TIMER will get you what you need for part 2. The delay will be based upon how often you get coordinates. Don’t forget that it will use up your battery power if you do it a lot.
Documentation can be found at https://docs.coronalabs.com
That should get you well on the way.
Graham
Thanks for the reply graham07. I had already thought about this, but my biggest doubt would be how would I draw the full line and after tracing it, how could I do to pull the result out of the application? Thank you
A google of “draw route with lat/lon” provided me with some info that should give you an idea on how to proceed.
https://developers.google.com/maps/documentation/javascript/examples/polyline-simple
Without knowing how you wish to display the route, its trickier to answer. If you want to see the output on a map, the google map API (per the link) may provide you with an answer by using simple Polylines. The link will require some reading and adapting to Corona, but the basics are there.
If you need to do it natively, you’ll need to determine how to break down lat/lon to a manageable scale and draw it that way.
Graham09, Thank you very much, you helped me a lot Doubt solved !!