Wednesday 12 July 2017

TrafficControl: Adding Tracks to QML Map (part 3)

I found how to add coordinates to a QML Map Polyline, so now the tracks are much smoother.


The method AddCoordinate needs a coordinate that is created using QtPositioning.coordinate(...). Using that, it is easy to loop over the coordinates in the coordinatelist and generate the curved tracks, as can be seen below.

I also implemented a better way of separating the double tracks, shifting the second track 90 degrees from the principal direction of the track. That is done in the KMLParser script (Python).

For now, I'm happy with the visualisation of the tracks. The next step will be to implement the trains.

No comments:

Post a Comment