Skip to content

Instantly share code, notes, and snippets.

@otsaloma
Last active March 17, 2018 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otsaloma/4f19455369ddd4ad294f93a1b6c812be to your computer and use it in GitHub Desktop.
Save otsaloma/4f19455369ddd4ad294f93a1b6c812be to your computer and use it in GitHub Desktop.
A drop-in replacement for PositionSource.qml for testing
// -*- 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);
}
}
@otsaloma
Copy link
Author

otsaloma commented Oct 26, 2016

For use with Poor Maps, Pan Transit etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment