PDA

View Full Version : QML Qt 5 Location show a Route



Gihu
17th August 2012, 08:30
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:



Plugin {
id: myplugin
name : "nokia"
parameters: [
PluginParameter { name: "app_id"; value: "xxx" },
PluginParameter { name: "token"; value: "xxx" }
]
}




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



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


routeData.distance

and


routeData.travelTime

both is 0.


Can anyone help me?

Thank you.

Gihu
20th August 2012, 13:19
Really nobody can help me?

It is very important, because I need it for my Master Thesis.

Thank you.

rospkos
31st August 2012, 09:03
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()