Results 1 to 3 of 3

Thread: QML Qt 5 Location show a Route

  1. #1
    Join Date
    May 2012
    Posts
    5

    Default 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:

    Qt Code:
    1. Plugin {
    2. id: myplugin
    3. name : "nokia"
    4. parameters: [
    5. PluginParameter { name: "app_id"; value: "xxx" },
    6. PluginParameter { name: "token"; value: "xxx" }
    7. ]
    8. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. Map{
    2. plugin: myplugin
    3.  
    4. Route{
    5. id: routeData
    6. }
    7.  
    8. RouteQuery {
    9. id: aQuery
    10. }
    11.  
    12. RouteModel {
    13. id: routeModel
    14. plugin: myplugin
    15. query: aQuery
    16. autoUpdate: false
    17. }
    18.  
    19. MapItemView {
    20. model: routeModel
    21. delegate: routeDelegate
    22. }
    23.  
    24. Component {
    25. id: routeDelegate
    26.  
    27. MapRoute {
    28. route: routeData
    29. line.color: "blue"
    30. line.width: 5
    31. smooth: true
    32. }
    33. }
    34. }
    To copy to clipboard, switch view to plain text mode 

    Now, on klick I change in JavaScript

    Qt Code:
    1. aQuery.addWaypoint(startcoordinates)
    2. aQuery.addWaypoint(endcoordinates)
    3. aQuery.travelModes = RouteQuery.CarTravel
    4. 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
    Qt Code:
    1. routeData.distance
    To copy to clipboard, switch view to plain text mode 
    and
    Qt Code:
    1. routeData.travelTime
    To copy to clipboard, switch view to plain text mode 
    both is 0.


    Can anyone help me?

    Thank you.

  2. #2
    Join Date
    May 2012
    Posts
    5

    Default 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.

  3. #3
    Join Date
    Aug 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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()
    Last edited by rospkos; 31st August 2012 at 10:03.

Similar Threads

  1. Using GoogleMaps to show route?
    By Terreox in forum Qt Programming
    Replies: 2
    Last Post: 4th March 2012, 23:56
  2. How to change the route in the *.h files ?
    By wter27 in forum Qt Programming
    Replies: 8
    Last Post: 11th May 2011, 13:58
  3. Replies: 3
    Last Post: 12th July 2010, 14:12
  4. how to fix widget location
    By ht1 in forum Qt Programming
    Replies: 3
    Last Post: 22nd November 2007, 08:10
  5. socket programming... getting "no route to host"
    By babusunlux in forum Qt Programming
    Replies: 1
    Last Post: 4th August 2006, 21:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.