How do I move my map markers in realtime on Qt?

348 views Asked by At

I'm using Qt to run on Android. I'm working on a qtlocation map and I want to update my location in realtime. I have set my updateInterval: 1 (0.001 seconds) but MapQuickItem is still moving too late.

PositionSource {
    id: ps
    updateInterval: 500
    active: true
    onPositionChanged: {
        console.log(position.coordinate);
    }
}

Map {
    id: map
    anchors.fill: parent

    plugin: Plugin {
        name: "osm"

        PluginParameter {
            name: "mapboxgl.mapping.items.insert_before"
            value: "road-label-small"
        }

        PluginParameter {
            name: "mapboxgl.access_token"
            value: "myToken"
        }

        PluginParameter {
            name: "mapboxgl.mapping.additional_style_urls"
            value: "Urls"
        }
    }

    MapQuickItem {
        zoomLevel: map.zoomLevel

        sourceItem: Image {
            id: carMarker
            source: "../images/circle.png"
        }

        coordinate: ps.position.coordinate
        anchorPoint.x: carMarker.width / 2
        anchorPoint.y: carMarker.height / 2
    }
}

Is there a way about that how can I move my marker in realtime?

and this the result: enter image description here

or this: https://drive.google.com/file/d/1lLMuyWX4WQYw-L4jdx-sq-xstkjVRyCl/view?usp=sharing

0

There are 0 answers