|
| 1 | +/* |
| 2 | + * Copyright 2013-2016 microG Project Team |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
1 | 17 | package com.google.android.maps; |
2 | 18 |
|
3 | 19 | import android.location.Location; |
| 20 | + |
4 | 21 | import org.microg.annotation.OriginalApi; |
5 | 22 | import org.osmdroid.api.IGeoPoint; |
6 | 23 |
|
7 | 24 | @OriginalApi |
8 | 25 | public class GeoPoint implements IGeoPoint { |
9 | | - private final IGeoPoint wrapped; |
| 26 | + private final IGeoPoint wrapped; |
10 | 27 |
|
11 | | - @OriginalApi |
12 | | - public GeoPoint(int latitudeE6, int longitudeE6) { |
13 | | - this(new org.osmdroid.util.GeoPoint(latitudeE6, longitudeE6)); |
14 | | - } |
| 28 | + @OriginalApi |
| 29 | + public GeoPoint(int latitudeE6, int longitudeE6) { |
| 30 | + this(new org.osmdroid.util.GeoPoint(latitudeE6, longitudeE6)); |
| 31 | + } |
15 | 32 |
|
16 | | - public GeoPoint(IGeoPoint wrapped) { |
17 | | - this.wrapped = wrapped; |
18 | | - } |
| 33 | + public GeoPoint(IGeoPoint wrapped) { |
| 34 | + this.wrapped = wrapped; |
| 35 | + } |
19 | 36 |
|
20 | | - public GeoPoint(Location location) { |
21 | | - this((int) (location.getLatitude() * 1e6), (int) (location.getLongitude() * 1e6)); |
22 | | - } |
| 37 | + public GeoPoint(Location location) { |
| 38 | + this((int) (location.getLatitude() * 1e6), (int) (location.getLongitude() * 1e6)); |
| 39 | + } |
23 | 40 |
|
24 | | - @OriginalApi |
25 | | - @Override |
26 | | - public boolean equals(Object other) { |
27 | | - return other == this || (other instanceof GeoPoint) && wrapped.equals(((GeoPoint) other).wrapped); |
28 | | - } |
| 41 | + @OriginalApi |
| 42 | + @Override |
| 43 | + public boolean equals(Object other) { |
| 44 | + return other == this || (other instanceof GeoPoint) && wrapped.equals(((GeoPoint) other).wrapped); |
| 45 | + } |
29 | 46 |
|
30 | | - @Override |
31 | | - public double getLatitude() { |
32 | | - return wrapped.getLatitude(); |
33 | | - } |
| 47 | + @Override |
| 48 | + public double getLatitude() { |
| 49 | + return wrapped.getLatitude(); |
| 50 | + } |
34 | 51 |
|
35 | | - @OriginalApi |
36 | | - @Override |
37 | | - public int getLatitudeE6() { |
38 | | - return wrapped.getLatitudeE6(); |
39 | | - } |
| 52 | + @OriginalApi |
| 53 | + @Override |
| 54 | + public int getLatitudeE6() { |
| 55 | + return wrapped.getLatitudeE6(); |
| 56 | + } |
40 | 57 |
|
41 | | - @Override |
42 | | - public double getLongitude() { |
43 | | - return wrapped.getLongitude(); |
44 | | - } |
| 58 | + @Override |
| 59 | + public double getLongitude() { |
| 60 | + return wrapped.getLongitude(); |
| 61 | + } |
45 | 62 |
|
46 | | - @OriginalApi |
47 | | - @Override |
48 | | - public int getLongitudeE6() { |
49 | | - return wrapped.getLongitudeE6(); |
50 | | - } |
| 63 | + @OriginalApi |
| 64 | + @Override |
| 65 | + public int getLongitudeE6() { |
| 66 | + return wrapped.getLongitudeE6(); |
| 67 | + } |
51 | 68 |
|
52 | | - @OriginalApi |
53 | | - @Override |
54 | | - public int hashCode() { |
55 | | - return wrapped.hashCode(); |
56 | | - } |
| 69 | + @OriginalApi |
| 70 | + @Override |
| 71 | + public int hashCode() { |
| 72 | + return wrapped.hashCode(); |
| 73 | + } |
57 | 74 |
|
58 | | - @OriginalApi |
59 | | - @Override |
60 | | - public String toString() { |
61 | | - return getLatitudeE6() + "," + getLongitudeE6(); |
62 | | - } |
| 75 | + @OriginalApi |
| 76 | + @Override |
| 77 | + public String toString() { |
| 78 | + return getLatitudeE6() + "," + getLongitudeE6(); |
| 79 | + } |
63 | 80 |
|
64 | | - public org.osmdroid.util.GeoPoint toOsmdroid() { |
65 | | - if (wrapped instanceof org.osmdroid.util.GeoPoint) { |
66 | | - return (org.osmdroid.util.GeoPoint) wrapped; |
67 | | - } else { |
68 | | - return new org.osmdroid.util.GeoPoint(wrapped.getLatitudeE6(), wrapped.getLongitudeE6()); |
69 | | - } |
70 | | - } |
| 81 | + public org.osmdroid.util.GeoPoint toOsmdroid() { |
| 82 | + if (wrapped instanceof org.osmdroid.util.GeoPoint) { |
| 83 | + return (org.osmdroid.util.GeoPoint) wrapped; |
| 84 | + } else { |
| 85 | + return new org.osmdroid.util.GeoPoint(wrapped.getLatitudeE6(), wrapped.getLongitudeE6()); |
| 86 | + } |
| 87 | + } |
71 | 88 | } |
0 commit comments