Search in sources :

Example 1 with QualifiedCoordinates

use of javax.microedition.location.QualifiedCoordinates in project CodenameOne by codenameone.

the class MIDPLocationManager method convert.

private Location convert(javax.microedition.location.Location loc) {
    QualifiedCoordinates coor = loc.getQualifiedCoordinates();
    Location retVal = new Location();
    retVal.setAccuracy(coor.getHorizontalAccuracy());
    retVal.setAltitude(coor.getAltitude());
    if (currentCoordinates != null) {
        retVal.setDirection(coor.azimuthTo(currentCoordinates));
    }
    retVal.setLatitude(coor.getLatitude());
    retVal.setLongitude(coor.getLongitude());
    retVal.setTimeStamp(loc.getTimestamp());
    retVal.setVelocity(loc.getSpeed());
    currentCoordinates = coor;
    return retVal;
}
Also used : QualifiedCoordinates(javax.microedition.location.QualifiedCoordinates) Location(com.codename1.location.Location)

Example 2 with QualifiedCoordinates

use of javax.microedition.location.QualifiedCoordinates in project CodenameOne by codenameone.

the class RIMLocationManager method convert.

private Location convert(javax.microedition.location.Location loc) {
    QualifiedCoordinates coor = loc.getQualifiedCoordinates();
    Location retVal = new Location();
    retVal.setAccuracy(coor.getHorizontalAccuracy());
    retVal.setAltitude(coor.getAltitude());
    if (currentCoordinates != null) {
        retVal.setDirection(coor.azimuthTo(currentCoordinates));
    }
    retVal.setLatitude(coor.getLatitude());
    retVal.setLongitude(coor.getLongitude());
    retVal.setTimeStamp(loc.getTimestamp());
    retVal.setVelocity(loc.getSpeed());
    currentCoordinates = coor;
    return retVal;
}
Also used : QualifiedCoordinates(javax.microedition.location.QualifiedCoordinates) Location(com.codename1.location.Location)

Aggregations

Location (com.codename1.location.Location)2 QualifiedCoordinates (javax.microedition.location.QualifiedCoordinates)2