blob: c7c0aa1c491aaf1bbcd7db193c43efc7b2a17f60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
package com.mapbox.mapboxsdk.geometry;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.NonNull;
/**
* A geographical region defined by a {@link LatLng} and a {@link CoordinateSpan}.
*/
public class CoordinateRegion implements Parcelable{
private LatLng mCenter;
private CoordinateSpan mSpan;
public CoordinateRegion(@NonNull Parcel in){
mCenter = in.readParcelable(LatLng.class.getClassLoader());
mSpan = in.readParcelable(CoordinateSpan.class.getClassLoader());
}
public CoordinateRegion(@NonNull LatLng center, @NonNull CoordinateSpan span) {
mCenter = center;
mSpan = span;
}
public LatLng getCenter() {
return mCenter;
}
public void setCenter(@NonNull LatLng center) {
mCenter = center;
}
public CoordinateSpan getSpan() {
return mSpan;
}
public void setSpan(@NonNull CoordinateSpan span) {
this.mSpan = span;
}
public static final Parcelable.Creator<CoordinateRegion> CREATOR =
new Parcelable.Creator<CoordinateRegion>() {
@Override
public CoordinateRegion createFromParcel(Parcel in) {
return new CoordinateRegion(in);
}
@Override
public CoordinateRegion[] newArray(int size) {
return new CoordinateRegion[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int arg1) {
out.writeParcelable(mCenter, arg1);
out.writeParcelable(mSpan, arg1);
}
}
|