[QT][QML][Mapbox] Route doesn't show
Unsolved
General and Desktop
-
Hi all,
by following a part of this example
https://stackoverflow.com/questions/49943303/display-multiple-routes-on-a-map-using-routemap-qml-qt
I'm trying to show a route inside a MapView in a QML view of my QT application, by using the following code; but the route don't appear. No errors are appearing in the output console. Did I do something wrong? Thank you very much!
Map { anchors.fill: parent plugin: mapboxglPlugin center: QtPositioning.coordinate(60.170448, 24.942046) // Oslo zoomLevel: 16 id: mapMain copyrightsVisible: false RouteModel { id: rm plugin: mapboxglPlugin query: RouteQuery {id: routeQuery } Component.onCompleted: { routeQuery.addWaypoint(QtPositioning.coordinate(60.170448, 24.942046)); routeQuery.addWaypoint(QtPositioning.coordinate(62.170448, 23.942046)); update(); } } MapItemView { model: rm delegate: Component{ MapRoute { route: routeData line.color: "green" line.width: 5 smooth: true } } } }