Topic: Draw Line from GPX
Hi Alex,
Am having trouble drawing a line on a tileset map from points in a GPX file. File is parsed fine, I pass the
OnlineMapsGPXObject.TrackSegment.pointsinto
OnlineMapsDrawingLineand I even get a
truereturned for
path.visiblebut there remains no line drawn across the tileset? Here's the code I'm using ...
if(File.Exists(pathToGPX))
{
// Load data from file into string
string data = File.ReadAllText(pathToGPX, Encoding.UTF8);
// Attempt to load data as GPX object
gpx = OnlineMapsGPXObject.Load(data);
foreach(OnlineMapsGPXObject.Track route in gpx.tracks)
{
Debug.LogFormat("Bike Track - {0}",route.name);
foreach(OnlineMapsGPXObject.TrackSegment segment in route.segments)
{
Debug.LogFormat("Route {0}, points {1}",route.name,segment.points.ToString());
for(int i=0; i<segment.points.Count;i++) Debug.LogFormat("Waypoint - {0},{1}",segment.points[i].lat, segment.points[i].lon);
OnlineMapsDrawingLine path = new OnlineMapsDrawingLine(segment.points, Color.red);
api.AddDrawingElement(path);
// api.Redraw();
Debug.Log("path is visible?? "+path.visible);
}Am I missing something really obvious / stupid?? Help please ;-)