Last active
March 17, 2018 21:09
-
-
Save otsaloma/4f19455369ddd4ad294f93a1b6c812be to your computer and use it in GitHub Desktop.
A drop-in replacement for PositionSource.qml for testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -*- coding: utf-8-unix -*- | |
import QtQuick 2.0 | |
import QtPositioning 5.2 | |
// A drop-in replacement for PositionSource.qml for testing. | |
Item { | |
id: gps | |
property var direction: 0 | |
property var position: QtObject { | |
property var coordinate: QtPositioning.coordinate(60.16807, 24.94155) | |
property var horizontalAccuracy: 5 | |
property var horizontalAccuracyValid: true | |
property var latitudeValid: true | |
property var longitudeValid: true | |
property var speed: 15 | |
property var speedValid: true | |
} | |
property bool ready: true | |
Timer { | |
interval: 200 | |
repeat: true | |
running: app.running | |
// Plain static reassignment to trigger onPositionChanged. | |
// onTriggered: gps.position = gps.position; | |
// Hook position to map center point. | |
onTriggered: gps.position.coordinate = QtPositioning.coordinate( | |
map.center.latitude, map.center.longitude); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For use with Poor Maps, Pan Transit etc.