Qt Quick - adding coordinate - Help



  • Guys wondering if anybody could tell me where I am going wrong with this one.

    Basically I have a button that when clicked I want to add the next coordinate for a polyline and then for it to show up on my map - however nothing seems to happen.

    Any ideas how to add the coordinate and update on map?

    Here is the code:

     MapPolyline {
    
            id: polyline
            line.width: 3
            line.color: 'pink'
            path: [
            { latitude: 53.336272, longitude: -2.837986000001 },
            { latitude: 53.33583666169488, longitude: -2.837948799133301 },
            { latitude: 53.33487728642166, longitude: -2.857099771499634 },
            { latitude: 53.334353, longitude: -2.855717999996 }
                  ]
            }
    

    and for the button:

     Button {
            id: button3
            x: 17
            y: 193
            width: 104
            height: 23
            text: qsTr("Test Alpha ")
            onClicked:{
                polyline.addCoordinate(53.33378174636405,-2.8531837463378906)
                update(polyline)
            }
    
    

    Cheers!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.