Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change MapState to double instead of float #60

Merged
merged 1 commit into from
Jan 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class MapClickEvent extends Event implements Parcelable {
@SerializedName("gesture")
private final String gesture;
@SerializedName("lat")
private float latitude;
private double latitude;
@SerializedName("lng")
private float longitude;
private double longitude;
@SerializedName("zoom")
private float zoom;
private double zoom;
@SerializedName("orientation")
private String orientation = null;
@SerializedName("batteryLevel")
Expand Down Expand Up @@ -75,9 +75,9 @@ private MapClickEvent(Parcel in) {
event = in.readString();
created = in.readString();
gesture = in.readString();
latitude = in.readFloat();
longitude = in.readFloat();
zoom = in.readFloat();
latitude = in.readDouble();
longitude = in.readDouble();
zoom = in.readDouble();
orientation = in.readString();
batteryLevel = in.readByte() == 0x00 ? null : in.readInt();
byte pluggedInVal = in.readByte();
Expand All @@ -98,9 +98,9 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeString(event);
dest.writeString(created);
dest.writeString(gesture);
dest.writeFloat(latitude);
dest.writeFloat(longitude);
dest.writeFloat(zoom);
dest.writeDouble(latitude);
dest.writeDouble(longitude);
dest.writeDouble(zoom);
dest.writeString(orientation);
if (batteryLevel == null) {
dest.writeByte((byte) (0x00));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class MapDragendEvent extends Event implements Parcelable {
@SerializedName("created")
private String created;
@SerializedName("lat")
private float latitude;
private double latitude;
@SerializedName("lng")
private float longitude;
private double longitude;
@SerializedName("zoom")
private float zoom;
private double zoom;
@SerializedName("orientation")
private String orientation = null;
@SerializedName("batteryLevel")
Expand Down Expand Up @@ -71,9 +71,9 @@ void setWifi(boolean wifi) {
private MapDragendEvent(Parcel in) {
event = in.readString();
created = in.readString();
latitude = in.readFloat();
longitude = in.readFloat();
zoom = in.readFloat();
latitude = in.readDouble();
longitude = in.readDouble();
zoom = in.readDouble();
orientation = in.readString();
batteryLevel = in.readByte() == 0x00 ? null : in.readInt();
byte pluggedInVal = in.readByte();
Expand All @@ -93,9 +93,9 @@ public int describeContents() {
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(event);
dest.writeString(created);
dest.writeFloat(latitude);
dest.writeFloat(longitude);
dest.writeFloat(zoom);
dest.writeDouble(latitude);
dest.writeDouble(longitude);
dest.writeDouble(zoom);
dest.writeString(orientation);
if (batteryLevel == null) {
dest.writeByte((byte) (0x00));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.mapbox.android.telemetry;

public class MapState {
private float latitude;
private float longitude;
private float zoom;
private double latitude;
private double longitude;
private double zoom;
private String gesture;

public MapState(float latitude, float longitude, float zoom) {
public MapState(double latitude, double longitude, double zoom) {
this.latitude = latitude;
this.longitude = longitude;
this.zoom = zoom;
Expand All @@ -20,15 +20,15 @@ String getGesture() {
return gesture;
}

float getLatitude() {
double getLatitude() {
return latitude;
}

float getLongitude() {
double getLongitude() {
return longitude;
}

float getZoom() {
double getZoom() {
return zoom;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ private void initializeMapboxTelemetry() {
}

private MapState obtainAValidMapState() {
float aLatitude = 40.416775f;
float aLongitude = -3.703790f;
float aZoom = 1.5f;
double aLatitude = 40.416775d;
double aLongitude = -3.703790d;
double aZoom = 1.5d;
return new MapState(aLatitude, aLongitude, aZoom);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ private void initializeMapboxTelemetry(Context context) {
}

private MapState obtainDefaultMapState() {
float aLatitude = 40.416775f;
float aLongitude = -3.703790f;
float aZoom = 1.5f;
double aLatitude = 40.416775d;
double aLongitude = -3.703790d;
double aZoom = 1.5d;
return new MapState(aLatitude, aLongitude, aZoom);
}

Expand Down