use of fr.free.nrw.commons.location.LatLng in project apps-android-commons by commons-app.
the class LengthUtilsTest method testOneDegreeFortyFiveDegrees.
@Test
public void testOneDegreeFortyFiveDegrees() {
LatLng pointA = new LatLng(45, 0, 0);
LatLng pointB = new LatLng(45, 1, 0);
String distance = LengthUtils.formatDistanceBetween(pointA, pointB);
Assert.assertThat(distance, is("78.6km"));
}
use of fr.free.nrw.commons.location.LatLng in project apps-android-commons by commons-app.
the class LatLngTests method testTooBigWestValue.
@Test
public void testTooBigWestValue() {
LatLng place = new LatLng(20, -190, 0);
String prettyString = place.getPrettyCoordinateString();
Assert.assertThat(prettyString, is("20.0 N, 170.0 E"));
}
use of fr.free.nrw.commons.location.LatLng in project apps-android-commons by commons-app.
the class LatLngTests method testZeroZero.
@Test
public void testZeroZero() {
LatLng place = new LatLng(0, 0, 0);
String prettyString = place.getPrettyCoordinateString();
Assert.assertThat(prettyString, is("0.0 N, 0.0 E"));
}
use of fr.free.nrw.commons.location.LatLng in project apps-android-commons by commons-app.
the class LatLngTests method testRoundingAgain.
@Test
public void testRoundingAgain() {
LatLng place = new LatLng(-0.000001, -0.999999, 0);
String prettyString = place.getPrettyCoordinateString();
Assert.assertThat(prettyString, is("0.0 S, 1.0 W"));
}
use of fr.free.nrw.commons.location.LatLng in project apps-android-commons by commons-app.
the class NearbyInfoDialog method initUi.
private void initUi() {
Bundle bundle = getArguments();
placeTitle.setText(bundle.getString(ARG_TITLE));
placeDescription.setText(bundle.getString(ARG_DESC));
location = new LatLng(bundle.getDouble(ARG_LATITUDE), bundle.getDouble(ARG_LONGITUDE), 0);
getArticleLink(bundle);
}
Aggregations