Skip to content

Commit

Permalink
Set the HikeLocation to save doubles instead of LatLng object
Browse files Browse the repository at this point in the history
  • Loading branch information
Ville Haapavaara committed Apr 26, 2017
1 parent 5703645 commit baf111a
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions app/src/main/java/ville/fi/hikemate/Resources/HikeLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,34 @@

public class HikeLocation {

private LatLng location;
private double lat;
private double lng;

public HikeLocation() {

}

public HikeLocation(double lat, double lng) {
location = new LatLng(lat, lng);
this.lat = lat;
this.lng = lng;
}

public void setLocation(LatLng location) {
this.location = location;
public void setLat(double lat) {
this.lat = lat;
}

public LatLng getLocation() {
return location;
public void setLng(double lng) {
this.lng = lng;
}

public double getLat() {
return lat;
}
public double getLng() { return lng; }


@Override
public String toString() {
return "{ \"lat\":" + String.valueOf(location.latitude) + ", \"lng\":" + String.valueOf(location.longitude) + " }";
return "{ \"lat\":" + String.valueOf(lat) + ", \"lng\":" + String.valueOf(lng) + " }";
}
}

0 comments on commit baf111a

Please sign in to comment.