@@ -248,7 +248,7 @@ public List<Place> getPlacesByRadar(double lat, double lng, double radius, int l
248
248
try {
249
249
String uri = buildUrl (METHOD_RADAR_SEARCH , String .format (Locale .ENGLISH , "key=%s&location=%f,%f&radius=%f" ,
250
250
apiKey , lat , lng , radius ), extraParams );
251
- return getPlaces (uri , METHOD_RADAR_SEARCH , limit );
251
+ return getRadarPlaces (uri , METHOD_RADAR_SEARCH , limit );
252
252
} catch (Exception e ) {
253
253
throw new GooglePlacesException (e );
254
254
}
@@ -392,7 +392,6 @@ public List<Prediction> getQueryPredictions(String input, Param... extraParams)
392
392
}
393
393
394
394
private List <Place > getPlaces (String uri , String method , int limit ) throws IOException {
395
-
396
395
limit = Math .min (limit , MAXIMUM_RESULTS ); // max of 60 results possible
397
396
int pages = (int ) Math .ceil (limit / (double ) MAXIMUM_PAGE_RESULTS );
398
397
@@ -417,6 +416,17 @@ private List<Place> getPlaces(String uri, String method, int limit) throws IOExc
417
416
return places ;
418
417
}
419
418
419
+ private List <Place > getRadarPlaces (String uri , String method , int limit ) throws IOException {
420
+ limit = Math .min (limit , MAXIMUM_RADAR_RESULTS ); // max of 200 results possible
421
+
422
+ List <Place > places = new ArrayList <>();
423
+ String raw = requestHandler .get (uri );
424
+ debug (raw );
425
+ parse (this , places , raw , limit );
426
+
427
+ return places ;
428
+ }
429
+
420
430
private void sleep (long millis ) {
421
431
try {
422
432
Thread .sleep (millis );
0 commit comments