1
1
package fr .free .nrw .commons .location ;
2
2
3
3
import android .location .Location ;
4
+ import android .net .Uri ;
4
5
import android .support .annotation .NonNull ;
5
6
6
7
/**
@@ -11,15 +12,15 @@ public class LatLng {
11
12
private final double latitude ;
12
13
private final double longitude ;
13
14
private final float accuracy ;
14
-
15
+
15
16
/**
16
17
* Accepts latitude and longitude.
17
18
* North and South values are cut off at 90°
18
- *
19
+ *
19
20
* @param latitude the latitude
20
21
* @param longitude the longitude
21
22
* @param accuracy the accuracy
22
- *
23
+ *
23
24
* Examples:
24
25
* the Statue of Liberty is located at 40.69° N, 74.04° W
25
26
* The Statue of Liberty could be constructed as LatLng(40.69, -74.04, 1.0)
@@ -43,7 +44,7 @@ public LatLng(double latitude, double longitude, float accuracy) {
43
44
public static LatLng from (@ NonNull Location location ) {
44
45
return new LatLng (location .getLatitude (), location .getLongitude (), location .getAccuracy ());
45
46
}
46
-
47
+
47
48
/**
48
49
* creates a hash code for the longitude and longitude
49
50
*/
@@ -153,4 +154,8 @@ public double getLongitude() {
153
154
public double getLatitude () {
154
155
return latitude ;
155
156
}
157
+
158
+ public Uri getGmmIntentUri () {
159
+ return Uri .parse ("geo:0,0?q=" + latitude + "," + longitude );
160
+ }
156
161
}
0 commit comments