QML Qt 5 Location show a Route
Hi, I want to try out some functions of Qt Location 5.0.
I’m only using QML Quick 2.0.
So I already activated and added the Plugin, “nokia†with the token and the app_id.
I also added the Proxy, so that so Map can be loaded.
Showing the Map and navigate to some Places with coordinates already works.
Map Circles and MapQuickItem works, too.
Now my problem, I added:
Code:
Plugin {
id: myplugin
name : "nokia"
parameters: [
PluginParameter { name: "app_id"; value: "xxx" },
PluginParameter { name: "token"; value: "xxx" }
]
}
Code:
Map{
plugin: myplugin
Route{
id: routeData
}
RouteQuery {
id: aQuery
}
RouteModel {
id: routeModel
plugin: myplugin
query: aQuery
autoUpdate: false
}
MapItemView {
model: routeModel
delegate: routeDelegate
}
Component {
id: routeDelegate
MapRoute {
route: routeData
line.color: "blue"
line.width: 5
smooth: true
}
}
}
Now, on klick I change in JavaScript
Code:
aQuery.addWaypoint(startcoordinates)
aQuery.addWaypoint(endcoordinates)
aQuery.travelModes = RouteQuery.CarTravel
routeModel.update()
There is no error shown, but it dows not work, too.
When I read and display the Data of routeData, then there is no error, too.
But
and
Code:
routeData.travelTime
both is 0.
Can anyone help me?
Thank you.
Re: QML Qt 5 Location show a Route
Really nobody can help me?
It is very important, because I need it for my Master Thesis.
Thank you.
Re: QML Qt 5 Location show a Route
do u put code to github? em willing to help.
Added after 12 minutes:
Add id attribute to Map like id: map then in js code refer to addWaypoint() through this id like this... map.aQuery.addWayPoint()