summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java18
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/test/java/com/mapbox/mapboxsdk/camera/CameraPositionTest.java22
2 files changed, 20 insertions, 20 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java
index 3a365de60a..f1432b1e8d 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/camera/CameraPosition.java
@@ -125,7 +125,7 @@ public final class CameraPosition implements Parcelable {
private LatLng target = null;
private double tilt = -1;
private double zoom = -1;
- private boolean isRadiant;
+ private boolean isRadian;
/**
* Creates an empty builder.
@@ -135,12 +135,12 @@ public final class CameraPosition implements Parcelable {
}
/**
- * Creates a builder for building CameraPosition objects using radiants.
+ * Creates a builder for building CameraPosition objects using radians.
*
- * @param isRadiant true if heading is in radiants
+ * @param isRadian true if heading is in radians
*/
- public Builder(boolean isRadiant) {
- this.isRadiant = isRadiant;
+ public Builder(boolean isRadian) {
+ this.isRadian = isRadian;
}
/**
@@ -224,10 +224,10 @@ public final class CameraPosition implements Parcelable {
* @return Builder
*/
public Builder bearing(double bearing) {
- if (isRadiant) {
+ if (isRadian) {
this.bearing = bearing;
} else {
- // converting degrees to radiant
+ // converting degrees to radians
this.bearing = (float) (-bearing * MathConstants.DEG2RAD);
}
return this;
@@ -261,10 +261,10 @@ public final class CameraPosition implements Parcelable {
*/
@FloatRange(from = 0.0, to = 60.0)
public Builder tilt(double tilt) {
- if (isRadiant) {
+ if (isRadian) {
this.tilt = tilt;
} else {
- // converting degrees to radiant
+ // converting degrees to radians
this.tilt = (float) (MathUtils.clamp(tilt, MapboxConstants.MINIMUM_TILT, MapboxConstants.MAXIMUM_TILT) * MathConstants.DEG2RAD);
}
return this;
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/com/mapbox/mapboxsdk/camera/CameraPositionTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/com/mapbox/mapboxsdk/camera/CameraPositionTest.java
index 4775bb39a4..f8c6a1a3c8 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/com/mapbox/mapboxsdk/camera/CameraPositionTest.java
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/test/java/com/mapbox/mapboxsdk/camera/CameraPositionTest.java
@@ -90,11 +90,11 @@ public class CameraPositionTest {
public void testHashcode() {
LatLng latLng = new LatLng(1, 2);
CameraPosition cameraPosition = new CameraPosition(latLng, 3, 4, 5);
- assertEquals("toString should match", -1007681505, cameraPosition.hashCode());
+ assertEquals("hashCode should match", -1007681505, cameraPosition.hashCode());
}
@Test
- public void testRadiantBuilder() {
+ public void testRadianBuilder() {
LatLng latLng = new LatLng(1, 2);
CameraPosition.Builder builder = new CameraPosition.Builder(true);
builder.target(latLng);
@@ -106,12 +106,12 @@ public class CameraPositionTest {
}
@Test
- public void testDegreesRadiantBuilder() {
+ public void testDegreesRadianBuilder() {
LatLng latLng = new LatLng(1, 2);
float tilt = 4;
float bearing = 5;
- float bearingRadiant = (float) (-bearing * MathConstants.DEG2RAD);
- float tiltRadiant = (float) (MathUtils.clamp(tilt, MapboxConstants.MINIMUM_TILT, MapboxConstants.MAXIMUM_TILT) * MathConstants.DEG2RAD);
+ float bearingRadian = (float) (-bearing * MathConstants.DEG2RAD);
+ float tiltRadian = (float) (MathUtils.clamp(tilt, MapboxConstants.MINIMUM_TILT, MapboxConstants.MAXIMUM_TILT) * MathConstants.DEG2RAD);
CameraPosition.Builder degreeBuilder = new CameraPosition.Builder(false);
degreeBuilder.target(latLng);
@@ -119,12 +119,12 @@ public class CameraPositionTest {
degreeBuilder.tilt(tilt);
degreeBuilder.bearing(bearing);
- CameraPosition.Builder radiantBuilder = new CameraPosition.Builder(true);
- radiantBuilder.target(latLng);
- radiantBuilder.zoom(3);
- radiantBuilder.tilt(tiltRadiant);
- radiantBuilder.bearing(bearingRadiant);
- assertEquals("CameraPosition should match", radiantBuilder.build(), degreeBuilder.build());
+ CameraPosition.Builder radianBuilder = new CameraPosition.Builder(true);
+ radianBuilder.target(latLng);
+ radianBuilder.zoom(3);
+ radianBuilder.tilt(tiltRadian);
+ radianBuilder.bearing(bearingRadian);
+ assertEquals("CameraPosition should match", radianBuilder.build(), degreeBuilder.build());
}
@Test