Search in sources :

Example 1 with IGeoPoint

use of org.osmdroid.api.IGeoPoint in project Conversations by siacs.

the class ShareLocationActivity method shareLocation.

private void shareLocation(final View view) {
    final Intent result = new Intent();
    if (marker_fixed_to_loc && myLoc != null) {
        result.putExtra("latitude", myLoc.getLatitude());
        result.putExtra("longitude", myLoc.getLongitude());
        result.putExtra("altitude", myLoc.getAltitude());
        result.putExtra("accuracy", DoubleMath.roundToInt(myLoc.getAccuracy(), RoundingMode.HALF_UP));
    } else {
        final IGeoPoint markerPoint = this.binding.map.getMapCenter();
        result.putExtra("latitude", markerPoint.getLatitude());
        result.putExtra("longitude", markerPoint.getLongitude());
    }
    setResult(RESULT_OK, result);
    finish();
}
Also used : IGeoPoint(org.osmdroid.api.IGeoPoint) Intent(android.content.Intent)

Example 2 with IGeoPoint

use of org.osmdroid.api.IGeoPoint in project Conversations by siacs.

the class LocationActivity method onSaveInstanceState.

@Override
protected void onSaveInstanceState(@NonNull final Bundle outState) {
    super.onSaveInstanceState(outState);
    final IGeoPoint center = map.getMapCenter();
    outState.putParcelable(KEY_LOCATION, new GeoPoint(center.getLatitude(), center.getLongitude()));
    outState.putDouble(KEY_ZOOM_LEVEL, map.getZoomLevelDouble());
}
Also used : GeoPoint(org.osmdroid.util.GeoPoint) IGeoPoint(org.osmdroid.api.IGeoPoint) IGeoPoint(org.osmdroid.api.IGeoPoint)

Aggregations

IGeoPoint (org.osmdroid.api.IGeoPoint)2 Intent (android.content.Intent)1 GeoPoint (org.osmdroid.util.GeoPoint)1