7
7
import com .mapbox .mapboxsdk .annotations .BaseMarkerOptions ;
8
8
import com .mapbox .mapboxsdk .annotations .MarkerOptions ;
9
9
10
+ import fr .free .nrw .commons .location .LatLng ;
11
+
10
12
import java .util .ArrayList ;
11
13
import java .util .Collections ;
12
14
import java .util .Comparator ;
15
17
import java .util .Locale ;
16
18
import java .util .Map ;
17
19
18
- import fr .free .nrw .commons .location .LatLng ;
19
20
import timber .log .Timber ;
20
21
21
22
import static fr .free .nrw .commons .utils .LengthUtils .computeDistanceBetween ;
@@ -56,13 +57,14 @@ public int compare(Place lhs, Place rhs) {
56
57
}
57
58
58
59
/**
59
- * Loads attractions from location for list view, we need to return Place data type
60
- * @param curLatLng
61
- * @param context
60
+ * Loads attractions from location for list view, we need to return Place data type.
61
+ * @param curLatLng users current location
62
+ * @param context current activity
62
63
* @return
63
64
*/
64
65
65
- public static List <Place > loadAttractionsFromLocationToPlaces (LatLng curLatLng , Context context ) {
66
+ public static List <Place > loadAttractionsFromLocationToPlaces (LatLng curLatLng ,
67
+ Context context ) {
66
68
67
69
List <Place > places = loadAttractionsFromLocation (curLatLng ,context );
68
70
places = places .subList (0 , Math .min (places .size (), MAX_RESULTS ));
@@ -74,9 +76,9 @@ public static List<Place> loadAttractionsFromLocationToPlaces(LatLng curLatLng,
74
76
}
75
77
76
78
/**
77
- *Loads attractions from location for map view, we need to return BaseMarkerOption data type
78
- * @param curLatLng
79
- * @param context
79
+ *Loads attractions from location for map view, we need to return BaseMarkerOption data type.
80
+ * @param curLatLng users current location
81
+ * @param context the activity
80
82
* @return
81
83
*/
82
84
public static List <BaseMarkerOptions > loadAttractionsFromLocationToBaseMarkerOptions (
@@ -89,10 +91,10 @@ public static List<BaseMarkerOptions> loadAttractionsFromLocationToBaseMarkerOpt
89
91
String distance = formatDistanceBetween (curLatLng , place .location );
90
92
place .setDistance (distance );
91
93
baseMarkerOptionses .add (new MarkerOptions ()
92
- .position (new com .mapbox .mapboxsdk .geometry
94
+ .position (new com .mapbox .mapboxsdk .geometry
93
95
.LatLng (place .location .latitude ,place .location .longitude ))
94
- .title (place .name )
95
- .snippet (place .description ));
96
+ .title (place .name )
97
+ .snippet (place .description ));
96
98
}
97
99
return baseMarkerOptionses ;
98
100
}
0 commit comments