QtPositioning 5.3, QML PositionSource Returning data to ios 8.1?

I am creating a simple photo application and need the GPS coordinates of the current image. I followed the basics of creating and validating the PositionSource element in qml (and that seems fine). But when I access the coordinates and timestamps, it gives me an invalid time and NaN.

I added import of QtPositioning 5.3 in qml and in the .pro file quick positioning of QT + = qml

Heres my PositionSource Element

PositionSource {
        id: src
        active: true
        preferredPositioningMethods: PositionSource.SatellitePositioningMethods

        Component.onCompleted: {
            src.start()
            src.update()
            var supPos  = "Unknown"
            if (src.supportedPositioningMethods == PositionSource.NoPositioningMethods) {
                 supPos = "NoPositioningMethods"
            } else if (src.supportedPositioningMethods == PositionSource.AllPositioningMethods) {
                 supPos = "AllPositioningMethods"
            } else if (src.supportedPositioningMethods == PositionSource.SatellitePositioningMethods) {
                 supPos = "SatellitePositioningMethods"
            } else if (src.supportedPositioningMethods == PositionSource.NonSatellitePositioningMethods) {
                 supPos = "NonSatellitePositioningMethods"
            }
            console.log("Position Source Loaded || Supported: "+supPos+" Valid: "+valid)
        }

        onPositionChanged: {
            var coord = src.position.coordinate;
            console.log("Coordinate:", coord.longitude, coord.latitude);
        }
    }

When I launch the application on iOS 8.1 (iphone 4s), it gives me AllPositioningMethods and Valid True. But when I call:

function getPos() {
    var coord = src.position.coordinate;
    posTest.text = "Coordinates lat:"+coord.latitude+" lon:"+coord.longitude+" time:"+src.position.timestamp
}

jus NaN NaN ... - PositionSource ...? ... ios and android..

**** Android 4.4.4 (MotoX)

+4
2

. :


<key>NSLocationWhenInUseUsageDescription</key>
<string>Explanation to user.</string>

<key>NSLocationAlwaysUsageDescription</key>
<string>Explanation to user.</string>

, , .

+1

All Articles