Skip to content

Commit de7a49b

Browse files
committed
center map on location clicked in nearby (commons-app#2060)
1 parent ada67e0 commit de7a49b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,10 @@ private void addNearbyMarkersToMapBoxMap(@Nullable List<NearbyBaseMarker> custom
677677
passInfoToSheet(place);
678678
bottomSheetListBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
679679
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
680-
680+
CameraPosition position = new CameraPosition.Builder()
681+
.target(marker.getPosition())
682+
.build();
683+
mapboxMap.animateCamera(CameraUpdateFactory.newCameraPosition(position));
681684
}
682685
return false;
683686
});

0 commit comments

Comments
 (0)