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" }
]
}
Plugin {
id: myplugin
name : "nokia"
parameters: [
PluginParameter { name: "app_id"; value: "xxx" },
PluginParameter { name: "token"; value: "xxx" }
]
}
To copy to clipboard, switch view to plain text mode
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
}
}
}
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
}
}
}
To copy to clipboard, switch view to plain text mode
Now, on klick I change in JavaScript
aQuery.addWaypoint(startcoordinates)
aQuery.addWaypoint(endcoordinates)
aQuery.travelModes = RouteQuery.CarTravel
routeModel.update()
aQuery.addWaypoint(startcoordinates)
aQuery.addWaypoint(endcoordinates)
aQuery.travelModes = RouteQuery.CarTravel
routeModel.update()
To copy to clipboard, switch view to plain text mode
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
routeData.distance
To copy to clipboard, switch view to plain text mode
and
routeData.travelTime
routeData.travelTime
To copy to clipboard, switch view to plain text mode
both is 0.
Can anyone help me?
Thank you.
Bookmarks