Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Display different routes for different start/end points using Qt Locations

Display different routes for different start/end points using Qt Locations

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qtlocationqmlmapmapitemview
1 Posts 1 Posters 483 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    follunnass
    wrote on 21 Apr 2018, 12:19 last edited by
    #1

    I'm trying to display different routes that have different start and end points. There'e no relations between them. but I couldn't achieve that using multiple RouteModels like this:

    RouteModel {
        id: rm
        plugin: somePlugin
        query: RouteQuery {}
        Component.onCompleted: {
            query.addWaypoint(QtPositioning.coordinate(26.291584, 50.199094));
            query.addWaypoint(QtPositioning.coordinate(26.288128, 50.188725));
        }
    }
    
    RouteModel {
        id: rm1
        plugin: somePlugin
        query: RouteQuery {}
        Component.onCompleted: {
            query.addWaypoint(QtPositioning.coordinate(26.278496, 50.203740));
            query.addWaypoint(QtPositioning.coordinate(26.272351, 50.185939));
            rm1.update();
        }
    }
    
    Map {
        id: map
        anchors.fill: parent
        plugin: somePlugin
        center: magione
        gesture.enabled: true
        zoomLevel: 13
    
        MapItemView {
            model: rm
            delegate: MapRoute {
                route: routeData
                line.color: "green"
                line.width: 5
                smooth: true
            }
        }
    
        MapItemView {
            model: rm1
            delegate: MapRoute {
                route: routeData
                line.color: "red"
                line.width: 5
                smooth: true
            }
        }
    }
    

    But only the last RouteModel is the one that shows! I want both to display simultaneously, any idea how can I achieve that?

    1 Reply Last reply
    0

    1/1

    21 Apr 2018, 12:19

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved