mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Revert "remove unneeded codes copied from previous implementation"
This reverts commit 42539651de.
This commit is contained in:
parent
42539651de
commit
5b69daa5d6
1 changed files with 25 additions and 3 deletions
|
|
@ -189,9 +189,31 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
Timber.d("Nearby map fragment created");
|
Timber.d("Nearby map fragment created");
|
||||||
Mapbox.getInstance(getActivity(),
|
|
||||||
getString(R.string.mapbox_commons_app_token));
|
Bundle bundle = this.getArguments();
|
||||||
Mapbox.getTelemetry().setUserTelemetryRequestState(false);
|
if (bundle != null) {
|
||||||
|
String gsonPlaceList = bundle.getString("PlaceList");
|
||||||
|
String gsonLatLng = bundle.getString("CurLatLng");
|
||||||
|
Type listType = new TypeToken<List<Place>>() {
|
||||||
|
}.getType();
|
||||||
|
String gsonBoundaryCoordinates = bundle.getString("BoundaryCoord");
|
||||||
|
List<Place> placeList = gson.fromJson(gsonPlaceList, listType);
|
||||||
|
Type curLatLngType = new TypeToken<fr.free.nrw.commons.location.LatLng>() {
|
||||||
|
}.getType();
|
||||||
|
Type gsonBoundaryCoordinatesType = new TypeToken<fr.free.nrw.commons.location.LatLng[]>() {}.getType();
|
||||||
|
curLatLng = gson.fromJson(gsonLatLng, curLatLngType);
|
||||||
|
baseMarkerOptions = NearbyController
|
||||||
|
.loadAttractionsFromLocationToBaseMarkerOptions(curLatLng,
|
||||||
|
placeList,
|
||||||
|
getActivity(),
|
||||||
|
bookmarkLocationDao.getAllBookmarksLocations());
|
||||||
|
boundaryCoordinates = gson.fromJson(gsonBoundaryCoordinates, gsonBoundaryCoordinatesType);
|
||||||
|
}
|
||||||
|
if (curLatLng != null) {
|
||||||
|
Mapbox.getInstance(getActivity(),
|
||||||
|
getString(R.string.mapbox_commons_app_token));
|
||||||
|
Mapbox.getTelemetry().setUserTelemetryRequestState(false);
|
||||||
|
}
|
||||||
setRetainInstance(true);
|
setRetainInstance(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue